[PATCH] D77491: [Sema] Introduce BuiltinAttr, per-declaration builtin-ness

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon May 25 10:42:56 PDT 2020


aaron.ballman added inline comments.


================
Comment at: clang/lib/AST/Decl.cpp:3169-3175
   } else {
-    if (!getIdentifier())
+    const auto *Attr = getAttr<BuiltinAttr>();
+
+    if (!Attr)
       return 0;
 
+    BuiltinID = Attr->getID();
----------------
I think this is a bit more clear:
```
} else if (const auto *A = getAttr<BuiltinAttr>()) {
  BuiltinID = A->getID();
}
```
and initialize `BuiltinID` to zero above.


================
Comment at: clang/test/Sema/implicit-builtin-decl.c:64
-struct __jmp_buf_tag {};
-void sigsetjmp(struct __jmp_buf_tag[1], int); // expected-warning{{declaration of built-in function 'sigsetjmp' requires the declaration of the 'jmp_buf' type, commonly provided in the header <setjmp.h>.}}
 
----------------
It looks like we're losing test coverage with this change?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D77491/new/

https://reviews.llvm.org/D77491





More information about the cfe-commits mailing list