]> granicus.if.org Git - clang/commit
Wraps lazily generated builtins in an extern "C" context
authorWarren Hunt <whunt@google.com>
Fri, 1 Nov 2013 23:46:51 +0000 (23:46 +0000)
committerWarren Hunt <whunt@google.com>
Fri, 1 Nov 2013 23:46:51 +0000 (23:46 +0000)
commit2d023ecb2b9204a3dbc3b88ad9564b0a5bc211f6
tree67d024bc285c5f5862bc447030534b67795112c1
parent701bc8ceb11c0090f61c1caa9d2efa9523006cc6
Wraps lazily generated builtins in an extern "C" context

Differential Revision: http://llvm-reviews.chandlerc.com/D2082

Adds a lang_c LinkageSpecDecl to lazily generated builtins. This enforces correct
behavior for builtins in a variety of cases without special treatment elsewhere within
the compiler (special treatment is removed by the patch). It also allows for C++
overloads of builtin functions, which Microsoft uses in their headers e.g.
_InterlockedExchangeAdd is an extern C builtin for the long type but an inline wrapper
for int type.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193896 91177308-0d34-0410-b5e6-96231b3b80d8
lib/AST/Decl.cpp
lib/Sema/SemaDecl.cpp
test/CodeGenCXX/builtins.cpp