| 89 | } |
| 90 | |
| 91 | static Value createGlobalCString(Operation *op, Location loc, |
| 92 | ConversionPatternRewriter &rewriter, |
| 93 | StringRef regName) { |
| 94 | cudaq::IRBuilder irb(rewriter.getContext()); |
| 95 | auto mod = op->getParentOfType<ModuleOp>(); |
| 96 | auto nameObj = irb.genCStringLiteralAppendNul(loc, mod, regName); |
| 97 | Value nameVal = cudaq::cc::AddressOfOp::create( |
| 98 | rewriter, loc, cudaq::cc::PointerType::get(nameObj.getType()), |
| 99 | nameObj.getName()); |
| 100 | auto cstrTy = cudaq::cc::PointerType::get(rewriter.getI8Type()); |
| 101 | return cudaq::cc::CastOp::create(rewriter, loc, cstrTy, nameVal); |
| 102 | } |
| 103 | |
| 104 | /// Use modifier class classes to specialize the QIR API to a particular flavor |
| 105 | /// of QIR. For example, the names of the actual functions in "full QIR" are |
no test coverage detected