[clang] [clang] Add per-global code model attribute (PR #72078)

Fangrui Song via cfe-commits cfe-commits at lists.llvm.org
Mon Dec 11 19:30:46 PST 2023


================
@@ -4841,6 +4841,19 @@ CodeGenModule::GetOrCreateLLVMGlobal(StringRef MangledName, llvm::Type *Ty,
         isExternallyVisible(D->getLinkageAndVisibility().getLinkage()))
       GV->setSection(".cp.rodata");
 
+    // Handle code model attribute
+    if (D->hasAttr<CodeModelAttr>()) {
+      if (const CodeModelAttr *CMA = D->getAttr<CodeModelAttr>()) {
----------------
MaskRay wrote:

`const auto *`

https://github.com/llvm/llvm-project/pull/72078


More information about the cfe-commits mailing list