[clang] [clang] Add per-global code model attribute (PR #72078)
via cfe-commits
cfe-commits at lists.llvm.org
Thu Jan 4 22:14:39 PST 2024
================
@@ -3369,6 +3369,36 @@ static void handleSectionAttr(Sema &S, Decl *D, const ParsedAttr &AL) {
}
}
+static void handleCodeModelAttr(Sema &S, Decl *D, const ParsedAttr &AL) {
+ StringRef CM;
+ StringRef Str;
+ SourceLocation LiteralLoc;
+ bool Ok = false;
+ // Check that it is a string.
+ if (!S.checkStringLiteralArgumentAttr(AL, 0, Str, &LiteralLoc))
+ return;
+
+ CM = Str;
+ if (S.getASTContext().getTargetInfo().getTriple().isLoongArch()) {
+ Ok = CM == "normal" || CM == "medium" || CM == "extreme";
+ CM = llvm::StringSwitch<StringRef>(CM)
----------------
heiher wrote:
Thanks. I can only keep `handleCodeModelAttr` because `handleSimpleAttribute` cannot pass a value to the constructor of `CodeModelAttr`.
https://github.com/llvm/llvm-project/pull/72078
More information about the cfe-commits
mailing list