From 7ef7bab7e3d06f660b059b903c231f100bb13cc5 Mon Sep 17 00:00:00 2001
From: Ed Schouten
Date: Sun, 14 Jun 2009 09:24:02 +0000
Subject: Import Clang r73340.
---
CMakeLists.txt | 2 +-
clang.xcodeproj/project.pbxproj | 32 +-
docs/LanguageExtensions.html | 87 +-
docs/PCHInternals.html | 11 +-
docs/UsersManual.html | 44 +-
include/clang/AST/ASTContext.h | 29 +-
include/clang/AST/ASTDiagnostic.h | 2 +-
include/clang/AST/Attr.h | 8 +-
include/clang/AST/Builtins.def | 407 ----
include/clang/AST/Builtins.h | 137 --
include/clang/AST/DeclBase.h | 6 +-
include/clang/AST/DeclTemplate.h | 51 +-
include/clang/AST/PPCBuiltins.def | 24 -
include/clang/AST/Stmt.h | 13 +-
include/clang/AST/TargetBuiltins.h | 38 -
include/clang/AST/X86Builtins.def | 295 ---
include/clang/Analysis/AnalysisDiagnostic.h | 2 +-
include/clang/Basic/Builtins.def | 407 ++++
include/clang/Basic/Builtins.h | 134 ++
include/clang/Basic/BuiltinsPPC.def | 24 +
include/clang/Basic/BuiltinsX86.def | 295 +++
include/clang/Basic/Diagnostic.h | 55 +-
include/clang/Basic/Diagnostic.td | 3 +
include/clang/Basic/DiagnosticLexKinds.td | 4 +
include/clang/Basic/DiagnosticParseKinds.td | 9 +
include/clang/Basic/DiagnosticSemaKinds.td | 72 +-
include/clang/Basic/SourceManager.h | 6 +
include/clang/Basic/TargetBuiltins.h | 38 +
include/clang/Driver/DriverDiagnostic.h | 2 +-
include/clang/Driver/Options.def | 2 +
include/clang/Frontend/FrontendDiagnostic.h | 2 +-
include/clang/Lex/LexDiagnostic.h | 2 +-
include/clang/Lex/Preprocessor.h | 11 +-
include/clang/Parse/Action.h | 20 +-
include/clang/Parse/ParseDiagnostic.h | 2 +-
include/clang/Parse/Parser.h | 7 +-
include/clang/Sema/SemaDiagnostic.h | 2 +-
lib/AST/ASTContext.cpp | 217 ++-
lib/AST/Builtins.cpp | 290 ---
lib/AST/CMakeLists.txt | 1 -
lib/AST/Decl.cpp | 1 +
lib/AST/DeclBase.cpp | 7 +
lib/AST/DeclCXX.cpp | 7 +-
lib/AST/DeclPrinter.cpp | 3 +
lib/AST/DeclTemplate.cpp | 27 +-
lib/AST/Expr.cpp | 1 +
lib/AST/ExprConstant.cpp | 38 +-
lib/Analysis/CFRefCount.cpp | 76 +-
lib/Analysis/GRExprEngine.cpp | 1 +
lib/Analysis/RegionStore.cpp | 9 +-
lib/Basic/Builtins.cpp | 92 +
lib/Basic/CMakeLists.txt | 1 +
lib/Basic/Diagnostic.cpp | 25 +-
lib/Basic/Targets.cpp | 16 +-
lib/CodeGen/CGBuiltin.cpp | 2 +-
lib/CodeGen/CGCall.cpp | 40 +-
lib/CodeGen/CGExpr.cpp | 3 +-
lib/CodeGen/CGExprComplex.cpp | 48 +-
lib/CodeGen/CGExprConstant.cpp | 1 +
lib/CodeGen/CGObjCMac.cpp | 2 +
lib/CodeGen/CodeGenModule.cpp | 13 +-
lib/CodeGen/Mangle.cpp | 27 +-
lib/CodeGen/TargetABIInfo.cpp | 38 +-
lib/Driver/Tools.cpp | 16 +-
lib/Frontend/Backend.cpp | 8 +-
lib/Frontend/PCHReaderStmt.cpp | 1 +
lib/Frontend/PCHWriterStmt.cpp | 2 +-
lib/Frontend/PrintParserCallbacks.cpp | 7 +-
lib/Headers/xmmintrin.h | 3 +
lib/Lex/LiteralSupport.cpp | 5 +-
lib/Lex/PPMacroExpansion.cpp | 95 +-
lib/Parse/ParseDecl.cpp | 74 +-
lib/Parse/ParseDeclCXX.cpp | 14 +-
lib/Parse/ParseExpr.cpp | 8 +-
lib/Parse/ParseStmt.cpp | 32 +-
lib/Parse/ParseTemplate.cpp | 22 +-
lib/Parse/ParseTentative.cpp | 5 +-
lib/Sema/Sema.cpp | 5 +-
lib/Sema/Sema.h | 229 ++-
lib/Sema/SemaDecl.cpp | 16 +-
lib/Sema/SemaDeclAttr.cpp | 3 +
lib/Sema/SemaDeclCXX.cpp | 15 +-
lib/Sema/SemaExpr.cpp | 19 +-
lib/Sema/SemaInherit.cpp | 6 +
lib/Sema/SemaInit.cpp | 2 +-
lib/Sema/SemaLookup.cpp | 1 +
lib/Sema/SemaStmt.cpp | 5 +-
lib/Sema/SemaTemplate.cpp | 439 ++++-
lib/Sema/SemaTemplateDeduction.cpp | 756 ++++++--
lib/Sema/SemaTemplateInstantiate.cpp | 200 +-
lib/Sema/SemaTemplateInstantiateExpr.cpp | 8 +
lib/Sema/SemaTemplateInstantiateStmt.cpp | 2 +-
lib/Sema/SemaType.cpp | 154 +-
test/Analysis/array-struct.c | 10 +
test/CXX/dcl.dcl/dcl.spec/dcl.fct.spec/p3.cpp | 11 +
test/CXX/dcl.dcl/dcl.spec/dcl.fct.spec/p4.cpp | 7 +
test/CXX/dcl.dcl/dcl.spec/dcl.fct.spec/p6.cpp | 13 +
test/CXX/dcl.dcl/dcl.spec/dcl.stc/p10.cpp | 14 +
test/CXX/dcl.dcl/dcl.spec/dcl.stc/p9.cpp | 12 +
test/CXX/dcl.dcl/dcl.spec/dcl.typedef/p3.cpp | 8 +
test/CXX/dcl.dcl/dcl.spec/dcl.typedef/p4.cpp | 9 +
test/CXX/temp/temp.param/p1.cpp | 1 +
test/CXX/temp/temp.param/p10.cpp | 12 +
test/CXX/temp/temp.param/p11.cpp | 15 +
test/CXX/temp/temp.param/p12.cpp | 37 +
test/CXX/temp/temp.param/p13.cpp | 14 +
test/CXX/temp/temp.param/p14.cpp | 5 +
test/CXX/temp/temp.param/p15-cxx0x.cpp | 22 +
test/CXX/temp/temp.param/p15.cpp | 12 +
test/CXX/temp/temp.param/p2.cpp | 16 +
test/CXX/temp/temp.param/p3.cpp | 28 +
test/CXX/temp/temp.param/p4.cpp | 20 +
test/CXX/temp/temp.param/p7.cpp | 15 +
test/CXX/temp/temp.param/p8.cpp | 6 +
test/CodeGen/always_inline.c | 9 +-
test/CodeGen/lineno-dbginfo.c | 7 +-
test/CodeGen/target-data.c | 7 +
test/CodeGen/x86_32-arguments.c | 5 +
test/CodeGenCXX/static-assert.cpp | 3 +
test/CodeGenObjC/property-complex.m | 61 +
test/Driver/clang_f_opts.c | 3 +-
test/Frontend/cpp-output.c | 15 +
test/Lexer/char-escapes.c | 21 +
test/Makefile | 33 +-
test/Parser/statements.c | 3 +
test/Preprocessor/feature_tests.c | 31 +
test/Sema/const-eval.c | 2 +
test/Sema/init-vector.c | 17 +
test/SemaCXX/default2.cpp | 10 +-
test/SemaCXX/member-pointer.cpp | 3 +-
test/SemaTemplate/default-arguments.cpp | 9 +
test/SemaTemplate/dependent-names.cpp | 16 +
test/SemaTemplate/example-typelist.cpp | 98 +
test/SemaTemplate/instantiate-declref-ice.cpp | 7 +
.../instantiate-dependent-nested-name.cpp | 7 +
test/SemaTemplate/instantiate-function-1.cpp | 8 +-
test/SemaTemplate/instantiate-member-pointers.cpp | 27 +
test/SemaTemplate/metafun-apply.cpp | 6 +-
test/SemaTemplate/right-angle-brackets-0x.cpp | 22 -
test/SemaTemplate/right-angle-brackets-98.cpp | 12 -
test/SemaTemplate/temp_class_spec.cpp | 127 ++
test/SemaTemplate/temp_class_spec_blocks.cpp | 34 +
test/SemaTemplate/temp_class_spec_neg.cpp | 45 +
test/SemaTemplate/temp_param.cpp | 90 -
test/SemaTemplate/typename-specifier-3.cpp | 19 +
test/SemaTemplate/variadic-class-template-1.cpp | 4 +
test/SemaTemplate/variadic-class-template-2.cpp | 19 +
test/SemaTemplate/variadic-parse.cpp | 6 +
test/SemaTemplate/variadic-unsupported.cpp | 5 +
test/cxx-sections.data | 1954 ++++++++++++++++++++
test/make_test_dirs.pl | 27 +
tools/clang-cc/clang-cc.cpp | 17 +-
www/OpenProjects.html | 17 +-
www/StaticAnalysis.html | 139 +-
www/StaticAnalysisUsage.html | 259 +--
www/analyzer/annotations.html | 386 ++++
www/analyzer/available_checks.html | 34 +
www/analyzer/content.css | 31 +
www/analyzer/filing_bugs.html | 62 +
www/analyzer/index.html | 186 ++
www/analyzer/installation.html | 113 ++
www/analyzer/latest_checker.html.incl | 1 +
www/analyzer/menu.css | 40 +
www/analyzer/menu.html.incl | 28 +
www/analyzer/scan-build.html | 257 +++
www/cxx_status.html | 34 +-
www/latest_checker.html.incl | 1 -
www/menu.html.incl | 2 +-
168 files changed, 7681 insertions(+), 2408 deletions(-)
delete mode 100644 include/clang/AST/Builtins.def
delete mode 100644 include/clang/AST/Builtins.h
delete mode 100644 include/clang/AST/PPCBuiltins.def
delete mode 100644 include/clang/AST/TargetBuiltins.h
delete mode 100644 include/clang/AST/X86Builtins.def
create mode 100644 include/clang/Basic/Builtins.def
create mode 100644 include/clang/Basic/Builtins.h
create mode 100644 include/clang/Basic/BuiltinsPPC.def
create mode 100644 include/clang/Basic/BuiltinsX86.def
create mode 100644 include/clang/Basic/TargetBuiltins.h
delete mode 100644 lib/AST/Builtins.cpp
create mode 100644 lib/Basic/Builtins.cpp
create mode 100644 test/CXX/dcl.dcl/dcl.spec/dcl.fct.spec/p3.cpp
create mode 100644 test/CXX/dcl.dcl/dcl.spec/dcl.fct.spec/p4.cpp
create mode 100644 test/CXX/dcl.dcl/dcl.spec/dcl.fct.spec/p6.cpp
create mode 100644 test/CXX/dcl.dcl/dcl.spec/dcl.stc/p10.cpp
create mode 100644 test/CXX/dcl.dcl/dcl.spec/dcl.stc/p9.cpp
create mode 100644 test/CXX/dcl.dcl/dcl.spec/dcl.typedef/p3.cpp
create mode 100644 test/CXX/dcl.dcl/dcl.spec/dcl.typedef/p4.cpp
create mode 100644 test/CXX/temp/temp.param/p1.cpp
create mode 100644 test/CXX/temp/temp.param/p10.cpp
create mode 100644 test/CXX/temp/temp.param/p11.cpp
create mode 100644 test/CXX/temp/temp.param/p12.cpp
create mode 100644 test/CXX/temp/temp.param/p13.cpp
create mode 100644 test/CXX/temp/temp.param/p14.cpp
create mode 100644 test/CXX/temp/temp.param/p15-cxx0x.cpp
create mode 100644 test/CXX/temp/temp.param/p15.cpp
create mode 100644 test/CXX/temp/temp.param/p2.cpp
create mode 100644 test/CXX/temp/temp.param/p3.cpp
create mode 100644 test/CXX/temp/temp.param/p4.cpp
create mode 100644 test/CXX/temp/temp.param/p7.cpp
create mode 100644 test/CXX/temp/temp.param/p8.cpp
create mode 100644 test/CodeGen/target-data.c
create mode 100644 test/CodeGenCXX/static-assert.cpp
create mode 100644 test/CodeGenObjC/property-complex.m
create mode 100644 test/Frontend/cpp-output.c
create mode 100644 test/Lexer/char-escapes.c
create mode 100644 test/Preprocessor/feature_tests.c
create mode 100644 test/Sema/init-vector.c
create mode 100644 test/SemaTemplate/dependent-names.cpp
create mode 100644 test/SemaTemplate/example-typelist.cpp
create mode 100644 test/SemaTemplate/instantiate-declref-ice.cpp
create mode 100644 test/SemaTemplate/instantiate-dependent-nested-name.cpp
create mode 100644 test/SemaTemplate/instantiate-member-pointers.cpp
delete mode 100644 test/SemaTemplate/right-angle-brackets-0x.cpp
delete mode 100644 test/SemaTemplate/right-angle-brackets-98.cpp
create mode 100644 test/SemaTemplate/temp_class_spec_blocks.cpp
create mode 100644 test/SemaTemplate/temp_class_spec_neg.cpp
delete mode 100644 test/SemaTemplate/temp_param.cpp
create mode 100644 test/SemaTemplate/typename-specifier-3.cpp
create mode 100644 test/SemaTemplate/variadic-class-template-1.cpp
create mode 100644 test/SemaTemplate/variadic-class-template-2.cpp
create mode 100644 test/SemaTemplate/variadic-parse.cpp
create mode 100644 test/SemaTemplate/variadic-unsupported.cpp
create mode 100644 test/cxx-sections.data
create mode 100755 test/make_test_dirs.pl
create mode 100644 www/analyzer/annotations.html
create mode 100644 www/analyzer/available_checks.html
create mode 100644 www/analyzer/content.css
create mode 100644 www/analyzer/filing_bugs.html
create mode 100644 www/analyzer/index.html
create mode 100644 www/analyzer/installation.html
create mode 100644 www/analyzer/latest_checker.html.incl
create mode 100644 www/analyzer/menu.css
create mode 100644 www/analyzer/menu.html.incl
create mode 100644 www/analyzer/scan-build.html
delete mode 100644 www/latest_checker.html.incl
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 45f3d0c56b91f..2f63051a0da4b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -23,7 +23,7 @@ macro(add_clang_library name)
endif(MSVC)
install(TARGETS ${name}
LIBRARY DESTINATION lib
- ARCHIVE DESTINATION lib)
+ ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX})
endmacro(add_clang_library)
macro(add_clang_executable name)
diff --git a/clang.xcodeproj/project.pbxproj b/clang.xcodeproj/project.pbxproj
index b9b966eb57cc6..73ef1beeca379 100644
--- a/clang.xcodeproj/project.pbxproj
+++ b/clang.xcodeproj/project.pbxproj
@@ -138,6 +138,7 @@
DE3461270AFE68BE00DBC861 /* MinimalAction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE3461260AFE68BE00DBC861 /* MinimalAction.cpp */; };
DE34621D0AFEB19B00DBC861 /* StmtPrinter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE34621C0AFEB19B00DBC861 /* StmtPrinter.cpp */; };
DE3464220B03040900DBC861 /* Type.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DE3464210B03040900DBC861 /* Type.h */; };
+ DE37252E0FE481AD00CF2CC2 /* Builtins.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE37252D0FE481AD00CF2CC2 /* Builtins.cpp */; };
DE38CD500D794D0100A273B6 /* CGObjCGNU.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE38CD4F0D794D0100A273B6 /* CGObjCGNU.cpp */; };
DE38CF270D8C9E6C00A273B6 /* DeclObjC.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE38CF260D8C9E6C00A273B6 /* DeclObjC.cpp */; };
DE3986F00CB8D4B300223765 /* IdentifierTable.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DE3986EF0CB8D4B300223765 /* IdentifierTable.h */; };
@@ -200,9 +201,6 @@
DECB78170FA5882F00F5FBC7 /* PCHWriterStmt.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DECB78160FA5882F00F5FBC7 /* PCHWriterStmt.cpp */; };
DED626C90AE0C065001E80A4 /* TargetInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DED626C80AE0C065001E80A4 /* TargetInfo.cpp */; };
DED62ABB0AE2EDF1001E80A4 /* Decl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DED62ABA0AE2EDF1001E80A4 /* Decl.cpp */; };
- DED676D10B6C786700AAD4A3 /* Builtins.def in CopyFiles */ = {isa = PBXBuildFile; fileRef = DED676D00B6C786700AAD4A3 /* Builtins.def */; };
- DED676FA0B6C797B00AAD4A3 /* Builtins.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DED676F90B6C797B00AAD4A3 /* Builtins.h */; };
- DED677C90B6C854100AAD4A3 /* Builtins.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DED677C80B6C854100AAD4A3 /* Builtins.cpp */; };
DED7D7410A524295003AD0FB /* Diagnostic.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DED7D7310A524295003AD0FB /* Diagnostic.h */; };
DED7D7430A524295003AD0FB /* FileManager.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DED7D7330A524295003AD0FB /* FileManager.h */; };
DED7D7450A524295003AD0FB /* SourceLocation.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DED7D7350A524295003AD0FB /* SourceLocation.h */; };
@@ -296,8 +294,6 @@
DE75ED290B044DC90020CF81 /* ASTContext.h in CopyFiles */,
DE1733700B068DC60080B521 /* DeclSpec.h in CopyFiles */,
DE01DA490B12ADA300AC22CE /* PPCallbacks.h in CopyFiles */,
- DED676D10B6C786700AAD4A3 /* Builtins.def in CopyFiles */,
- DED676FA0B6C797B00AAD4A3 /* Builtins.h in CopyFiles */,
1A30A9E90B93A4C800201A91 /* ExprCXX.h in CopyFiles */,
1A869A700BA2164C008DA07A /* LiteralSupport.h in CopyFiles */,
DE67E7150C020EDF00F66BC5 /* Sema.h in CopyFiles */,
@@ -353,9 +349,6 @@
1A5D5E570E5E81010023C059 /* CGCXX.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = CGCXX.cpp; path = lib/CodeGen/CGCXX.cpp; sourceTree = ""; tabWidth = 2; };
1A649E1D0F9599D9005B965E /* CGBlocks.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CGBlocks.h; path = lib/CodeGen/CGBlocks.h; sourceTree = ""; };
1A649E1E0F9599DA005B965E /* CGCXX.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CGCXX.h; path = lib/CodeGen/CGCXX.h; sourceTree = ""; };
- 1A68BC110D0CADDD001A28C8 /* PPCBuiltins.def */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = text; name = PPCBuiltins.def; path = clang/AST/PPCBuiltins.def; sourceTree = ""; tabWidth = 2; };
- 1A68BC120D0CADDD001A28C8 /* TargetBuiltins.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = TargetBuiltins.h; path = clang/AST/TargetBuiltins.h; sourceTree = ""; tabWidth = 2; };
- 1A68BC130D0CADDD001A28C8 /* X86Builtins.def */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = text; name = X86Builtins.def; path = clang/AST/X86Builtins.def; sourceTree = ""; tabWidth = 2; };
1A6FE7080FD6F85800E00CA9 /* CGCXXTemp.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = CGCXXTemp.cpp; path = lib/CodeGen/CGCXXTemp.cpp; sourceTree = ""; tabWidth = 2; };
1A7019E90F79BC1100FEC4D1 /* DiagnosticAnalysisKinds.td */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DiagnosticAnalysisKinds.td; sourceTree = ""; };
1A7019EA0F79BC1100FEC4D1 /* DiagnosticASTKinds.td */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DiagnosticASTKinds.td; sourceTree = ""; };
@@ -525,6 +518,12 @@
DE3461260AFE68BE00DBC861 /* MinimalAction.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = MinimalAction.cpp; path = lib/Parse/MinimalAction.cpp; sourceTree = ""; tabWidth = 2; };
DE34621C0AFEB19B00DBC861 /* StmtPrinter.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = StmtPrinter.cpp; path = lib/AST/StmtPrinter.cpp; sourceTree = ""; tabWidth = 2; };
DE3464210B03040900DBC861 /* Type.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = Type.h; path = clang/AST/Type.h; sourceTree = ""; tabWidth = 2; };
+ DE37251C0FE4818000CF2CC2 /* Builtins.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Builtins.h; sourceTree = ""; };
+ DE37252A0FE4818F00CF2CC2 /* Builtins.def */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Builtins.def; sourceTree = ""; };
+ DE37252D0FE481AD00CF2CC2 /* Builtins.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Builtins.cpp; sourceTree = ""; };
+ DE3725310FE4822800CF2CC2 /* TargetBuiltins.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TargetBuiltins.h; sourceTree = ""; };
+ DE3725320FE4826C00CF2CC2 /* BuiltinsX86.def */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = BuiltinsX86.def; sourceTree = ""; };
+ DE3725330FE4827200CF2CC2 /* BuiltinsPPC.def */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = BuiltinsPPC.def; sourceTree = ""; };
DE38CD4E0D794CF900A273B6 /* CGObjCRuntime.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = CGObjCRuntime.h; path = lib/CodeGen/CGObjCRuntime.h; sourceTree = ""; tabWidth = 2; };
DE38CD4F0D794D0100A273B6 /* CGObjCGNU.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = CGObjCGNU.cpp; path = lib/CodeGen/CGObjCGNU.cpp; sourceTree = ""; tabWidth = 2; };
DE38CF260D8C9E6C00A273B6 /* DeclObjC.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = DeclObjC.cpp; path = lib/AST/DeclObjC.cpp; sourceTree = ""; tabWidth = 2; };
@@ -621,9 +620,6 @@
DECB78540FA58F5500F5FBC7 /* AccessSpecifier.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AccessSpecifier.h; path = clang/Parse/AccessSpecifier.h; sourceTree = ""; };
DED626C80AE0C065001E80A4 /* TargetInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; path = TargetInfo.cpp; sourceTree = ""; tabWidth = 2; };
DED62ABA0AE2EDF1001E80A4 /* Decl.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = Decl.cpp; path = lib/AST/Decl.cpp; sourceTree = ""; tabWidth = 2; usesTabs = 0; };
- DED676D00B6C786700AAD4A3 /* Builtins.def */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = text; name = Builtins.def; path = clang/AST/Builtins.def; sourceTree = ""; tabWidth = 2; };
- DED676F90B6C797B00AAD4A3 /* Builtins.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = Builtins.h; path = clang/AST/Builtins.h; sourceTree = ""; tabWidth = 2; };
- DED677C80B6C854100AAD4A3 /* Builtins.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = Builtins.cpp; path = lib/AST/Builtins.cpp; sourceTree = ""; tabWidth = 2; };
DED7D7310A524295003AD0FB /* Diagnostic.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.c.h; path = Diagnostic.h; sourceTree = ""; tabWidth = 2; };
DED7D7330A524295003AD0FB /* FileManager.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.c.h; path = FileManager.h; sourceTree = ""; tabWidth = 2; };
DED7D7350A524295003AD0FB /* SourceLocation.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.c.h; path = SourceLocation.h; sourceTree = ""; tabWidth = 2; };
@@ -1146,13 +1142,9 @@
DE75ED280B044DC90020CF81 /* ASTContext.h */,
DEA09A6E0F31756F000C2258 /* ASTDiagnostic.h */,
1A72BEAC0D641E9400B085E9 /* Attr.h */,
- DED676D00B6C786700AAD4A3 /* Builtins.def */,
- DED676F90B6C797B00AAD4A3 /* Builtins.h */,
90FB99DE0F98FB1D008F9415 /* DeclContextInternals.h */,
90FB99DF0F98FB1D008F9415 /* DeclVisitor.h */,
90FB99E00F98FB1D008F9415 /* ExternalASTSource.h */,
- 1A68BC110D0CADDD001A28C8 /* PPCBuiltins.def */,
- 1A68BC130D0CADDD001A28C8 /* X86Builtins.def */,
DEC63B1B0C7B940600DBF169 /* CFG.h */,
DEC8D9900A9433CD00353FCA /* Decl.h */,
3538FDB60ED24A2C005EC283 /* DeclarationName.h */,
@@ -1176,7 +1168,6 @@
DE345C190AFC658B00DBC861 /* StmtVisitor.h */,
35847BE30CC7DB9000C40FFF /* StmtIterator.h */,
35CFFE010CA1CBDD00E6F2BE /* StmtGraphTraits.h */,
- 1A68BC120D0CADDD001A28C8 /* TargetBuiltins.h */,
DEDFF87F0F848CE30035BD10 /* TemplateName.h */,
DEF16BE40FA13A5B0098507F /* TypeNodes.def */,
DEF16BE50FA13A650098507F /* TypeOrdering.h */,
@@ -1191,7 +1182,6 @@
DE8823CA0ED0046600CBC30A /* APValue.cpp */,
35BB2D7E0D19954000944DB5 /* ASTConsumer.cpp */,
DE1732FF0B068B700080B521 /* ASTContext.cpp */,
- DED677C80B6C854100AAD4A3 /* Builtins.cpp */,
DEC63B190C7B940200DBF169 /* CFG.cpp */,
35FE6BCE0DF6EE1F00739712 /* DeclBase.cpp */,
DED62ABA0AE2EDF1001E80A4 /* Decl.cpp */,
@@ -1238,6 +1228,10 @@
DED7D7300A524295003AD0FB /* Basic */ = {
isa = PBXGroup;
children = (
+ DE37251C0FE4818000CF2CC2 /* Builtins.h */,
+ DE37252A0FE4818F00CF2CC2 /* Builtins.def */,
+ DE3725330FE4827200CF2CC2 /* BuiltinsPPC.def */,
+ DE3725320FE4826C00CF2CC2 /* BuiltinsX86.def */,
906BF4AE0F83BA16001071FA /* ConvertUTF.h */,
DED7D7310A524295003AD0FB /* Diagnostic.h */,
DEDFFF070F959EE60035BD10 /* Diagnostic.td */,
@@ -1260,6 +1254,7 @@
DED7D7350A524295003AD0FB /* SourceLocation.h */,
DED7D7360A524295003AD0FB /* SourceManager.h */,
9063F2290F9E911F002F7251 /* SourceManagerInternals.h */,
+ DE3725310FE4822800CF2CC2 /* TargetBuiltins.h */,
DE46BF270AE0A82D00CC047C /* TargetInfo.h */,
9063F22A0F9E911F002F7251 /* TemplateKinds.h */,
DED7D7380A524295003AD0FB /* TokenKinds.h */,
@@ -1299,6 +1294,7 @@
DED7D7500A5242C7003AD0FB /* Basic */ = {
isa = PBXGroup;
children = (
+ DE37252D0FE481AD00CF2CC2 /* Builtins.cpp */,
906BF4AF0F83BA2E001071FA /* ConvertUTF.c */,
DED7D75D0A5242C7003AD0FB /* Diagnostic.cpp */,
DED7D75E0A5242C7003AD0FB /* FileManager.cpp */,
@@ -1526,7 +1522,6 @@
DE75EDF10B06880E0020CF81 /* Type.cpp in Sources */,
DE1733000B068B700080B521 /* ASTContext.cpp in Sources */,
DE17336E0B068DC20080B521 /* DeclSpec.cpp in Sources */,
- DED677C90B6C854100AAD4A3 /* Builtins.cpp in Sources */,
1A869AA80BA21ABA008DA07A /* LiteralSupport.cpp in Sources */,
DE67E70B0C020EC500F66BC5 /* SemaType.cpp in Sources */,
DE67E70D0C020ECA00F66BC5 /* SemaStmt.cpp in Sources */,
@@ -1699,6 +1694,7 @@
1A6FE7090FD6F85800E00CA9 /* CGCXXTemp.cpp in Sources */,
BDF87CF70FD746F300BBF872 /* SemaTemplateDeduction.cpp in Sources */,
1A14D3A70FD78A3F00DA2835 /* DeclPrinter.cpp in Sources */,
+ DE37252E0FE481AD00CF2CC2 /* Builtins.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
diff --git a/docs/LanguageExtensions.html b/docs/LanguageExtensions.html
index c486562b1009c..c855a5057a62d 100644
--- a/docs/LanguageExtensions.html
+++ b/docs/LanguageExtensions.html
@@ -19,6 +19,7 @@ td {
- Introduction
+- Feature Checking Macros
- Builtin Macros
- Vectors and Extended Vectors
- Blocks
@@ -45,11 +46,72 @@ td {
This document describes the language extensions provided by Clang. In
-addition to the langauge extensions listed here, Clang aims to support a broad
+addition to the language extensions listed here, Clang aims to support a broad
range of GCC extensions. Please see the GCC manual for
more information on these extensions.
+
+Feature Checking Macros
+
+
+Language extensions can be very useful, but only if you know you can depend
+on them. In order to allow fine-grain features checks, we support two builtin
+function-like macros. This allows you to directly test for a feature in your
+code without having to resort to something like autoconf or fragile "compiler
+version checks".
+
+
+__has_builtin
+
+
+This function-like macro takes a single identifier argument that is the name
+of a builtin function. It evaluates to 1 if the builtin is supported or 0 if
+not. It can be used like this:
+
+
+
+#ifndef __has_builtin // Optional of course.
+ #define __has_builtin(x) 0 // Compatibility with non-clang compilers.
+#endif
+
+...
+#if __has_builtin(__builtin_trap)
+ __builtin_trap();
+#else
+ abort();
+#endif
+...
+
+
+
+
+
+__has_feature
+
+
+This function-like macro takes a single identifier argument that is the name
+of a feature. It evaluates to 1 if the feature is supported or 0 if not. It
+can be used like this:
+
+
+
+#ifndef __has_feature // Optional of course.
+ #define __has_feature(x) 0 // Compatibility with non-clang compilers.
+#endif
+
+...
+#if __has_feature(attribute_overloadable) || \
+ __has_feature(blocks)
+...
+#endif
+...
+
+
+
+The feature tag is described along with the language feature below.
+
+
Builtin Macros
@@ -64,6 +126,8 @@ more information on these extensions.
with V.xyzw syntax and other tidbits. See also __builtin_shufflevector.
+Query for this feature with __has_feature(attribute_ext_vector_type).
+
Blocks
@@ -73,6 +137,9 @@ href="BlockLanguageSpec.txt">BlockLanguageSpec.txt. Implementation and ABI
details for the clang implementation are in BlockImplementation.txt.
+
+Query for this feature with __has_feature(blocks).
+
Function Overloading in C
@@ -171,6 +238,9 @@ caveats to this use of name mangling:
C.
+Query for this feature with __has_feature(attribute_overloadable).
+
+
Builtin Functions
@@ -306,11 +376,11 @@ positives due to false paths) by marking their own "panic" functions
with this attribute.
While useful, noreturn is not applicable in all cases. Sometimes
-there are special functions that for all intensive purposes should be considered
-panic functions (i.e., they are only called when an internal program error
-occurs) but may actually return so that the program can fail gracefully. The
-analyzer_noreturn attribute allows one to annotate such functions as
-being interpreted as "no return" functions by the analyzer (thus
+there are special functions that for all intents and purposes should be
+considered panic functions (i.e., they are only called when an internal program
+error occurs) but may actually return so that the program can fail gracefully.
+The analyzer_noreturn attribute allows one to annotate such functions
+as being interpreted as "no return" functions by the analyzer (thus
pruning bogus paths) but will not affect compilation (as in the case of
noreturn).
@@ -320,7 +390,10 @@ placed at the end of function prototypes:
void foo() __attribute__((analyzer_noreturn));
-
+
+
+Query for this feature with __has_feature(attribute_analyzer_noreturn).
+