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

via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 13 05:42:02 PST 2023


================
@@ -3369,6 +3369,23 @@ static void handleSectionAttr(Sema &S, Decl *D, const ParsedAttr &AL) {
   }
 }
 
+static void handleCodeModelAttr(Sema &S, Decl *D, const ParsedAttr &AL) {
+  StringRef Model;
+  SourceLocation LiteralLoc;
+  // Check that it is a string.
+  if (!S.checkStringLiteralArgumentAttr(AL, 0, Model, &LiteralLoc))
----------------
tschuett wrote:

You should report an error. If I set the code model to 5, there will be no errors and it will be silently set to Small.

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


More information about the cfe-commits mailing list