diff options
Diffstat (limited to 'clang/lib/CIR/CodeGen/CIRGenModule.cpp')
-rw-r--r-- | clang/lib/CIR/CodeGen/CIRGenModule.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/clang/lib/CIR/CodeGen/CIRGenModule.cpp b/clang/lib/CIR/CodeGen/CIRGenModule.cpp index d529688..7c52adc 100644 --- a/clang/lib/CIR/CodeGen/CIRGenModule.cpp +++ b/clang/lib/CIR/CodeGen/CIRGenModule.cpp @@ -458,7 +458,7 @@ mlir::Operation *CIRGenModule::getGlobalValue(StringRef name) { cir::GlobalOp CIRGenModule::createGlobalOp(CIRGenModule &cgm, mlir::Location loc, StringRef name, - mlir::Type t, + mlir::Type t, bool isConstant, mlir::Operation *insertPoint) { cir::GlobalOp g; CIRGenBuilderTy &builder = cgm.getBuilder(); @@ -479,7 +479,7 @@ cir::GlobalOp CIRGenModule::createGlobalOp(CIRGenModule &cgm, builder.setInsertionPointToStart(cgm.getModule().getBody()); } - g = builder.create<cir::GlobalOp>(loc, name, t); + g = builder.create<cir::GlobalOp>(loc, name, t, isConstant); if (!insertPoint) cgm.lastGlobalOp = g; @@ -581,7 +581,7 @@ CIRGenModule::getOrCreateCIRGlobal(StringRef mangledName, mlir::Type ty, // mlir::SymbolTable::Visibility::Public is the default, no need to explicitly // mark it as such. cir::GlobalOp gv = - CIRGenModule::createGlobalOp(*this, loc, mangledName, ty, + CIRGenModule::createGlobalOp(*this, loc, mangledName, ty, false, /*insertPoint=*/entry.getOperation()); // This is the first use or definition of a mangled name. If there is a @@ -1239,8 +1239,8 @@ generateStringLiteral(mlir::Location loc, mlir::TypedAttr c, // Create a global variable for this string // FIXME(cir): check for insertion point in module level. - cir::GlobalOp gv = - CIRGenModule::createGlobalOp(cgm, loc, globalName, c.getType()); + cir::GlobalOp gv = CIRGenModule::createGlobalOp( + cgm, loc, globalName, c.getType(), !cgm.getLangOpts().WritableStrings); // Set up extra information and add to the module gv.setAlignmentAttr(cgm.getSize(alignment)); |