aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--clang.xcodeproj/project.pbxproj1844
-rw-r--r--include/clang/AST/ASTContext.h4
-rw-r--r--include/clang/AST/Attr.h22
-rw-r--r--include/clang/AST/Decl.h80
-rw-r--r--include/clang/AST/DeclBase.h3
-rw-r--r--include/clang/AST/DeclCXX.h93
-rw-r--r--include/clang/AST/DeclTemplate.h30
-rw-r--r--include/clang/AST/Type.h26
-rw-r--r--include/clang/AST/TypeNodes.def1
-rw-r--r--include/clang/Analysis/LocalCheckers.h1
-rw-r--r--include/clang/Analysis/PathSensitive/ConstraintManager.h2
-rw-r--r--include/clang/Analysis/PathSensitive/GRExprEngine.h37
-rw-r--r--include/clang/Analysis/PathSensitive/GRState.h155
-rw-r--r--include/clang/Analysis/PathSensitive/GRTransferFuncs.h45
-rw-r--r--include/clang/Analysis/PathSensitive/SVals.h7
-rw-r--r--include/clang/Analysis/PathSensitive/SValuator.h55
-rw-r--r--include/clang/Analysis/PathSensitive/Store.h5
-rw-r--r--include/clang/Analysis/PathSensitive/SymbolManager.h5
-rw-r--r--include/clang/Analysis/PathSensitive/ValueManager.h8
-rw-r--r--include/clang/Basic/DiagnosticFrontendKinds.td6
-rw-r--r--include/clang/Basic/DiagnosticSemaKinds.td35
-rw-r--r--include/clang/Basic/LangOptions.h6
-rw-r--r--include/clang/Basic/SourceManager.h10
-rw-r--r--include/clang/Basic/TokenKinds.def6
-rw-r--r--include/clang/Frontend/Analyses.def4
-rw-r--r--include/clang/Frontend/CommandLineSourceLoc.h85
-rw-r--r--include/clang/Frontend/PCHBitCodes.h4
-rw-r--r--include/clang/Frontend/Utils.h31
-rw-r--r--include/clang/Parse/Action.h33
-rw-r--r--include/clang/Parse/AttributeList.h1
-rw-r--r--include/clang/Parse/DeclSpec.h2
-rw-r--r--include/clang/Parse/Parser.h9
-rw-r--r--lib/AST/ASTContext.cpp52
-rw-r--r--lib/AST/CFG.cpp6
-rw-r--r--lib/AST/Decl.cpp39
-rw-r--r--lib/AST/DeclBase.cpp7
-rw-r--r--lib/AST/DeclCXX.cpp9
-rw-r--r--lib/AST/Expr.cpp4
-rw-r--r--lib/AST/ExprConstant.cpp22
-rw-r--r--lib/AST/StmtViz.cpp3
-rw-r--r--lib/AST/Type.cpp20
-rw-r--r--lib/Analysis/BasicConstraintManager.cpp12
-rw-r--r--lib/Analysis/BasicStore.cpp14
-rw-r--r--lib/Analysis/BugReporter.cpp2
-rw-r--r--lib/Analysis/CFRefCount.cpp33
-rw-r--r--lib/Analysis/CMakeLists.txt3
-rw-r--r--lib/Analysis/CheckObjCUnusedIVars.cpp5
-rw-r--r--lib/Analysis/GRExprEngine.cpp101
-rw-r--r--lib/Analysis/GRExprEngineInternalChecks.cpp3
-rw-r--r--lib/Analysis/GRSimpleVals.cpp415
-rw-r--r--lib/Analysis/GRSimpleVals.h86
-rw-r--r--lib/Analysis/GRState.cpp79
-rw-r--r--lib/Analysis/GRTransferFuncs.cpp27
-rw-r--r--lib/Analysis/PathDiagnostic.cpp2
-rw-r--r--lib/Analysis/RangeConstraintManager.cpp8
-rw-r--r--lib/Analysis/RegionStore.cpp219
-rw-r--r--lib/Analysis/SVals.cpp29
-rw-r--r--lib/Analysis/SimpleSValuator.cpp346
-rw-r--r--lib/Analysis/SymbolManager.cpp6
-rw-r--r--lib/Basic/IdentifierTable.cpp4
-rw-r--r--lib/Basic/SourceManager.cpp103
-rw-r--r--lib/Basic/Targets.cpp2
-rw-r--r--lib/CodeGen/CGDebugInfo.cpp63
-rw-r--r--lib/CodeGen/CGDebugInfo.h4
-rw-r--r--lib/CodeGen/CGDecl.cpp2
-rw-r--r--lib/CodeGen/CGExpr.cpp7
-rw-r--r--lib/CodeGen/CGObjCGNU.cpp5
-rw-r--r--lib/CodeGen/CGObjCMac.cpp63
-rw-r--r--lib/CodeGen/CGObjCRuntime.h3
-rw-r--r--lib/CodeGen/CodeGenModule.cpp11
-rw-r--r--lib/CodeGen/Mangle.cpp3
-rw-r--r--lib/Frontend/ASTUnit.cpp6
-rw-r--r--lib/Frontend/AnalysisConsumer.cpp4
-rw-r--r--lib/Frontend/CMakeLists.txt7
-rw-r--r--lib/Frontend/PCHReader.cpp9
-rw-r--r--lib/Frontend/PCHReaderDecl.cpp8
-rw-r--r--lib/Frontend/PCHWriter.cpp16
-rw-r--r--lib/Frontend/ResolveLocation.cpp322
-rw-r--r--lib/Headers/CMakeLists.txt2
-rw-r--r--lib/Parse/AttributeList.cpp3
-rw-r--r--lib/Parse/DeclSpec.cpp1
-rw-r--r--lib/Parse/MinimalAction.cpp1
-rw-r--r--lib/Parse/ParseDecl.cpp60
-rw-r--r--lib/Parse/ParseDeclCXX.cpp77
-rw-r--r--lib/Parse/ParseExprCXX.cpp154
-rw-r--r--lib/Parse/ParseObjc.cpp4
-rw-r--r--lib/Parse/ParseTemplate.cpp32
-rw-r--r--lib/Parse/ParseTentative.cpp7
-rw-r--r--lib/Parse/Parser.cpp26
-rw-r--r--lib/Sema/Sema.h72
-rw-r--r--lib/Sema/SemaChecking.cpp21
-rw-r--r--lib/Sema/SemaDecl.cpp97
-rw-r--r--lib/Sema/SemaDeclAttr.cpp27
-rw-r--r--lib/Sema/SemaDeclCXX.cpp195
-rw-r--r--lib/Sema/SemaExpr.cpp135
-rw-r--r--lib/Sema/SemaExprCXX.cpp4
-rw-r--r--lib/Sema/SemaInit.cpp9
-rw-r--r--lib/Sema/SemaLookup.cpp119
-rw-r--r--lib/Sema/SemaOverload.cpp106
-rw-r--r--lib/Sema/SemaTemplate.cpp61
-rw-r--r--lib/Sema/SemaTemplateDeduction.cpp424
-rw-r--r--lib/Sema/SemaTemplateInstantiate.cpp176
-rw-r--r--lib/Sema/SemaTemplateInstantiateDecl.cpp74
-rw-r--r--lib/Sema/SemaTemplateInstantiateExpr.cpp10
-rw-r--r--lib/Sema/SemaType.cpp79
-rw-r--r--test/Analysis/NoReturn.m2
-rw-r--r--test/Analysis/ObjCProperties.m2
-rw-r--r--test/Analysis/array-struct.c1
-rw-r--r--test/Analysis/complex.c1
-rw-r--r--test/Analysis/dead-stores.c2
-rw-r--r--test/Analysis/elementtype.c2
-rw-r--r--test/Analysis/exercise-ps.c1
-rw-r--r--test/Analysis/func.c2
-rw-r--r--test/Analysis/null-deref-ps.c8
-rw-r--r--test/Analysis/outofbound.c2
-rw-r--r--test/Analysis/ptr-arith.c1
-rw-r--r--test/Analysis/region-only-test.c2
-rw-r--r--test/Analysis/stack-addr-ps.c1
-rw-r--r--test/Analysis/uninit-msg-expr.m1
-rw-r--r--test/Analysis/uninit-vals-ps-region.c2
-rw-r--r--test/CXX/class/class.local/p1.cpp18
-rw-r--r--test/CXX/class/class.local/p2.cpp12
-rw-r--r--test/CXX/class/class.local/p3.cpp30
-rw-r--r--test/CXX/class/class.local/p4.cpp10
-rw-r--r--test/CXX/class/class.nested.type/p1.cpp11
-rw-r--r--test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.spec.auto/p2.cpp13
-rw-r--r--test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.type.simple/p4-cxx0x.cpp21
-rw-r--r--test/CXX/dcl.decl/dcl.meaning/dcl.array/p1-cxx0x.cpp6
-rw-r--r--test/CXX/temp/temp.decls/temp.fct/temp.over.link/p4-neg.cpp27
-rw-r--r--test/CXX/temp/temp.decls/temp.fct/temp.over.link/p4.cpp13
-rw-r--r--test/CXX/temp/temp.fct.spec/temp.deduct/temp.deduct.call/basic.cpp28
-rw-r--r--test/CXX/temp/temp.fct.spec/temp.deduct/temp.deduct.call/p2.cpp31
-rw-r--r--test/CXX/temp/temp.fct.spec/temp.deduct/temp.deduct.call/p3.cpp60
-rw-r--r--test/CodeGen/2009-06-16-inc_test.c3
-rw-r--r--test/CodeGen/2009-06-16-test.c15
-rw-r--r--test/CodeGenObjC/deadcode_strip_used_var.m9
-rw-r--r--test/Coverage/html-diagnostics.c2
-rw-r--r--test/Index/resolve-loc.c24
-rw-r--r--test/Parser/check-syntax-1.m7
-rw-r--r--test/Parser/cxx-template-decl.cpp6
-rw-r--r--test/Sema/attr-format_arg.c11
-rw-r--r--test/Sema/ext_vector_casts.c23
-rw-r--r--test/Sema/ext_vector_components.c7
-rw-r--r--test/Sema/vector-cast.c4
-rw-r--r--test/SemaCXX/auto-cxx0x.cpp5
-rw-r--r--test/SemaCXX/auto-cxx98.cpp5
-rw-r--r--test/SemaCXX/basic_lookup_argdep.cpp13
-rw-r--r--test/SemaCXX/decltype-pr4444.cpp6
-rw-r--r--test/SemaCXX/decltype-pr4448.cpp8
-rw-r--r--test/SemaCXX/default-assignment-operator.cpp74
-rw-r--r--test/SemaCXX/nested-name-spec.cpp23
-rw-r--r--test/SemaCXX/template-specialization.cpp1
-rw-r--r--test/SemaCXX/using-decl-1.cpp8
-rw-r--r--test/SemaCXX/using-decl-pr4441.cpp8
-rw-r--r--test/SemaCXX/using-decl-pr4450.cpp15
-rw-r--r--test/SemaTemplate/implicit-instantiation-1.cpp11
-rw-r--r--test/SemaTemplate/operator-template.cpp14
-rw-r--r--test/SemaTemplate/temp_arg_template.cpp4
-rw-r--r--test/SemaTemplate/template-decl-fail.cpp3
-rw-r--r--tools/CMakeLists.txt1
-rw-r--r--tools/Makefile2
-rw-r--r--tools/clang-cc/CMakeLists.txt1
-rw-r--r--tools/clang-cc/clang-cc.cpp100
-rw-r--r--tools/index-test/CMakeLists.txt17
-rw-r--r--tools/index-test/Makefile23
-rw-r--r--tools/index-test/index-test.cpp150
-rw-r--r--www/analyzer/annotations.html48
-rw-r--r--www/analyzer/images/example_attribute_nonnull.pngbin0 -> 25028 bytes
-rw-r--r--www/analyzer/images/example_cf_returns_retained.pngbin0 -> 43528 bytes
-rw-r--r--www/analyzer/images/example_cf_returns_retained_gc.pngbin0 -> 46925 bytes
-rw-r--r--www/analyzer/images/example_ns_returns_retained.pngbin0 -> 40406 bytes
-rw-r--r--www/analyzer/scan-build.html13
-rw-r--r--www/comparison.html6
-rw-r--r--www/cxx_status.html54
-rw-r--r--www/performance-2009-03-02.html112
-rw-r--r--www/performance.html40
-rw-r--r--www/timing-data/2009-06-26/176.gcc.pdfbin0 -> 33680 bytes
-rw-r--r--www/timing-data/2009-06-26/176.gcc.pngbin0 -> 61190 bytes
-rw-r--r--www/timing-data/2009-06-26/176.gcc.txt699
-rw-r--r--www/timing-data/2009-06-26/sketch.pdfbin0 -> 34528 bytes
-rw-r--r--www/timing-data/2009-06-26/sketch.pngbin0 -> 62222 bytes
-rw-r--r--www/timing-data/2009-06-26/sketch.txt803
182 files changed, 7756 insertions, 1757 deletions
diff --git a/clang.xcodeproj/project.pbxproj b/clang.xcodeproj/project.pbxproj
new file mode 100644
index 000000000000..26be7bb0b719
--- /dev/null
+++ b/clang.xcodeproj/project.pbxproj
@@ -0,0 +1,1844 @@
+// !$*UTF8*$!
+{
+ archiveVersion = 1;
+ classes = {
+ };
+ objectVersion = 42;
+ objects = {
+
+/* Begin PBXBuildFile section */
+ 03F50AC60D416EAA00B9CF60 /* Targets.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 03F50AC50D416EAA00B9CF60 /* Targets.cpp */; };
+ 1A14D3A70FD78A3F00DA2835 /* DeclPrinter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A14D3A60FD78A3F00DA2835 /* DeclPrinter.cpp */; };
+ 1A2193CE0F45EEB700C0713D /* Mangle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A2193CC0F45EEB700C0713D /* Mangle.cpp */; };
+ 1A2A54B50FD1DD1C00F4CE45 /* AnalysisConsumer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A2A54A40FD1DD1C00F4CE45 /* AnalysisConsumer.cpp */; };
+ 1A2A54B60FD1DD1C00F4CE45 /* ASTConsumers.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A2A54A50FD1DD1C00F4CE45 /* ASTConsumers.cpp */; };
+ 1A2A54B70FD1DD1C00F4CE45 /* Backend.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A2A54A60FD1DD1C00F4CE45 /* Backend.cpp */; };
+ 1A2A54B80FD1DD1C00F4CE45 /* CacheTokens.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A2A54A70FD1DD1C00F4CE45 /* CacheTokens.cpp */; };
+ 1A2A54B90FD1DD1C00F4CE45 /* DependencyFile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A2A54A80FD1DD1C00F4CE45 /* DependencyFile.cpp */; };
+ 1A2A54BA0FD1DD1C00F4CE45 /* DiagChecker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A2A54A90FD1DD1C00F4CE45 /* DiagChecker.cpp */; };
+ 1A2A54BB0FD1DD1C00F4CE45 /* DocumentXML.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A2A54AA0FD1DD1C00F4CE45 /* DocumentXML.cpp */; };
+ 1A2A54BC0FD1DD1C00F4CE45 /* GeneratePCH.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A2A54AB0FD1DD1C00F4CE45 /* GeneratePCH.cpp */; };
+ 1A2A54BD0FD1DD1C00F4CE45 /* HTMLPrint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A2A54AC0FD1DD1C00F4CE45 /* HTMLPrint.cpp */; };
+ 1A2A54BE0FD1DD1C00F4CE45 /* PrintParserCallbacks.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A2A54AD0FD1DD1C00F4CE45 /* PrintParserCallbacks.cpp */; };
+ 1A2A54BF0FD1DD1C00F4CE45 /* PrintPreprocessedOutput.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A2A54AE0FD1DD1C00F4CE45 /* PrintPreprocessedOutput.cpp */; };
+ 1A2A54C00FD1DD1C00F4CE45 /* RewriteBlocks.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A2A54AF0FD1DD1C00F4CE45 /* RewriteBlocks.cpp */; };
+ 1A2A54C10FD1DD1C00F4CE45 /* RewriteMacros.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A2A54B00FD1DD1C00F4CE45 /* RewriteMacros.cpp */; };
+ 1A2A54C20FD1DD1C00F4CE45 /* RewriteObjC.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A2A54B10FD1DD1C00F4CE45 /* RewriteObjC.cpp */; };
+ 1A2A54C30FD1DD1C00F4CE45 /* RewriteTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A2A54B20FD1DD1C00F4CE45 /* RewriteTest.cpp */; };
+ 1A2A54C40FD1DD1C00F4CE45 /* StmtXML.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A2A54B30FD1DD1C00F4CE45 /* StmtXML.cpp */; };
+ 1A2A54C50FD1DD1C00F4CE45 /* Warnings.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A2A54B40FD1DD1C00F4CE45 /* Warnings.cpp */; };
+ 1A30A9E90B93A4C800201A91 /* ExprCXX.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 1A30A9E80B93A4C800201A91 /* ExprCXX.h */; };
+ 1A32C17F0E1C87AD00A6B483 /* ExprConstant.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A32C17E0E1C87AD00A6B483 /* ExprConstant.cpp */; };
+ 1A376A2D0D4AED9B002A1C52 /* CGExprConstant.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A376A2C0D4AED9B002A1C52 /* CGExprConstant.cpp */; };
+ 1A410F850FBCE51100351440 /* SemaTemplateInstantiateExpr.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A410F840FBCE51100351440 /* SemaTemplateInstantiateExpr.cpp */; };
+ 1A471AB50F437BC500753CE8 /* CGBlocks.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A471AB40F437BC500753CE8 /* CGBlocks.cpp */; };
+ 1A5119C40FBDF71000A1FF22 /* SemaTemplateInstantiateStmt.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A5119C30FBDF71000A1FF22 /* SemaTemplateInstantiateStmt.cpp */; };
+ 1A5D5E580E5E81010023C059 /* CGCXX.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A5D5E570E5E81010023C059 /* CGCXX.cpp */; };
+ 1A6FE7090FD6F85800E00CA9 /* CGCXXTemp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A6FE7080FD6F85800E00CA9 /* CGCXXTemp.cpp */; };
+ 1A701B640F7C8FE400FEC4D1 /* SemaAccess.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A701B630F7C8FE400FEC4D1 /* SemaAccess.cpp */; };
+ 1A7342480C7B57D500122F56 /* CGObjC.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A7342470C7B57D500122F56 /* CGObjC.cpp */; };
+ 1A869A700BA2164C008DA07A /* LiteralSupport.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 1A869A6E0BA2164C008DA07A /* LiteralSupport.h */; };
+ 1A869AA80BA21ABA008DA07A /* LiteralSupport.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A869AA70BA21ABA008DA07A /* LiteralSupport.cpp */; };
+ 1ABC36940C7A4BDC006DB0AB /* CGBuiltin.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1ABC36930C7A4BDC006DB0AB /* CGBuiltin.cpp */; };
+ 1ADF47AF0F782C3200E48A8A /* SemaTemplateInstantiateDecl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1ADF47AE0F782C3200E48A8A /* SemaTemplateInstantiateDecl.cpp */; };
+ 1AFEF4070F8A6B2300476F2B /* clang-cc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AFEF4050F8A6B2300476F2B /* clang-cc.cpp */; };
+ 3507E4C20E27FE2D00FB7B57 /* CheckObjCInstMethSignature.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3507E4C10E27FE2D00FB7B57 /* CheckObjCInstMethSignature.cpp */; };
+ 352246E70F5C6BE000D0D279 /* HTMLDiagnostics.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 352246E10F5C6BE000D0D279 /* HTMLDiagnostics.cpp */; };
+ 352246E80F5C6BE000D0D279 /* InitHeaderSearch.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 352246E20F5C6BE000D0D279 /* InitHeaderSearch.cpp */; };
+ 352246E90F5C6BE000D0D279 /* ManagerRegistry.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 352246E30F5C6BE000D0D279 /* ManagerRegistry.cpp */; };
+ 352246EA0F5C6BE000D0D279 /* PlistDiagnostics.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 352246E40F5C6BE000D0D279 /* PlistDiagnostics.cpp */; };
+ 352246EB0F5C6BE000D0D279 /* TextDiagnosticBuffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 352246E50F5C6BE000D0D279 /* TextDiagnosticBuffer.cpp */; };
+ 352246EC0F5C6BE000D0D279 /* TextDiagnosticPrinter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 352246E60F5C6BE000D0D279 /* TextDiagnosticPrinter.cpp */; };
+ 35260CA50C7F75C000D66CE9 /* ExprCXX.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 35260CA40C7F75C000D66CE9 /* ExprCXX.cpp */; };
+ 352712510DAFE54700C76352 /* IdentifierResolver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 352712500DAFE54700C76352 /* IdentifierResolver.cpp */; };
+ 3534A01D0E129849002709B2 /* ParseCXXInlineMethods.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3534A01C0E129849002709B2 /* ParseCXXInlineMethods.cpp */; };
+ 3536456B0E23EBF7009C6509 /* Environment.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3536456A0E23EBF7009C6509 /* Environment.cpp */; };
+ 3537AA0E0ECD08A4008F7CDC /* PreprocessorLexer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3537AA0D0ECD08A4008F7CDC /* PreprocessorLexer.cpp */; };
+ 3538FDB80ED24A4E005EC283 /* DeclarationName.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3538FDB70ED24A4E005EC283 /* DeclarationName.cpp */; };
+ 353959D50EE5F88A00E82461 /* ParseTemplate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 353959D40EE5F88A00E82461 /* ParseTemplate.cpp */; };
+ 35475B200E79973F0000BFE4 /* CGCall.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 35475B1F0E79973F0000BFE4 /* CGCall.cpp */; };
+ 355106860E9A8507006A4E44 /* MemRegion.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 355106850E9A8507006A4E44 /* MemRegion.cpp */; };
+ 3551068C0E9A8546006A4E44 /* ParsePragma.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3551068A0E9A8546006A4E44 /* ParsePragma.cpp */; };
+ 3551068D0E9A8546006A4E44 /* ParseTentative.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3551068B0E9A8546006A4E44 /* ParseTentative.cpp */; };
+ 3552E7550E520D80003A8CA5 /* PPCaching.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3552E7540E520D80003A8CA5 /* PPCaching.cpp */; };
+ 3552E7590E520DD7003A8CA5 /* CGObjCMac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3552E7580E520DD7003A8CA5 /* CGObjCMac.cpp */; };
+ 35544B880F5C7FD700D92AA9 /* RangeConstraintManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 35544B850F5C7FD700D92AA9 /* RangeConstraintManager.cpp */; };
+ 35544B890F5C7FD700D92AA9 /* SimpleConstraintManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 35544B860F5C7FD700D92AA9 /* SimpleConstraintManager.cpp */; };
+ 35544B8C0F5C803200D92AA9 /* SemaTemplateInstantiate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 35544B8B0F5C803200D92AA9 /* SemaTemplateInstantiate.cpp */; };
+ 3557D1A90EB136B100C59739 /* InheritViz.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3557D1A80EB136B100C59739 /* InheritViz.cpp */; };
+ 3557D1F00EB13BB700C59739 /* SemaInherit.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3557D1EF0EB13BB700C59739 /* SemaInherit.cpp */; };
+ 35585DC00EAFBC4500D0A97A /* SemaOverload.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 35585DBE0EAFBC4500D0A97A /* SemaOverload.cpp */; };
+ 3558F76D0E267C8300A5B0DF /* BasicStore.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3558F76C0E267C8300A5B0DF /* BasicStore.cpp */; };
+ 356EF9B50C8F7DDF006650F5 /* LiveVariables.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 356EF9B40C8F7DDF006650F5 /* LiveVariables.cpp */; };
+ 35707EFE0CD0F5CC000B2204 /* SourceLocation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 35707EFD0CD0F5CC000B2204 /* SourceLocation.cpp */; };
+ 357EA27D0F2526F300439B60 /* SemaLookup.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 357EA27C0F2526F300439B60 /* SemaLookup.cpp */; };
+ 35847BE50CC7DBAF00C40FFF /* StmtIterator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 35847BE40CC7DBAF00C40FFF /* StmtIterator.cpp */; };
+ 35862B0D0E3628CB0009F542 /* CheckDeadStores.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 35862B0C0E3628CB0009F542 /* CheckDeadStores.cpp */; };
+ 35862B120E3629850009F542 /* GRExprEngineInternalChecks.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 35862B110E3629850009F542 /* GRExprEngineInternalChecks.cpp */; };
+ 358CFBB80E65AB04002A8E19 /* BasicConstraintManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 358CFBB70E65AB04002A8E19 /* BasicConstraintManager.cpp */; };
+ 358D230B0E8BEB9D0003DDCC /* DeclGroup.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 358D230A0E8BEB9D0003DDCC /* DeclGroup.cpp */; };
+ 358F51520E529AA4007F2102 /* GRState.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 358F51510E529AA4007F2102 /* GRState.cpp */; };
+ 3591853F0EFB1088000039AF /* SemaTemplate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3591853E0EFB1088000039AF /* SemaTemplate.cpp */; };
+ 3593790A0DA48ABA0043B19C /* BugReporter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 359379090DA48ABA0043B19C /* BugReporter.cpp */; };
+ 3595AFB80E1C8D62004CDF09 /* CheckObjCDealloc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3595AFB70E1C8D62004CDF09 /* CheckObjCDealloc.cpp */; };
+ 3599299B0DE2425300A8A33E /* SemaInit.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3599299A0DE2425300A8A33E /* SemaInit.cpp */; };
+ 35A057E20EAE2D950069249F /* RegionStore.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 35A057E00EAE2D950069249F /* RegionStore.cpp */; };
+ 35A057E30EAE2D950069249F /* SVals.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 35A057E10EAE2D950069249F /* SVals.cpp */; };
+ 35A3E7020DD3874400757F74 /* CGDebugInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 35A3E7000DD3874400757F74 /* CGDebugInfo.cpp */; };
+ 35A8FCF90D9B4B2A001C2F97 /* PathDiagnostic.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 35A8FCF80D9B4B29001C2F97 /* PathDiagnostic.cpp */; };
+ 35BAC1E80E82C5B7003FB76F /* CheckNSError.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 35BAC1E70E82C5B7003FB76F /* CheckNSError.cpp */; };
+ 35BB2D7F0D19954000944DB5 /* ASTConsumer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 35BB2D7E0D19954000944DB5 /* ASTConsumer.cpp */; };
+ 35CFFE000CA1CBCB00E6F2BE /* StmtViz.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 35CFFDFF0CA1CBCB00E6F2BE /* StmtViz.cpp */; };
+ 35D55B270D81D8C60092E734 /* BasicValueFactory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 35D55B240D81D8C60092E734 /* BasicValueFactory.cpp */; };
+ 35D55B280D81D8C60092E734 /* CFRefCount.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 35D55B250D81D8C60092E734 /* CFRefCount.cpp */; };
+ 35E194690ECB82FB00F21733 /* SemaCXXScopeSpec.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 35E194670ECB82FB00F21733 /* SemaCXXScopeSpec.cpp */; };
+ 35E1946A0ECB82FB00F21733 /* SemaNamedCast.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 35E194680ECB82FB00F21733 /* SemaNamedCast.cpp */; };
+ 35E1946D0ECB83C100F21733 /* PTHLexer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 35E1946C0ECB83C100F21733 /* PTHLexer.cpp */; };
+ 35EE48B10E0C4CCA00715C54 /* DeclCXX.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 35EE48AF0E0C4CCA00715C54 /* DeclCXX.cpp */; };
+ 35EE48B20E0C4CCA00715C54 /* ParentMap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 35EE48B00E0C4CCA00715C54 /* ParentMap.cpp */; };
+ 35EF67700DAD1D2C00B19414 /* SemaDeclCXX.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 35EF676F0DAD1D2C00B19414 /* SemaDeclCXX.cpp */; };
+ 35EFEFB60DB67ED60020783D /* GRTransferFuncs.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 35EFEFB50DB67ED60020783D /* GRTransferFuncs.cpp */; };
+ 35F2A01E0E36AFF100D17527 /* CheckObjCUnusedIVars.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 35F2A01D0E36AFF100D17527 /* CheckObjCUnusedIVars.cpp */; };
+ 35F8D0D60D9B82CD00D91C5E /* BasicObjCFoundationChecks.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 35F8D0D50D9B82CD00D91C5E /* BasicObjCFoundationChecks.cpp */; };
+ 35FE6BCF0DF6EE1F00739712 /* DeclBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 35FE6BCE0DF6EE1F00739712 /* DeclBase.cpp */; };
+ 72D16C1F0D9975C400E6DA4A /* HTMLRewrite.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 72D16C1E0D9975C400E6DA4A /* HTMLRewrite.cpp */; };
+ 84AF36A10CB17A3B00C820A5 /* DeclObjC.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 84AF36A00CB17A3B00C820A5 /* DeclObjC.h */; };
+ 84D9A8880C1A57E100AC7ABC /* AttributeList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84D9A8870C1A57E100AC7ABC /* AttributeList.cpp */; };
+ 84D9A88C0C1A581300AC7ABC /* AttributeList.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 84D9A88B0C1A581300AC7ABC /* AttributeList.h */; };
+ 906BF4B00F83BA2E001071FA /* ConvertUTF.c in Sources */ = {isa = PBXBuildFile; fileRef = 906BF4AF0F83BA2E001071FA /* ConvertUTF.c */; };
+ BDF87CF70FD746F300BBF872 /* SemaTemplateDeduction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BDF87CF60FD746F300BBF872 /* SemaTemplateDeduction.cpp */; };
+ DE01DA490B12ADA300AC22CE /* PPCallbacks.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DE01DA480B12ADA300AC22CE /* PPCallbacks.h */; };
+ DE06756C0C051CFE00EBBFD8 /* ParseExprCXX.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE06756B0C051CFE00EBBFD8 /* ParseExprCXX.cpp */; };
+ DE06B73E0A8307640050E87E /* LangOptions.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DE06B73D0A8307640050E87E /* LangOptions.h */; };
+ DE06BECB0A854E4B0050E87E /* Scope.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DE06BECA0A854E4B0050E87E /* Scope.h */; };
+ DE06D4310A8BB52D0050E87E /* Parser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE06D42F0A8BB52D0050E87E /* Parser.cpp */; };
+ DE06E8140A8FF9330050E87E /* Action.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DE06E8130A8FF9330050E87E /* Action.h */; };
+ DE0FCA630A95859D00248FD5 /* Expr.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DE0FCA620A95859D00248FD5 /* Expr.h */; };
+ DE0FCB340A9C21F100248FD5 /* Expr.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE0FCB330A9C21F100248FD5 /* Expr.cpp */; };
+ DE1733000B068B700080B521 /* ASTContext.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE1732FF0B068B700080B521 /* ASTContext.cpp */; };
+ DE17336E0B068DC20080B521 /* DeclSpec.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE17336D0B068DC20080B521 /* DeclSpec.cpp */; };
+ DE1733700B068DC60080B521 /* DeclSpec.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DE17336F0B068DC60080B521 /* DeclSpec.h */; };
+ DE1F22030A7D852A00FBF588 /* Parser.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DE1F22020A7D852A00FBF588 /* Parser.h */; };
+ DE224FF80C7AA98800D370A5 /* CGExprComplex.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE224FF70C7AA98800D370A5 /* CGExprComplex.cpp */; };
+ DE2252700C7E82D000D370A5 /* CGExprScalar.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE22526F0C7E82D000D370A5 /* CGExprScalar.cpp */; };
+ DE2255FC0C8004E600D370A5 /* ParseDeclCXX.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE2255FB0C8004E600D370A5 /* ParseDeclCXX.cpp */; };
+ DE22BCF20E14197E0094DC60 /* SemaDeclAttr.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE22BCF10E14197E0094DC60 /* SemaDeclAttr.cpp */; };
+ DE344AB80AE5DF6D00DBC861 /* HeaderSearch.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DE344AB70AE5DF6D00DBC861 /* HeaderSearch.h */; };
+ DE344B540AE5E46C00DBC861 /* HeaderSearch.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE344B530AE5E46C00DBC861 /* HeaderSearch.cpp */; };
+ DE3450D70AEB543100DBC861 /* DirectoryLookup.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DE3450D60AEB543100DBC861 /* DirectoryLookup.h */; };
+ DE3452410AEF1A2D00DBC861 /* Stmt.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE3452400AEF1A2D00DBC861 /* Stmt.cpp */; };
+ DE3452810AEF1B1800DBC861 /* Stmt.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DE3452800AEF1B1800DBC861 /* Stmt.h */; };
+ DE345C1A0AFC658B00DBC861 /* StmtVisitor.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DE345C190AFC658B00DBC861 /* StmtVisitor.h */; };
+ DE345F220AFD347900DBC861 /* StmtNodes.def in CopyFiles */ = {isa = PBXBuildFile; fileRef = DE345F210AFD347900DBC861 /* StmtNodes.def */; };
+ DE3460000AFDCC1900DBC861 /* ParseObjc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE345FFF0AFDCC1900DBC861 /* ParseObjc.cpp */; };
+ DE3460050AFDCC6500DBC861 /* ParseInit.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE3460040AFDCC6500DBC861 /* ParseInit.cpp */; };
+ DE34600B0AFDCCBF00DBC861 /* ParseStmt.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE34600A0AFDCCBF00DBC861 /* ParseStmt.cpp */; };
+ DE34600F0AFDCCCE00DBC861 /* ParseDecl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE34600E0AFDCCCE00DBC861 /* ParseDecl.cpp */; };
+ DE3460130AFDCCDA00DBC861 /* ParseExpr.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE3460120AFDCCDA00DBC861 /* ParseExpr.cpp */; };
+ 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 */; };
+ DE3986F40CB8D50C00223765 /* IdentifierTable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE3986F30CB8D50C00223765 /* IdentifierTable.cpp */; };
+ DE4121350D7F1C1C0080F80A /* SymbolManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE4121270D7F1C1C0080F80A /* SymbolManager.cpp */; };
+ DE4121360D7F1C1C0080F80A /* ExplodedGraph.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE4121280D7F1C1C0080F80A /* ExplodedGraph.cpp */; };
+ DE4121370D7F1C1C0080F80A /* UninitializedValues.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE4121290D7F1C1C0080F80A /* UninitializedValues.cpp */; };
+ DE4121380D7F1C1C0080F80A /* GRCoreEngine.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE41212A0D7F1C1C0080F80A /* GRCoreEngine.cpp */; };
+ DE41213C0D7F1C1C0080F80A /* GRSimpleVals.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE41212F0D7F1C1C0080F80A /* GRSimpleVals.cpp */; };
+ DE41213D0D7F1C1C0080F80A /* GRBlockCounter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE4121300D7F1C1C0080F80A /* GRBlockCounter.cpp */; };
+ DE41213E0D7F1C1C0080F80A /* GRExprEngine.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE4121310D7F1C1C0080F80A /* GRExprEngine.cpp */; };
+ DE4264FC0C113592005A861D /* CGDecl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE4264FB0C113592005A861D /* CGDecl.cpp */; };
+ DE46BF280AE0A82D00CC047C /* TargetInfo.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DE46BF270AE0A82D00CC047C /* TargetInfo.h */; };
+ DE4772FA0C10EAE5002239E8 /* CGStmt.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE4772F90C10EAE5002239E8 /* CGStmt.cpp */; };
+ DE4772FC0C10EAEC002239E8 /* CGExpr.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE4772FB0C10EAEC002239E8 /* CGExpr.cpp */; };
+ DE47999C0D2EBE1A00706D2D /* SemaExprObjC.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE47999B0D2EBE1A00706D2D /* SemaExprObjC.cpp */; };
+ DE4DC7A30EA1C33E00069E5A /* TokenRewriter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE4DC7A20EA1C33E00069E5A /* TokenRewriter.cpp */; };
+ DE67E70B0C020EC500F66BC5 /* SemaType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE67E70A0C020EC500F66BC5 /* SemaType.cpp */; };
+ DE67E70D0C020ECA00F66BC5 /* SemaStmt.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE67E70C0C020ECA00F66BC5 /* SemaStmt.cpp */; };
+ DE67E70F0C020ECF00F66BC5 /* SemaExprCXX.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE67E70E0C020ECF00F66BC5 /* SemaExprCXX.cpp */; };
+ DE67E7110C020ED400F66BC5 /* SemaExpr.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE67E7100C020ED400F66BC5 /* SemaExpr.cpp */; };
+ DE67E7130C020ED900F66BC5 /* SemaDecl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE67E7120C020ED900F66BC5 /* SemaDecl.cpp */; };
+ DE67E7150C020EDF00F66BC5 /* Sema.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DE67E7140C020EDF00F66BC5 /* Sema.h */; };
+ DE67E7170C020EE400F66BC5 /* Sema.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE67E7160C020EE400F66BC5 /* Sema.cpp */; };
+ DE67E71A0C020F4F00F66BC5 /* ParseAST.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE67E7190C020F4F00F66BC5 /* ParseAST.cpp */; };
+ DE67E7280C02109800F66BC5 /* ParseAST.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DE67E7270C02109800F66BC5 /* ParseAST.h */; };
+ DE6951C70C4D1F5D00A5826B /* RecordLayout.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DE6951C60C4D1F5D00A5826B /* RecordLayout.h */; };
+ DE6954640C5121BD00A5826B /* Token.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DE6954630C5121BD00A5826B /* Token.h */; };
+ DE704B260D0FBEBE009C7762 /* SemaDeclObjC.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE704B250D0FBEBE009C7762 /* SemaDeclObjC.cpp */; };
+ DE704DD20D1668A4009C7762 /* HeaderMap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE704DD10D1668A4009C7762 /* HeaderMap.cpp */; };
+ DE75ED290B044DC90020CF81 /* ASTContext.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DE75ED280B044DC90020CF81 /* ASTContext.h */; };
+ DE75EDF10B06880E0020CF81 /* Type.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE75EDF00B06880E0020CF81 /* Type.cpp */; };
+ DE85CD810D8380B10070E26E /* TokenLexer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE85CD800D8380B10070E26E /* TokenLexer.cpp */; };
+ DE85CDA30D8383B20070E26E /* MacroArgs.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE85CDA20D8383B20070E26E /* MacroArgs.cpp */; };
+ DE85CDAC0D838C120070E26E /* PPMacroExpansion.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE85CDAB0D838C120070E26E /* PPMacroExpansion.cpp */; };
+ DE85CDB00D838C390070E26E /* PPDirectives.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE85CDAF0D838C390070E26E /* PPDirectives.cpp */; };
+ DE85CDB60D839BAE0070E26E /* PPLexerChange.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE85CDB50D839BAE0070E26E /* PPLexerChange.cpp */; };
+ DE8823CB0ED0046600CBC30A /* APValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE8823CA0ED0046600CBC30A /* APValue.cpp */; };
+ DE928B130C05659200231DA4 /* ModuleBuilder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE928B120C05659200231DA4 /* ModuleBuilder.cpp */; };
+ DE928B200C0565B000231DA4 /* ModuleBuilder.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DE928B1F0C0565B000231DA4 /* ModuleBuilder.h */; };
+ DE928B7D0C0A615100231DA4 /* CodeGenModule.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DE928B7C0C0A615100231DA4 /* CodeGenModule.h */; };
+ DE928B7F0C0A615600231DA4 /* CodeGenModule.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE928B7E0C0A615600231DA4 /* CodeGenModule.cpp */; };
+ DE928B810C0A615B00231DA4 /* CodeGenFunction.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DE928B800C0A615B00231DA4 /* CodeGenFunction.h */; };
+ DE928B830C0A616000231DA4 /* CodeGenFunction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE928B820C0A616000231DA4 /* CodeGenFunction.cpp */; };
+ DEAEE98B0A5A2B970045101B /* MultipleIncludeOpt.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DEAEE98A0A5A2B970045101B /* MultipleIncludeOpt.h */; };
+ DEAEED4B0A5AF89A0045101B /* NOTES.txt in CopyFiles */ = {isa = PBXBuildFile; fileRef = DEAEED4A0A5AF89A0045101B /* NOTES.txt */; };
+ DEB076CF0F3A222200F5A2BE /* DeclTemplate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DEB076CE0F3A222200F5A2BE /* DeclTemplate.cpp */; };
+ DEB077990F44F97800F5A2BE /* TokenConcatenation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DEB077980F44F97800F5A2BE /* TokenConcatenation.cpp */; };
+ DEB07AC80F4A427E00F5A2BE /* SemaAttr.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DEB07AC70F4A427E00F5A2BE /* SemaAttr.cpp */; };
+ DEC63B1A0C7B940200DBF169 /* CFG.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DEC63B190C7B940200DBF169 /* CFG.cpp */; };
+ DEC63B1C0C7B940600DBF169 /* CFG.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DEC63B1B0C7B940600DBF169 /* CFG.h */; };
+ DEC8D9910A9433CD00353FCA /* Decl.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DEC8D9900A9433CD00353FCA /* Decl.h */; };
+ DEC8D9A40A94346E00353FCA /* AST.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DEC8D9A30A94346E00353FCA /* AST.h */; };
+ DECAB0D00DB3C84200E13CCB /* RewriteRope.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DECAB0CF0DB3C84200E13CCB /* RewriteRope.cpp */; };
+ DECB6D650F9AE26600F5FBC7 /* JumpDiagnostics.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DECB6D640F9AE26600F5FBC7 /* JumpDiagnostics.cpp */; };
+ DECB6F070F9D93A800F5FBC7 /* InitPreprocessor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DECB6F060F9D93A800F5FBC7 /* InitPreprocessor.cpp */; };
+ DECB77130FA5752300F5FBC7 /* PCHReaderStmt.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DECB77120FA5752300F5FBC7 /* PCHReaderStmt.cpp */; };
+ DECB77790FA579B000F5FBC7 /* PCHReaderDecl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DECB77780FA579B000F5FBC7 /* PCHReaderDecl.cpp */; };
+ DECB77F70FA5850200F5FBC7 /* PCHWriterDecl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DECB77F60FA5850200F5FBC7 /* PCHWriterDecl.cpp */; };
+ 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 */; };
+ 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 */; };
+ DED7D7460A524295003AD0FB /* SourceManager.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DED7D7360A524295003AD0FB /* SourceManager.h */; };
+ DED7D7470A524295003AD0FB /* TokenKinds.def in CopyFiles */ = {isa = PBXBuildFile; fileRef = DED7D7370A524295003AD0FB /* TokenKinds.def */; };
+ DED7D7480A524295003AD0FB /* TokenKinds.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DED7D7380A524295003AD0FB /* TokenKinds.h */; };
+ DED7D74A0A524295003AD0FB /* Lexer.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DED7D73B0A524295003AD0FB /* Lexer.h */; };
+ DED7D74D0A524295003AD0FB /* MacroInfo.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DED7D73E0A524295003AD0FB /* MacroInfo.h */; };
+ DED7D74E0A524295003AD0FB /* Pragma.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DED7D73F0A524295003AD0FB /* Pragma.h */; };
+ DED7D74F0A524295003AD0FB /* Preprocessor.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DED7D7400A524295003AD0FB /* Preprocessor.h */; };
+ DED7D77A0A5242C7003AD0FB /* Diagnostic.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DED7D75D0A5242C7003AD0FB /* Diagnostic.cpp */; };
+ DED7D77B0A5242C7003AD0FB /* FileManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DED7D75E0A5242C7003AD0FB /* FileManager.cpp */; };
+ DED7D7890A5242C7003AD0FB /* SourceManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DED7D76D0A5242C7003AD0FB /* SourceManager.cpp */; };
+ DED7D78A0A5242C7003AD0FB /* TokenKinds.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DED7D76E0A5242C7003AD0FB /* TokenKinds.cpp */; };
+ DED7D7C30A5242E6003AD0FB /* Lexer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DED7D79E0A5242E6003AD0FB /* Lexer.cpp */; };
+ DED7D7C50A5242E6003AD0FB /* MacroInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DED7D7A00A5242E6003AD0FB /* MacroInfo.cpp */; };
+ DED7D7C70A5242E6003AD0FB /* PPExpressions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DED7D7A20A5242E6003AD0FB /* PPExpressions.cpp */; };
+ DED7D7C80A5242E6003AD0FB /* Pragma.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DED7D7A30A5242E6003AD0FB /* Pragma.cpp */; };
+ DED7D7C90A5242E6003AD0FB /* Preprocessor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DED7D7A40A5242E6003AD0FB /* Preprocessor.cpp */; };
+ DED7D7D80A524302003AD0FB /* README.txt in CopyFiles */ = {isa = PBXBuildFile; fileRef = DED7D7D70A524302003AD0FB /* README.txt */; };
+ DED7D9180A52518C003AD0FB /* ScratchBuffer.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DED7D9170A52518C003AD0FB /* ScratchBuffer.h */; };
+ DED7D9E50A5257F6003AD0FB /* ScratchBuffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DED7D9E40A5257F6003AD0FB /* ScratchBuffer.cpp */; };
+ DEDFE5CF0F7206E40035BD10 /* NestedNameSpecifier.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DEDFE5CE0F7206E40035BD10 /* NestedNameSpecifier.cpp */; };
+ DEDFE6460F7B3B4E0035BD10 /* driver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DEDFE6450F7B3B4E0035BD10 /* driver.cpp */; };
+ DEDFE65A0F7B3B830035BD10 /* Types.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DEDFE6480F7B3B830035BD10 /* Types.cpp */; };
+ DEDFE65B0F7B3B830035BD10 /* Tools.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DEDFE64A0F7B3B830035BD10 /* Tools.cpp */; };
+ DEDFE65C0F7B3B830035BD10 /* Compilation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DEDFE64C0F7B3B830035BD10 /* Compilation.cpp */; };
+ DEDFE65D0F7B3B830035BD10 /* ArgList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DEDFE64D0F7B3B830035BD10 /* ArgList.cpp */; };
+ DEDFE65E0F7B3B830035BD10 /* Arg.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DEDFE64E0F7B3B830035BD10 /* Arg.cpp */; };
+ DEDFE65F0F7B3B830035BD10 /* Action.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DEDFE64F0F7B3B830035BD10 /* Action.cpp */; };
+ DEDFE6600F7B3B830035BD10 /* Phases.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DEDFE6500F7B3B830035BD10 /* Phases.cpp */; };
+ DEDFE6610F7B3B830035BD10 /* OptTable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DEDFE6510F7B3B830035BD10 /* OptTable.cpp */; };
+ DEDFE6620F7B3B830035BD10 /* Option.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DEDFE6520F7B3B830035BD10 /* Option.cpp */; };
+ DEDFE6630F7B3B830035BD10 /* Job.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DEDFE6530F7B3B830035BD10 /* Job.cpp */; };
+ DEDFE6640F7B3B830035BD10 /* ToolChains.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DEDFE6550F7B3B830035BD10 /* ToolChains.cpp */; };
+ DEDFE6650F7B3B830035BD10 /* ToolChain.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DEDFE6560F7B3B830035BD10 /* ToolChain.cpp */; };
+ DEDFE6660F7B3B830035BD10 /* Tool.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DEDFE6570F7B3B830035BD10 /* Tool.cpp */; };
+ DEDFE6670F7B3B830035BD10 /* HostInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DEDFE6580F7B3B830035BD10 /* HostInfo.cpp */; };
+ DEDFE6680F7B3B830035BD10 /* Driver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DEDFE6590F7B3B830035BD10 /* Driver.cpp */; };
+ DEDFF8880F848CF80035BD10 /* TemplateName.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DEDFF8870F848CF80035BD10 /* TemplateName.cpp */; };
+ DEEBBD440C19C5D200A9FE82 /* TODO.txt in CopyFiles */ = {isa = PBXBuildFile; fileRef = DEEBBD430C19C5D200A9FE82 /* TODO.txt */; };
+ DEEBC3BA0C2363B800A9FE82 /* CodeGenTypes.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DEEBC3B90C2363B800A9FE82 /* CodeGenTypes.h */; };
+ DEEBC3BC0C2363BC00A9FE82 /* CodeGenTypes.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DEEBC3BB0C2363BC00A9FE82 /* CodeGenTypes.cpp */; };
+ DEF165710F8FB34D0098507F /* PCHWriter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DEF165700F8FB34D0098507F /* PCHWriter.cpp */; };
+ DEF165750F8FB3510098507F /* PCHReader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DEF165740F8FB3510098507F /* PCHReader.cpp */; };
+ DEF168400F9548DC0098507F /* FixItRewriter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DEF1683F0F9548DC0098507F /* FixItRewriter.cpp */; };
+ DEF2E95F0C5FBD74000C4259 /* InternalsManual.html in CopyFiles */ = {isa = PBXBuildFile; fileRef = DEF2E95E0C5FBD74000C4259 /* InternalsManual.html */; };
+ DEF2EDA70C6A4252000C4259 /* StmtDumper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DEF2EDA60C6A4252000C4259 /* StmtDumper.cpp */; };
+ DEF2EFF30C6CDD74000C4259 /* CGExprAgg.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DEF2EFF20C6CDD74000C4259 /* CGExprAgg.cpp */; };
+ DEF2F0100C6CFED5000C4259 /* SemaChecking.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DEF2F00F0C6CFED5000C4259 /* SemaChecking.cpp */; };
+ DEF7D9F70C9C8B1A0001F598 /* Rewriter.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = DEF7D9F60C9C8B1A0001F598 /* Rewriter.h */; };
+ DEF7D9F90C9C8B1D0001F598 /* Rewriter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DEF7D9F80C9C8B1D0001F598 /* Rewriter.cpp */; };
+ DEFFECA70DB1546600B4E7C3 /* DeltaTree.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DEFFECA60DB1546600B4E7C3 /* DeltaTree.cpp */; };
+/* End PBXBuildFile section */
+
+/* Begin PBXCopyFilesBuildPhase section */
+ 8DD76F690486A84900D96B5E /* CopyFiles */ = {
+ isa = PBXCopyFilesBuildPhase;
+ buildActionMask = 8;
+ dstPath = /usr/share/man/man1/;
+ dstSubfolderSpec = 0;
+ files = (
+ DED7D7410A524295003AD0FB /* Diagnostic.h in CopyFiles */,
+ DED7D7430A524295003AD0FB /* FileManager.h in CopyFiles */,
+ DED7D7450A524295003AD0FB /* SourceLocation.h in CopyFiles */,
+ DED7D7460A524295003AD0FB /* SourceManager.h in CopyFiles */,
+ DED7D7470A524295003AD0FB /* TokenKinds.def in CopyFiles */,
+ DED7D7480A524295003AD0FB /* TokenKinds.h in CopyFiles */,
+ DED7D74A0A524295003AD0FB /* Lexer.h in CopyFiles */,
+ DED7D74D0A524295003AD0FB /* MacroInfo.h in CopyFiles */,
+ DED7D74E0A524295003AD0FB /* Pragma.h in CopyFiles */,
+ DED7D74F0A524295003AD0FB /* Preprocessor.h in CopyFiles */,
+ DED7D7D80A524302003AD0FB /* README.txt in CopyFiles */,
+ DED7D9180A52518C003AD0FB /* ScratchBuffer.h in CopyFiles */,
+ DEAEE98B0A5A2B970045101B /* MultipleIncludeOpt.h in CopyFiles */,
+ DEAEED4B0A5AF89A0045101B /* NOTES.txt in CopyFiles */,
+ DE1F22030A7D852A00FBF588 /* Parser.h in CopyFiles */,
+ DE06B73E0A8307640050E87E /* LangOptions.h in CopyFiles */,
+ DE06BECB0A854E4B0050E87E /* Scope.h in CopyFiles */,
+ DE06E8140A8FF9330050E87E /* Action.h in CopyFiles */,
+ DEC8D9910A9433CD00353FCA /* Decl.h in CopyFiles */,
+ DEC8D9A40A94346E00353FCA /* AST.h in CopyFiles */,
+ DE0FCA630A95859D00248FD5 /* Expr.h in CopyFiles */,
+ DE46BF280AE0A82D00CC047C /* TargetInfo.h in CopyFiles */,
+ DE344AB80AE5DF6D00DBC861 /* HeaderSearch.h in CopyFiles */,
+ DE3450D70AEB543100DBC861 /* DirectoryLookup.h in CopyFiles */,
+ DE3452810AEF1B1800DBC861 /* Stmt.h in CopyFiles */,
+ DE345C1A0AFC658B00DBC861 /* StmtVisitor.h in CopyFiles */,
+ DE345F220AFD347900DBC861 /* StmtNodes.def in CopyFiles */,
+ DE3464220B03040900DBC861 /* Type.h in CopyFiles */,
+ DE75ED290B044DC90020CF81 /* ASTContext.h in CopyFiles */,
+ DE1733700B068DC60080B521 /* DeclSpec.h in CopyFiles */,
+ DE01DA490B12ADA300AC22CE /* PPCallbacks.h in CopyFiles */,
+ 1A30A9E90B93A4C800201A91 /* ExprCXX.h in CopyFiles */,
+ 1A869A700BA2164C008DA07A /* LiteralSupport.h in CopyFiles */,
+ DE67E7150C020EDF00F66BC5 /* Sema.h in CopyFiles */,
+ DE67E7280C02109800F66BC5 /* ParseAST.h in CopyFiles */,
+ DE928B200C0565B000231DA4 /* ModuleBuilder.h in CopyFiles */,
+ DE928B7D0C0A615100231DA4 /* CodeGenModule.h in CopyFiles */,
+ DE928B810C0A615B00231DA4 /* CodeGenFunction.h in CopyFiles */,
+ DEEBBD440C19C5D200A9FE82 /* TODO.txt in CopyFiles */,
+ 84D9A88C0C1A581300AC7ABC /* AttributeList.h in CopyFiles */,
+ DEEBC3BA0C2363B800A9FE82 /* CodeGenTypes.h in CopyFiles */,
+ DE6951C70C4D1F5D00A5826B /* RecordLayout.h in CopyFiles */,
+ DE6954640C5121BD00A5826B /* Token.h in CopyFiles */,
+ DEF2E95F0C5FBD74000C4259 /* InternalsManual.html in CopyFiles */,
+ DEC63B1C0C7B940600DBF169 /* CFG.h in CopyFiles */,
+ DEF7D9F70C9C8B1A0001F598 /* Rewriter.h in CopyFiles */,
+ 84AF36A10CB17A3B00C820A5 /* DeclObjC.h in CopyFiles */,
+ DE3986F00CB8D4B300223765 /* IdentifierTable.h in CopyFiles */,
+ );
+ runOnlyForDeploymentPostprocessing = 1;
+ };
+/* End PBXCopyFilesBuildPhase section */
+
+/* Begin PBXFileReference section */
+ 035611470DA6A45C00D2EF2A /* DeclBase.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = DeclBase.h; path = clang/AST/DeclBase.h; sourceTree = "<group>"; tabWidth = 2; };
+ 03F50AC50D416EAA00B9CF60 /* Targets.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; path = Targets.cpp; sourceTree = "<group>"; tabWidth = 2; };
+ 1A14D3A60FD78A3F00DA2835 /* DeclPrinter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = DeclPrinter.cpp; path = lib/AST/DeclPrinter.cpp; sourceTree = "<group>"; tabWidth = 2; };
+ 1A2193CB0F45EEB700C0713D /* ABIInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = ABIInfo.h; path = lib/CodeGen/ABIInfo.h; sourceTree = "<group>"; tabWidth = 2; };
+ 1A2193CC0F45EEB700C0713D /* Mangle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = Mangle.cpp; path = lib/CodeGen/Mangle.cpp; sourceTree = "<group>"; tabWidth = 2; };
+ 1A2193CD0F45EEB700C0713D /* Mangle.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = Mangle.h; path = lib/CodeGen/Mangle.h; sourceTree = "<group>"; tabWidth = 2; };
+ 1A2A54A40FD1DD1C00F4CE45 /* AnalysisConsumer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AnalysisConsumer.cpp; path = lib/Frontend/AnalysisConsumer.cpp; sourceTree = "<group>"; };
+ 1A2A54A50FD1DD1C00F4CE45 /* ASTConsumers.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ASTConsumers.cpp; path = lib/Frontend/ASTConsumers.cpp; sourceTree = "<group>"; };
+ 1A2A54A60FD1DD1C00F4CE45 /* Backend.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Backend.cpp; path = lib/Frontend/Backend.cpp; sourceTree = "<group>"; };
+ 1A2A54A70FD1DD1C00F4CE45 /* CacheTokens.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CacheTokens.cpp; path = lib/Frontend/CacheTokens.cpp; sourceTree = "<group>"; };
+ 1A2A54A80FD1DD1C00F4CE45 /* DependencyFile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DependencyFile.cpp; path = lib/Frontend/DependencyFile.cpp; sourceTree = "<group>"; };
+ 1A2A54A90FD1DD1C00F4CE45 /* DiagChecker.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DiagChecker.cpp; path = lib/Frontend/DiagChecker.cpp; sourceTree = "<group>"; };
+ 1A2A54AA0FD1DD1C00F4CE45 /* DocumentXML.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DocumentXML.cpp; path = lib/Frontend/DocumentXML.cpp; sourceTree = "<group>"; };
+ 1A2A54AB0FD1DD1C00F4CE45 /* GeneratePCH.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = GeneratePCH.cpp; path = lib/Frontend/GeneratePCH.cpp; sourceTree = "<group>"; };
+ 1A2A54AC0FD1DD1C00F4CE45 /* HTMLPrint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = HTMLPrint.cpp; path = lib/Frontend/HTMLPrint.cpp; sourceTree = "<group>"; };
+ 1A2A54AD0FD1DD1C00F4CE45 /* PrintParserCallbacks.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PrintParserCallbacks.cpp; path = lib/Frontend/PrintParserCallbacks.cpp; sourceTree = "<group>"; };
+ 1A2A54AE0FD1DD1C00F4CE45 /* PrintPreprocessedOutput.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PrintPreprocessedOutput.cpp; path = lib/Frontend/PrintPreprocessedOutput.cpp; sourceTree = "<group>"; };
+ 1A2A54AF0FD1DD1C00F4CE45 /* RewriteBlocks.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RewriteBlocks.cpp; path = lib/Frontend/RewriteBlocks.cpp; sourceTree = "<group>"; };
+ 1A2A54B00FD1DD1C00F4CE45 /* RewriteMacros.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RewriteMacros.cpp; path = lib/Frontend/RewriteMacros.cpp; sourceTree = "<group>"; };
+ 1A2A54B10FD1DD1C00F4CE45 /* RewriteObjC.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RewriteObjC.cpp; path = lib/Frontend/RewriteObjC.cpp; sourceTree = "<group>"; };
+ 1A2A54B20FD1DD1C00F4CE45 /* RewriteTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RewriteTest.cpp; path = lib/Frontend/RewriteTest.cpp; sourceTree = "<group>"; };
+ 1A2A54B30FD1DD1C00F4CE45 /* StmtXML.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = StmtXML.cpp; path = lib/Frontend/StmtXML.cpp; sourceTree = "<group>"; };
+ 1A2A54B40FD1DD1C00F4CE45 /* Warnings.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Warnings.cpp; path = lib/Frontend/Warnings.cpp; sourceTree = "<group>"; };
+ 1A30A9E80B93A4C800201A91 /* ExprCXX.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = ExprCXX.h; path = clang/AST/ExprCXX.h; sourceTree = "<group>"; tabWidth = 2; };
+ 1A32C17E0E1C87AD00A6B483 /* ExprConstant.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = ExprConstant.cpp; path = lib/AST/ExprConstant.cpp; sourceTree = "<group>"; tabWidth = 2; };
+ 1A376A2C0D4AED9B002A1C52 /* CGExprConstant.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = CGExprConstant.cpp; path = lib/CodeGen/CGExprConstant.cpp; sourceTree = "<group>"; tabWidth = 2; };
+ 1A410F840FBCE51100351440 /* SemaTemplateInstantiateExpr.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = SemaTemplateInstantiateExpr.cpp; path = lib/Sema/SemaTemplateInstantiateExpr.cpp; sourceTree = "<group>"; tabWidth = 2; };
+ 1A471AB40F437BC500753CE8 /* CGBlocks.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = CGBlocks.cpp; path = lib/CodeGen/CGBlocks.cpp; sourceTree = "<group>"; tabWidth = 2; };
+ 1A5119C30FBDF71000A1FF22 /* SemaTemplateInstantiateStmt.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = SemaTemplateInstantiateStmt.cpp; path = lib/Sema/SemaTemplateInstantiateStmt.cpp; sourceTree = "<group>"; tabWidth = 2; };
+ 1A5D5E570E5E81010023C059 /* CGCXX.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = CGCXX.cpp; path = lib/CodeGen/CGCXX.cpp; sourceTree = "<group>"; tabWidth = 2; };
+ 1A649E1D0F9599D9005B965E /* CGBlocks.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CGBlocks.h; path = lib/CodeGen/CGBlocks.h; sourceTree = "<group>"; };
+ 1A649E1E0F9599DA005B965E /* CGCXX.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CGCXX.h; path = lib/CodeGen/CGCXX.h; sourceTree = "<group>"; };
+ 1A6FE7080FD6F85800E00CA9 /* CGCXXTemp.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = CGCXXTemp.cpp; path = lib/CodeGen/CGCXXTemp.cpp; sourceTree = "<group>"; tabWidth = 2; };
+ 1A7019E90F79BC1100FEC4D1 /* DiagnosticAnalysisKinds.td */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DiagnosticAnalysisKinds.td; sourceTree = "<group>"; };
+ 1A7019EA0F79BC1100FEC4D1 /* DiagnosticASTKinds.td */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DiagnosticASTKinds.td; sourceTree = "<group>"; };
+ 1A7019EB0F79BC1100FEC4D1 /* DiagnosticCommonKinds.td */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DiagnosticCommonKinds.td; sourceTree = "<group>"; };
+ 1A7019EC0F79BC1100FEC4D1 /* DiagnosticDriverKinds.td */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DiagnosticDriverKinds.td; sourceTree = "<group>"; };
+ 1A7019ED0F79BC1100FEC4D1 /* DiagnosticFrontendKinds.td */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DiagnosticFrontendKinds.td; sourceTree = "<group>"; };
+ 1A7019EE0F79BC1100FEC4D1 /* DiagnosticLexKinds.td */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DiagnosticLexKinds.td; sourceTree = "<group>"; };
+ 1A7019EF0F79BC1100FEC4D1 /* DiagnosticParseKinds.td */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DiagnosticParseKinds.td; sourceTree = "<group>"; };
+ 1A701A250F79CE1C00FEC4D1 /* DiagnosticSemaKinds.td */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DiagnosticSemaKinds.td; sourceTree = "<group>"; };
+ 1A701B630F7C8FE400FEC4D1 /* SemaAccess.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = SemaAccess.cpp; path = lib/Sema/SemaAccess.cpp; sourceTree = "<group>"; tabWidth = 2; };
+ 1A72BEAC0D641E9400B085E9 /* Attr.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = Attr.h; path = clang/AST/Attr.h; sourceTree = "<group>"; tabWidth = 2; };
+ 1A7342470C7B57D500122F56 /* CGObjC.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = CGObjC.cpp; path = lib/CodeGen/CGObjC.cpp; sourceTree = "<group>"; tabWidth = 2; };
+ 1A869A6E0BA2164C008DA07A /* LiteralSupport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LiteralSupport.h; sourceTree = "<group>"; };
+ 1A869AA70BA21ABA008DA07A /* LiteralSupport.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = LiteralSupport.cpp; sourceTree = "<group>"; };
+ 1ABC36930C7A4BDC006DB0AB /* CGBuiltin.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = CGBuiltin.cpp; path = lib/CodeGen/CGBuiltin.cpp; sourceTree = "<group>"; tabWidth = 2; };
+ 1ADF47AE0F782C3200E48A8A /* SemaTemplateInstantiateDecl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = SemaTemplateInstantiateDecl.cpp; path = lib/Sema/SemaTemplateInstantiateDecl.cpp; sourceTree = "<group>"; tabWidth = 2; };
+ 1AFEF4050F8A6B2300476F2B /* clang-cc.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = "clang-cc.cpp"; path = "tools/clang-cc/clang-cc.cpp"; sourceTree = "<group>"; tabWidth = 2; };
+ 3507E4C10E27FE2D00FB7B57 /* CheckObjCInstMethSignature.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CheckObjCInstMethSignature.cpp; path = lib/Analysis/CheckObjCInstMethSignature.cpp; sourceTree = "<group>"; };
+ 352246E10F5C6BE000D0D279 /* HTMLDiagnostics.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = HTMLDiagnostics.cpp; path = lib/Frontend/HTMLDiagnostics.cpp; sourceTree = "<group>"; };
+ 352246E20F5C6BE000D0D279 /* InitHeaderSearch.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = InitHeaderSearch.cpp; path = lib/Frontend/InitHeaderSearch.cpp; sourceTree = "<group>"; };
+ 352246E30F5C6BE000D0D279 /* ManagerRegistry.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ManagerRegistry.cpp; path = lib/Frontend/ManagerRegistry.cpp; sourceTree = "<group>"; };
+ 352246E40F5C6BE000D0D279 /* PlistDiagnostics.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PlistDiagnostics.cpp; path = lib/Frontend/PlistDiagnostics.cpp; sourceTree = "<group>"; };
+ 352246E50F5C6BE000D0D279 /* TextDiagnosticBuffer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TextDiagnosticBuffer.cpp; path = lib/Frontend/TextDiagnosticBuffer.cpp; sourceTree = "<group>"; };
+ 352246E60F5C6BE000D0D279 /* TextDiagnosticPrinter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TextDiagnosticPrinter.cpp; path = lib/Frontend/TextDiagnosticPrinter.cpp; sourceTree = "<group>"; };
+ 35260CA40C7F75C000D66CE9 /* ExprCXX.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = ExprCXX.cpp; path = lib/AST/ExprCXX.cpp; sourceTree = "<group>"; tabWidth = 2; };
+ 3527124F0DAFE54700C76352 /* IdentifierResolver.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = IdentifierResolver.h; path = lib/Sema/IdentifierResolver.h; sourceTree = "<group>"; tabWidth = 2; };
+ 352712500DAFE54700C76352 /* IdentifierResolver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = IdentifierResolver.cpp; path = lib/Sema/IdentifierResolver.cpp; sourceTree = "<group>"; tabWidth = 2; };
+ 352C19DC0CA321C80045DB98 /* CFGRecStmtDeclVisitor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CFGRecStmtDeclVisitor.h; path = clang/Analysis/Visitors/CFGRecStmtDeclVisitor.h; sourceTree = "<group>"; };
+ 352C19DD0CA321C80045DB98 /* CFGRecStmtVisitor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CFGRecStmtVisitor.h; path = clang/Analysis/Visitors/CFGRecStmtVisitor.h; sourceTree = "<group>"; };
+ 352C19DE0CA321C80045DB98 /* CFGStmtVisitor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CFGStmtVisitor.h; path = clang/Analysis/Visitors/CFGStmtVisitor.h; sourceTree = "<group>"; };
+ 352C19DF0CA321C80045DB98 /* CFGVarDeclVisitor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CFGVarDeclVisitor.h; path = clang/Analysis/Visitors/CFGVarDeclVisitor.h; sourceTree = "<group>"; };
+ 3534A01C0E129849002709B2 /* ParseCXXInlineMethods.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = ParseCXXInlineMethods.cpp; path = lib/Parse/ParseCXXInlineMethods.cpp; sourceTree = "<group>"; tabWidth = 2; };
+ 3536456A0E23EBF7009C6509 /* Environment.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Environment.cpp; path = lib/Analysis/Environment.cpp; sourceTree = "<group>"; };
+ 3536457C0E2406B0009C6509 /* Environment.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Environment.h; path = clang/Analysis/PathSensitive/Environment.h; sourceTree = "<group>"; };
+ 3537AA0C0ECD088F008F7CDC /* BlkExprDeclBitVector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BlkExprDeclBitVector.h; path = clang/Analysis/Support/BlkExprDeclBitVector.h; sourceTree = "<group>"; };
+ 3537AA0D0ECD08A4008F7CDC /* PreprocessorLexer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PreprocessorLexer.cpp; sourceTree = "<group>"; };
+ 3538FDB60ED24A2C005EC283 /* DeclarationName.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = DeclarationName.h; path = clang/AST/DeclarationName.h; sourceTree = "<group>"; tabWidth = 2; };
+ 3538FDB70ED24A4E005EC283 /* DeclarationName.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DeclarationName.cpp; path = lib/AST/DeclarationName.cpp; sourceTree = "<group>"; };
+ 353959D40EE5F88A00E82461 /* ParseTemplate.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = ParseTemplate.cpp; path = lib/Parse/ParseTemplate.cpp; sourceTree = "<group>"; tabWidth = 2; };
+ 3547129D0C88881300B3E1D5 /* PrettyPrinter.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = PrettyPrinter.h; path = clang/AST/PrettyPrinter.h; sourceTree = "<group>"; tabWidth = 2; };
+ 35475B1F0E79973F0000BFE4 /* CGCall.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = CGCall.cpp; path = lib/CodeGen/CGCall.cpp; sourceTree = "<group>"; tabWidth = 2; };
+ 35475B220E7997680000BFE4 /* CGCall.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = CGCall.h; path = lib/CodeGen/CGCall.h; sourceTree = "<group>"; tabWidth = 2; };
+ 35475B230E7997680000BFE4 /* CGValue.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = CGValue.h; path = lib/CodeGen/CGValue.h; sourceTree = "<group>"; tabWidth = 2; };
+ 355106850E9A8507006A4E44 /* MemRegion.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = MemRegion.cpp; path = lib/Analysis/MemRegion.cpp; sourceTree = "<group>"; };
+ 355106880E9A851B006A4E44 /* MemRegion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MemRegion.h; path = clang/Analysis/PathSensitive/MemRegion.h; sourceTree = "<group>"; };
+ 3551068A0E9A8546006A4E44 /* ParsePragma.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = ParsePragma.cpp; path = lib/Parse/ParsePragma.cpp; sourceTree = "<group>"; tabWidth = 2; };
+ 3551068B0E9A8546006A4E44 /* ParseTentative.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = ParseTentative.cpp; path = lib/Parse/ParseTentative.cpp; sourceTree = "<group>"; tabWidth = 2; };
+ 3551068E0E9A855F006A4E44 /* AccessSpecifier.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = AccessSpecifier.h; path = clang/Parse/AccessSpecifier.h; sourceTree = "<group>"; tabWidth = 2; };
+ 3551068F0E9A857C006A4E44 /* ParsePragma.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = ParsePragma.h; path = lib/Parse/ParsePragma.h; sourceTree = "<group>"; tabWidth = 2; };
+ 3552E7540E520D80003A8CA5 /* PPCaching.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PPCaching.cpp; sourceTree = "<group>"; };
+ 3552E7580E520DD7003A8CA5 /* CGObjCMac.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = CGObjCMac.cpp; path = lib/CodeGen/CGObjCMac.cpp; sourceTree = "<group>"; tabWidth = 2; };
+ 3553EB9A0E5F7089007D7359 /* GRStateTrait.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GRStateTrait.h; path = clang/Analysis/PathSensitive/GRStateTrait.h; sourceTree = "<group>"; };
+ 35544B850F5C7FD700D92AA9 /* RangeConstraintManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RangeConstraintManager.cpp; path = lib/Analysis/RangeConstraintManager.cpp; sourceTree = "<group>"; };
+ 35544B860F5C7FD700D92AA9 /* SimpleConstraintManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SimpleConstraintManager.cpp; path = lib/Analysis/SimpleConstraintManager.cpp; sourceTree = "<group>"; };
+ 35544B870F5C7FD700D92AA9 /* SimpleConstraintManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SimpleConstraintManager.h; path = lib/Analysis/SimpleConstraintManager.h; sourceTree = "<group>"; };
+ 35544B8B0F5C803200D92AA9 /* SemaTemplateInstantiate.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = SemaTemplateInstantiate.cpp; path = lib/Sema/SemaTemplateInstantiate.cpp; sourceTree = "<group>"; tabWidth = 2; };
+ 3557D1A80EB136B100C59739 /* InheritViz.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = InheritViz.cpp; path = lib/AST/InheritViz.cpp; sourceTree = "<group>"; tabWidth = 2; };
+ 3557D1EF0EB13BB700C59739 /* SemaInherit.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = SemaInherit.cpp; path = lib/Sema/SemaInherit.cpp; sourceTree = "<group>"; tabWidth = 2; };
+ 35585DBD0EAFBC4500D0A97A /* CXXFieldCollector.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = CXXFieldCollector.h; path = lib/Sema/CXXFieldCollector.h; sourceTree = "<group>"; tabWidth = 2; };
+ 35585DBE0EAFBC4500D0A97A /* SemaOverload.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = SemaOverload.cpp; path = lib/Sema/SemaOverload.cpp; sourceTree = "<group>"; tabWidth = 2; };
+ 35585DBF0EAFBC4500D0A97A /* SemaOverload.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = SemaOverload.h; path = lib/Sema/SemaOverload.h; sourceTree = "<group>"; tabWidth = 2; };
+ 3558F76C0E267C8300A5B0DF /* BasicStore.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = BasicStore.cpp; path = lib/Analysis/BasicStore.cpp; sourceTree = "<group>"; };
+ 3558F76F0E267C9A00A5B0DF /* Store.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Store.h; path = clang/Analysis/PathSensitive/Store.h; sourceTree = "<group>"; };
+ 355CF6820C90A8B600A08AA3 /* LocalCheckers.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LocalCheckers.h; path = clang/Analysis/LocalCheckers.h; sourceTree = "<group>"; };
+ 356B89760D9BFDC100CBEBE9 /* BasicObjCFoundationChecks.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BasicObjCFoundationChecks.h; path = lib/Analysis/BasicObjCFoundationChecks.h; sourceTree = "<group>"; };
+ 356EF9B40C8F7DDF006650F5 /* LiveVariables.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LiveVariables.cpp; path = lib/Analysis/LiveVariables.cpp; sourceTree = "<group>"; };
+ 35707EFD0CD0F5CC000B2204 /* SourceLocation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; path = SourceLocation.cpp; sourceTree = "<group>"; tabWidth = 2; };
+ 357EA27C0F2526F300439B60 /* SemaLookup.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = SemaLookup.cpp; path = lib/Sema/SemaLookup.cpp; sourceTree = "<group>"; tabWidth = 2; };
+ 35847BE30CC7DB9000C40FFF /* StmtIterator.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = StmtIterator.h; path = clang/AST/StmtIterator.h; sourceTree = "<group>"; tabWidth = 2; };
+ 35847BE40CC7DBAF00C40FFF /* StmtIterator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = StmtIterator.cpp; path = lib/AST/StmtIterator.cpp; sourceTree = "<group>"; tabWidth = 2; };
+ 35862B0C0E3628CB0009F542 /* CheckDeadStores.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CheckDeadStores.cpp; path = lib/Analysis/CheckDeadStores.cpp; sourceTree = "<group>"; };
+ 35862B110E3629850009F542 /* GRExprEngineInternalChecks.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = GRExprEngineInternalChecks.cpp; path = lib/Analysis/GRExprEngineInternalChecks.cpp; sourceTree = "<group>"; };
+ 358CFBB70E65AB04002A8E19 /* BasicConstraintManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = BasicConstraintManager.cpp; path = lib/Analysis/BasicConstraintManager.cpp; sourceTree = "<group>"; };
+ 358D23090E8BEB850003DDCC /* DeclGroup.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = DeclGroup.h; path = clang/AST/DeclGroup.h; sourceTree = "<group>"; tabWidth = 2; };
+ 358D230A0E8BEB9D0003DDCC /* DeclGroup.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = DeclGroup.cpp; path = lib/AST/DeclGroup.cpp; sourceTree = "<group>"; tabWidth = 2; };
+ 358F514F0E529A87007F2102 /* GRState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GRState.h; path = clang/Analysis/PathSensitive/GRState.h; sourceTree = "<group>"; };
+ 358F51510E529AA4007F2102 /* GRState.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = GRState.cpp; path = lib/Analysis/GRState.cpp; sourceTree = "<group>"; };
+ 3591853E0EFB1088000039AF /* SemaTemplate.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = SemaTemplate.cpp; path = lib/Sema/SemaTemplate.cpp; sourceTree = "<group>"; tabWidth = 2; };
+ 359378FF0DA486490043B19C /* BugReporter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BugReporter.h; path = clang/Analysis/PathSensitive/BugReporter.h; sourceTree = "<group>"; };
+ 359379090DA48ABA0043B19C /* BugReporter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = BugReporter.cpp; path = lib/Analysis/BugReporter.cpp; sourceTree = "<group>"; };
+ 3595AFB70E1C8D62004CDF09 /* CheckObjCDealloc.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CheckObjCDealloc.cpp; path = lib/Analysis/CheckObjCDealloc.cpp; sourceTree = "<group>"; };
+ 3598EBEB0EDE23EF0070CA16 /* PTHManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PTHManager.h; sourceTree = "<group>"; };
+ 3599299A0DE2425300A8A33E /* SemaInit.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = SemaInit.cpp; path = lib/Sema/SemaInit.cpp; sourceTree = "<group>"; tabWidth = 2; };
+ 35A057D20EAE2D2B0069249F /* SVals.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SVals.h; path = clang/Analysis/PathSensitive/SVals.h; sourceTree = "<group>"; };
+ 35A057E00EAE2D950069249F /* RegionStore.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegionStore.cpp; path = lib/Analysis/RegionStore.cpp; sourceTree = "<group>"; };
+ 35A057E10EAE2D950069249F /* SVals.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SVals.cpp; path = lib/Analysis/SVals.cpp; sourceTree = "<group>"; };
+ 35A3E7000DD3874400757F74 /* CGDebugInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = CGDebugInfo.cpp; path = lib/CodeGen/CGDebugInfo.cpp; sourceTree = "<group>"; tabWidth = 2; wrapsLines = 1; };
+ 35A3E7010DD3874400757F74 /* CGDebugInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = CGDebugInfo.h; path = lib/CodeGen/CGDebugInfo.h; sourceTree = "<group>"; tabWidth = 2; };
+ 35A8FCF60D9B4ADD001C2F97 /* ProgramPoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ProgramPoint.h; path = clang/Analysis/ProgramPoint.h; sourceTree = "<group>"; };
+ 35A8FCF70D9B4ADD001C2F97 /* PathDiagnostic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PathDiagnostic.h; path = clang/Analysis/PathDiagnostic.h; sourceTree = "<group>"; };
+ 35A8FCF80D9B4B29001C2F97 /* PathDiagnostic.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PathDiagnostic.cpp; path = lib/Analysis/PathDiagnostic.cpp; sourceTree = "<group>"; };
+ 35B820740ECB811A0020BEC0 /* PreprocessorLexer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PreprocessorLexer.h; sourceTree = "<group>"; };
+ 35BAC1E70E82C5B7003FB76F /* CheckNSError.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CheckNSError.cpp; path = lib/Analysis/CheckNSError.cpp; sourceTree = "<group>"; };
+ 35BB2D7E0D19954000944DB5 /* ASTConsumer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = ASTConsumer.cpp; path = lib/AST/ASTConsumer.cpp; sourceTree = "<group>"; tabWidth = 2; };
+ 35BFBD2B0C9EDE1E006CB644 /* ASTConsumer.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = ASTConsumer.h; path = clang/AST/ASTConsumer.h; sourceTree = "<group>"; tabWidth = 2; };
+ 35CEA05A0DF9E82700A41296 /* ExprObjC.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = ExprObjC.h; path = clang/AST/ExprObjC.h; sourceTree = "<group>"; tabWidth = 2; };
+ 35CFFDFF0CA1CBCB00E6F2BE /* StmtViz.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = StmtViz.cpp; path = lib/AST/StmtViz.cpp; sourceTree = "<group>"; tabWidth = 2; };
+ 35CFFE010CA1CBDD00E6F2BE /* StmtGraphTraits.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = StmtGraphTraits.h; path = clang/AST/StmtGraphTraits.h; sourceTree = "<group>"; tabWidth = 2; };
+ 35D1DDD10CA9C6D50096E967 /* DataflowSolver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DataflowSolver.h; path = clang/Analysis/FlowSensitive/DataflowSolver.h; sourceTree = "<group>"; };
+ 35D1DDD20CA9C6D50096E967 /* DataflowValues.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DataflowValues.h; path = clang/Analysis/FlowSensitive/DataflowValues.h; sourceTree = "<group>"; };
+ 35D55B240D81D8C60092E734 /* BasicValueFactory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = BasicValueFactory.cpp; path = lib/Analysis/BasicValueFactory.cpp; sourceTree = "<group>"; };
+ 35D55B250D81D8C60092E734 /* CFRefCount.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CFRefCount.cpp; path = lib/Analysis/CFRefCount.cpp; sourceTree = "<group>"; };
+ 35D55B290D81D8E50092E734 /* BasicValueFactory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BasicValueFactory.h; path = clang/Analysis/PathSensitive/BasicValueFactory.h; sourceTree = "<group>"; };
+ 35E194670ECB82FB00F21733 /* SemaCXXScopeSpec.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = SemaCXXScopeSpec.cpp; path = lib/Sema/SemaCXXScopeSpec.cpp; sourceTree = "<group>"; tabWidth = 2; };
+ 35E194680ECB82FB00F21733 /* SemaNamedCast.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = SemaNamedCast.cpp; path = lib/Sema/SemaNamedCast.cpp; sourceTree = "<group>"; tabWidth = 2; };
+ 35E1946C0ECB83C100F21733 /* PTHLexer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PTHLexer.cpp; sourceTree = "<group>"; };
+ 35EE48AD0E0C4CB200715C54 /* DeclCXX.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = DeclCXX.h; path = clang/AST/DeclCXX.h; sourceTree = "<group>"; tabWidth = 2; };
+ 35EE48AE0E0C4CB200715C54 /* ParentMap.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = ParentMap.h; path = clang/AST/ParentMap.h; sourceTree = "<group>"; tabWidth = 2; };
+ 35EE48AF0E0C4CCA00715C54 /* DeclCXX.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = DeclCXX.cpp; path = lib/AST/DeclCXX.cpp; sourceTree = "<group>"; tabWidth = 2; };
+ 35EE48B00E0C4CCA00715C54 /* ParentMap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = ParentMap.cpp; path = lib/AST/ParentMap.cpp; sourceTree = "<group>"; tabWidth = 2; };
+ 35EF676F0DAD1D2C00B19414 /* SemaDeclCXX.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = SemaDeclCXX.cpp; path = lib/Sema/SemaDeclCXX.cpp; sourceTree = "<group>"; tabWidth = 2; };
+ 35EFEFB50DB67ED60020783D /* GRTransferFuncs.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = GRTransferFuncs.cpp; path = lib/Analysis/GRTransferFuncs.cpp; sourceTree = "<group>"; };
+ 35F1ACE60E66166C001F4532 /* ConstraintManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ConstraintManager.h; path = clang/Analysis/PathSensitive/ConstraintManager.h; sourceTree = "<group>"; };
+ 35F2A01D0E36AFF100D17527 /* CheckObjCUnusedIVars.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CheckObjCUnusedIVars.cpp; path = lib/Analysis/CheckObjCUnusedIVars.cpp; sourceTree = "<group>"; };
+ 35F2BE7B0DAC2963006E7668 /* HTMLRewrite.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HTMLRewrite.h; path = clang/Rewrite/HTMLRewrite.h; sourceTree = "<group>"; };
+ 35F8D0CA0D9B7E8200D91C5E /* GRSimpleAPICheck.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GRSimpleAPICheck.h; path = clang/Analysis/PathSensitive/GRSimpleAPICheck.h; sourceTree = "<group>"; };
+ 35F8D0CB0D9B7E8200D91C5E /* GRAuditor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GRAuditor.h; path = clang/Analysis/PathSensitive/GRAuditor.h; sourceTree = "<group>"; };
+ 35F8D0D50D9B82CD00D91C5E /* BasicObjCFoundationChecks.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = BasicObjCFoundationChecks.cpp; path = lib/Analysis/BasicObjCFoundationChecks.cpp; sourceTree = "<group>"; };
+ 35F9B1550D1C6B2E00DDFDAE /* LiveVariables.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LiveVariables.h; path = clang/Analysis/Analyses/LiveVariables.h; sourceTree = "<group>"; };
+ 35F9B1560D1C6B2E00DDFDAE /* UninitializedValues.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = UninitializedValues.h; path = clang/Analysis/Analyses/UninitializedValues.h; sourceTree = "<group>"; };
+ 35FE6BCE0DF6EE1F00739712 /* DeclBase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = DeclBase.cpp; path = lib/AST/DeclBase.cpp; sourceTree = "<group>"; tabWidth = 2; };
+ 72D16C1E0D9975C400E6DA4A /* HTMLRewrite.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = HTMLRewrite.cpp; path = lib/Rewrite/HTMLRewrite.cpp; sourceTree = "<group>"; };
+ 84AF36A00CB17A3B00C820A5 /* DeclObjC.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = DeclObjC.h; path = clang/AST/DeclObjC.h; sourceTree = "<group>"; tabWidth = 2; };
+ 84D9A8870C1A57E100AC7ABC /* AttributeList.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = AttributeList.cpp; path = lib/Parse/AttributeList.cpp; sourceTree = "<group>"; tabWidth = 2; };
+ 84D9A88B0C1A581300AC7ABC /* AttributeList.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = AttributeList.h; path = clang/Parse/AttributeList.h; sourceTree = "<group>"; tabWidth = 2; };
+ 8DD76F6C0486A84900D96B5E /* clang */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = clang; sourceTree = BUILT_PRODUCTS_DIR; };
+ 9063F2210F9E8BDF002F7251 /* ExternalSemaSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ExternalSemaSource.h; path = clang/Sema/ExternalSemaSource.h; sourceTree = "<group>"; };
+ 9063F2220F9E8BDF002F7251 /* SemaConsumer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SemaConsumer.h; path = clang/Sema/SemaConsumer.h; sourceTree = "<group>"; };
+ 9063F2280F9E911F002F7251 /* OnDiskHashTable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OnDiskHashTable.h; sourceTree = "<group>"; };
+ 9063F2290F9E911F002F7251 /* SourceManagerInternals.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SourceManagerInternals.h; sourceTree = "<group>"; };
+ 9063F22A0F9E911F002F7251 /* TemplateKinds.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TemplateKinds.h; sourceTree = "<group>"; };
+ 906BF4AE0F83BA16001071FA /* ConvertUTF.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ConvertUTF.h; sourceTree = "<group>"; };
+ 906BF4AF0F83BA2E001071FA /* ConvertUTF.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ConvertUTF.c; sourceTree = "<group>"; };
+ 90FB99DE0F98FB1D008F9415 /* DeclContextInternals.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DeclContextInternals.h; path = clang/AST/DeclContextInternals.h; sourceTree = "<group>"; };
+ 90FB99DF0F98FB1D008F9415 /* DeclVisitor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DeclVisitor.h; path = clang/AST/DeclVisitor.h; sourceTree = "<group>"; };
+ 90FB99E00F98FB1D008F9415 /* ExternalASTSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ExternalASTSource.h; path = clang/AST/ExternalASTSource.h; sourceTree = "<group>"; };
+ BDF87CF60FD746F300BBF872 /* SemaTemplateDeduction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = SemaTemplateDeduction.cpp; path = lib/Sema/SemaTemplateDeduction.cpp; sourceTree = "<group>"; tabWidth = 2; };
+ DE01DA480B12ADA300AC22CE /* PPCallbacks.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = PPCallbacks.h; sourceTree = "<group>"; };
+ DE06756B0C051CFE00EBBFD8 /* ParseExprCXX.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = ParseExprCXX.cpp; path = lib/Parse/ParseExprCXX.cpp; sourceTree = "<group>"; tabWidth = 2; };
+ DE06B73D0A8307640050E87E /* LangOptions.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.c.h; path = LangOptions.h; sourceTree = "<group>"; tabWidth = 2; };
+ DE06BECA0A854E4B0050E87E /* Scope.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = Scope.h; path = clang/Parse/Scope.h; sourceTree = "<group>"; tabWidth = 2; };
+ DE06D42F0A8BB52D0050E87E /* Parser.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = Parser.cpp; path = lib/Parse/Parser.cpp; sourceTree = "<group>"; tabWidth = 2; };
+ DE06E8130A8FF9330050E87E /* Action.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = Action.h; path = clang/Parse/Action.h; sourceTree = "<group>"; tabWidth = 2; usesTabs = 0; };
+ DE0FCA620A95859D00248FD5 /* Expr.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = Expr.h; path = clang/AST/Expr.h; sourceTree = "<group>"; tabWidth = 2; };
+ DE0FCB330A9C21F100248FD5 /* Expr.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = Expr.cpp; path = lib/AST/Expr.cpp; sourceTree = "<group>"; tabWidth = 2; };
+ DE1263C20EF2341900F56D2B /* Ownership.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = Ownership.h; path = clang/Parse/Ownership.h; sourceTree = "<group>"; tabWidth = 2; };
+ DE1732FF0B068B700080B521 /* ASTContext.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = ASTContext.cpp; path = lib/AST/ASTContext.cpp; sourceTree = "<group>"; tabWidth = 2; };
+ DE17336D0B068DC20080B521 /* DeclSpec.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = DeclSpec.cpp; path = lib/Parse/DeclSpec.cpp; sourceTree = "<group>"; tabWidth = 2; };
+ DE17336F0B068DC60080B521 /* DeclSpec.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = DeclSpec.h; path = clang/Parse/DeclSpec.h; sourceTree = "<group>"; tabWidth = 2; };
+ DE1F22020A7D852A00FBF588 /* Parser.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = Parser.h; path = clang/Parse/Parser.h; sourceTree = "<group>"; tabWidth = 2; };
+ DE224FF70C7AA98800D370A5 /* CGExprComplex.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = CGExprComplex.cpp; path = lib/CodeGen/CGExprComplex.cpp; sourceTree = "<group>"; tabWidth = 2; };
+ DE22526F0C7E82D000D370A5 /* CGExprScalar.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = CGExprScalar.cpp; path = lib/CodeGen/CGExprScalar.cpp; sourceTree = "<group>"; tabWidth = 2; };
+ DE2255FB0C8004E600D370A5 /* ParseDeclCXX.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = ParseDeclCXX.cpp; path = lib/Parse/ParseDeclCXX.cpp; sourceTree = "<group>"; tabWidth = 2; };
+ DE22BCF10E14197E0094DC60 /* SemaDeclAttr.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = SemaDeclAttr.cpp; path = lib/Sema/SemaDeclAttr.cpp; sourceTree = "<group>"; tabWidth = 2; };
+ DE344AB70AE5DF6D00DBC861 /* HeaderSearch.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = HeaderSearch.h; sourceTree = "<group>"; };
+ DE344B530AE5E46C00DBC861 /* HeaderSearch.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = HeaderSearch.cpp; sourceTree = "<group>"; };
+ DE3450D60AEB543100DBC861 /* DirectoryLookup.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DirectoryLookup.h; sourceTree = "<group>"; };
+ DE3452400AEF1A2D00DBC861 /* Stmt.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = Stmt.cpp; path = lib/AST/Stmt.cpp; sourceTree = "<group>"; tabWidth = 2; };
+ DE3452800AEF1B1800DBC861 /* Stmt.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = Stmt.h; path = clang/AST/Stmt.h; sourceTree = "<group>"; tabWidth = 2; };
+ DE345C190AFC658B00DBC861 /* StmtVisitor.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = StmtVisitor.h; path = clang/AST/StmtVisitor.h; sourceTree = "<group>"; tabWidth = 2; };
+ DE345F210AFD347900DBC861 /* StmtNodes.def */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = text; name = StmtNodes.def; path = clang/AST/StmtNodes.def; sourceTree = "<group>"; tabWidth = 2; };
+ DE345FFF0AFDCC1900DBC861 /* ParseObjc.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = ParseObjc.cpp; path = lib/Parse/ParseObjc.cpp; sourceTree = "<group>"; tabWidth = 2; };
+ DE3460040AFDCC6500DBC861 /* ParseInit.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = ParseInit.cpp; path = lib/Parse/ParseInit.cpp; sourceTree = "<group>"; tabWidth = 2; };
+ DE34600A0AFDCCBF00DBC861 /* ParseStmt.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = ParseStmt.cpp; path = lib/Parse/ParseStmt.cpp; sourceTree = "<group>"; tabWidth = 2; };
+ DE34600E0AFDCCCE00DBC861 /* ParseDecl.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = ParseDecl.cpp; path = lib/Parse/ParseDecl.cpp; sourceTree = "<group>"; tabWidth = 2; };
+ DE3460120AFDCCDA00DBC861 /* ParseExpr.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = ParseExpr.cpp; path = lib/Parse/ParseExpr.cpp; sourceTree = "<group>"; tabWidth = 2; };
+ DE3461260AFE68BE00DBC861 /* MinimalAction.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = MinimalAction.cpp; path = lib/Parse/MinimalAction.cpp; sourceTree = "<group>"; tabWidth = 2; };
+ DE34621C0AFEB19B00DBC861 /* StmtPrinter.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = StmtPrinter.cpp; path = lib/AST/StmtPrinter.cpp; sourceTree = "<group>"; tabWidth = 2; };
+ DE3464210B03040900DBC861 /* Type.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = Type.h; path = clang/AST/Type.h; sourceTree = "<group>"; tabWidth = 2; };
+ DE37251C0FE4818000CF2CC2 /* Builtins.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Builtins.h; sourceTree = "<group>"; };
+ DE37252A0FE4818F00CF2CC2 /* Builtins.def */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Builtins.def; sourceTree = "<group>"; };
+ DE37252D0FE481AD00CF2CC2 /* Builtins.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Builtins.cpp; sourceTree = "<group>"; };
+ DE3725310FE4822800CF2CC2 /* TargetBuiltins.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TargetBuiltins.h; sourceTree = "<group>"; };
+ DE3725320FE4826C00CF2CC2 /* BuiltinsX86.def */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = BuiltinsX86.def; sourceTree = "<group>"; };
+ DE3725330FE4827200CF2CC2 /* BuiltinsPPC.def */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = BuiltinsPPC.def; sourceTree = "<group>"; };
+ DE38CD4E0D794CF900A273B6 /* CGObjCRuntime.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = CGObjCRuntime.h; path = lib/CodeGen/CGObjCRuntime.h; sourceTree = "<group>"; tabWidth = 2; };
+ DE38CD4F0D794D0100A273B6 /* CGObjCGNU.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = CGObjCGNU.cpp; path = lib/CodeGen/CGObjCGNU.cpp; sourceTree = "<group>"; tabWidth = 2; };
+ DE38CF260D8C9E6C00A273B6 /* DeclObjC.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = DeclObjC.cpp; path = lib/AST/DeclObjC.cpp; sourceTree = "<group>"; tabWidth = 2; };
+ DE3986EF0CB8D4B300223765 /* IdentifierTable.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.c.h; path = IdentifierTable.h; sourceTree = "<group>"; tabWidth = 2; };
+ DE3986F30CB8D50C00223765 /* IdentifierTable.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; path = IdentifierTable.cpp; sourceTree = "<group>"; tabWidth = 2; };
+ DE3B90DE0EAC5EF200D01046 /* ExtensionRAIIObject.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = ExtensionRAIIObject.h; path = lib/Parse/ExtensionRAIIObject.h; sourceTree = "<group>"; tabWidth = 2; };
+ DE3B921C0EB1A81400D01046 /* SemaInherit.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = SemaInherit.h; path = lib/Sema/SemaInherit.h; sourceTree = "<group>"; tabWidth = 2; };
+ DE3B92230EB5152000D01046 /* Designator.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = Designator.h; path = clang/Parse/Designator.h; sourceTree = "<group>"; tabWidth = 2; };
+ DE41211D0D7F1BBE0080F80A /* GRWorkList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GRWorkList.h; path = clang/Analysis/PathSensitive/GRWorkList.h; sourceTree = "<group>"; };
+ DE41211E0D7F1BBE0080F80A /* SymbolManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SymbolManager.h; path = clang/Analysis/PathSensitive/SymbolManager.h; sourceTree = "<group>"; };
+ DE41211F0D7F1BBE0080F80A /* GRBlockCounter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GRBlockCounter.h; path = clang/Analysis/PathSensitive/GRBlockCounter.h; sourceTree = "<group>"; };
+ DE4121200D7F1BBE0080F80A /* ExplodedGraph.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ExplodedGraph.h; path = clang/Analysis/PathSensitive/ExplodedGraph.h; sourceTree = "<group>"; };
+ DE4121210D7F1BBE0080F80A /* GRExprEngine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GRExprEngine.h; path = clang/Analysis/PathSensitive/GRExprEngine.h; sourceTree = "<group>"; };
+ DE4121220D7F1BBE0080F80A /* GRTransferFuncs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GRTransferFuncs.h; path = clang/Analysis/PathSensitive/GRTransferFuncs.h; sourceTree = "<group>"; };
+ DE4121230D7F1BBE0080F80A /* GRCoreEngine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GRCoreEngine.h; path = clang/Analysis/PathSensitive/GRCoreEngine.h; sourceTree = "<group>"; };
+ DE4121270D7F1C1C0080F80A /* SymbolManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SymbolManager.cpp; path = lib/Analysis/SymbolManager.cpp; sourceTree = "<group>"; };
+ DE4121280D7F1C1C0080F80A /* ExplodedGraph.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ExplodedGraph.cpp; path = lib/Analysis/ExplodedGraph.cpp; sourceTree = "<group>"; };
+ DE4121290D7F1C1C0080F80A /* UninitializedValues.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = UninitializedValues.cpp; path = lib/Analysis/UninitializedValues.cpp; sourceTree = "<group>"; };
+ DE41212A0D7F1C1C0080F80A /* GRCoreEngine.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = GRCoreEngine.cpp; path = lib/Analysis/GRCoreEngine.cpp; sourceTree = "<group>"; };
+ DE41212C0D7F1C1C0080F80A /* GRSimpleVals.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GRSimpleVals.h; path = lib/Analysis/GRSimpleVals.h; sourceTree = "<group>"; };
+ DE41212F0D7F1C1C0080F80A /* GRSimpleVals.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = GRSimpleVals.cpp; path = lib/Analysis/GRSimpleVals.cpp; sourceTree = "<group>"; };
+ DE4121300D7F1C1C0080F80A /* GRBlockCounter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = GRBlockCounter.cpp; path = lib/Analysis/GRBlockCounter.cpp; sourceTree = "<group>"; };
+ DE4121310D7F1C1C0080F80A /* GRExprEngine.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = GRExprEngine.cpp; path = lib/Analysis/GRExprEngine.cpp; sourceTree = "<group>"; };
+ DE4264FB0C113592005A861D /* CGDecl.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = CGDecl.cpp; path = lib/CodeGen/CGDecl.cpp; sourceTree = "<group>"; tabWidth = 2; };
+ DE46BF270AE0A82D00CC047C /* TargetInfo.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.c.h; path = TargetInfo.h; sourceTree = "<group>"; tabWidth = 2; };
+ DE4772F90C10EAE5002239E8 /* CGStmt.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = CGStmt.cpp; path = lib/CodeGen/CGStmt.cpp; sourceTree = "<group>"; tabWidth = 2; };
+ DE4772FB0C10EAEC002239E8 /* CGExpr.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = CGExpr.cpp; path = lib/CodeGen/CGExpr.cpp; sourceTree = "<group>"; tabWidth = 2; };
+ DE47999B0D2EBE1A00706D2D /* SemaExprObjC.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = SemaExprObjC.cpp; path = lib/Sema/SemaExprObjC.cpp; sourceTree = "<group>"; tabWidth = 2; };
+ DE4DC7980EA1BE4400069E5A /* TokenRewriter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TokenRewriter.h; path = clang/Rewrite/TokenRewriter.h; sourceTree = "<group>"; };
+ DE4DC7A20EA1C33E00069E5A /* TokenRewriter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TokenRewriter.cpp; path = lib/Rewrite/TokenRewriter.cpp; sourceTree = "<group>"; };
+ DE53370B0CE2D96F00D9A028 /* RewriteRope.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RewriteRope.h; path = clang/Rewrite/RewriteRope.h; sourceTree = "<group>"; };
+ DE613EF30E0E148D00B05B79 /* APValue.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = APValue.h; path = clang/AST/APValue.h; sourceTree = "<group>"; tabWidth = 2; };
+ DE67E70A0C020EC500F66BC5 /* SemaType.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = SemaType.cpp; path = lib/Sema/SemaType.cpp; sourceTree = "<group>"; tabWidth = 2; };
+ DE67E70C0C020ECA00F66BC5 /* SemaStmt.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = SemaStmt.cpp; path = lib/Sema/SemaStmt.cpp; sourceTree = "<group>"; tabWidth = 2; };
+ DE67E70E0C020ECF00F66BC5 /* SemaExprCXX.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = SemaExprCXX.cpp; path = lib/Sema/SemaExprCXX.cpp; sourceTree = "<group>"; tabWidth = 2; };
+ DE67E7100C020ED400F66BC5 /* SemaExpr.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = SemaExpr.cpp; path = lib/Sema/SemaExpr.cpp; sourceTree = "<group>"; tabWidth = 2; };
+ DE67E7120C020ED900F66BC5 /* SemaDecl.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = SemaDecl.cpp; path = lib/Sema/SemaDecl.cpp; sourceTree = "<group>"; tabWidth = 2; usesTabs = 0; };
+ DE67E7140C020EDF00F66BC5 /* Sema.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = Sema.h; path = lib/Sema/Sema.h; sourceTree = "<group>"; tabWidth = 2; };
+ DE67E7160C020EE400F66BC5 /* Sema.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = Sema.cpp; path = lib/Sema/Sema.cpp; sourceTree = "<group>"; tabWidth = 2; };
+ DE67E7190C020F4F00F66BC5 /* ParseAST.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = ParseAST.cpp; path = lib/Sema/ParseAST.cpp; sourceTree = "<group>"; tabWidth = 2; };
+ DE67E7270C02109800F66BC5 /* ParseAST.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = ParseAST.h; path = clang/Sema/ParseAST.h; sourceTree = "<group>"; };
+ DE6951C60C4D1F5D00A5826B /* RecordLayout.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = RecordLayout.h; path = clang/AST/RecordLayout.h; sourceTree = "<group>"; tabWidth = 2; };
+ DE6954630C5121BD00A5826B /* Token.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Token.h; sourceTree = "<group>"; };
+ DE704B250D0FBEBE009C7762 /* SemaDeclObjC.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = SemaDeclObjC.cpp; path = lib/Sema/SemaDeclObjC.cpp; sourceTree = "<group>"; tabWidth = 2; };
+ DE704BD10D1647E7009C7762 /* HeaderMap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HeaderMap.h; sourceTree = "<group>"; };
+ DE704DD10D1668A4009C7762 /* HeaderMap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HeaderMap.cpp; sourceTree = "<group>"; };
+ DE75ED280B044DC90020CF81 /* ASTContext.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = ASTContext.h; path = clang/AST/ASTContext.h; sourceTree = "<group>"; tabWidth = 2; };
+ DE75EDF00B06880E0020CF81 /* Type.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = Type.cpp; path = lib/AST/Type.cpp; sourceTree = "<group>"; tabWidth = 2; };
+ DE85CD800D8380B10070E26E /* TokenLexer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TokenLexer.cpp; sourceTree = "<group>"; };
+ DE85CD840D8380F20070E26E /* TokenLexer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TokenLexer.h; sourceTree = "<group>"; };
+ DE85CD9E0D8382DD0070E26E /* MacroArgs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MacroArgs.h; sourceTree = "<group>"; };
+ DE85CDA20D8383B20070E26E /* MacroArgs.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MacroArgs.cpp; sourceTree = "<group>"; };
+ DE85CDAB0D838C120070E26E /* PPMacroExpansion.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PPMacroExpansion.cpp; sourceTree = "<group>"; };
+ DE85CDAF0D838C390070E26E /* PPDirectives.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PPDirectives.cpp; sourceTree = "<group>"; };
+ DE85CDB50D839BAE0070E26E /* PPLexerChange.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PPLexerChange.cpp; sourceTree = "<group>"; };
+ DE8822350EC80C0A00CBC30A /* CGBuilder.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = CGBuilder.h; path = lib/CodeGen/CGBuilder.h; sourceTree = "<group>"; tabWidth = 2; };
+ DE8823CA0ED0046600CBC30A /* APValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = APValue.cpp; path = lib/AST/APValue.cpp; sourceTree = "<group>"; };
+ DE8823DE0ED0B78600CBC30A /* PTHLexer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PTHLexer.h; sourceTree = "<group>"; };
+ DE8824530ED1243E00CBC30A /* OperatorKinds.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OperatorKinds.h; sourceTree = "<group>"; };
+ DE8824560ED1244600CBC30A /* OperatorKinds.def */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = OperatorKinds.def; sourceTree = "<group>"; };
+ DE928B120C05659200231DA4 /* ModuleBuilder.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = ModuleBuilder.cpp; path = lib/CodeGen/ModuleBuilder.cpp; sourceTree = "<group>"; tabWidth = 2; };
+ DE928B1F0C0565B000231DA4 /* ModuleBuilder.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = ModuleBuilder.h; path = clang/CodeGen/ModuleBuilder.h; sourceTree = "<group>"; };
+ DE928B7C0C0A615100231DA4 /* CodeGenModule.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = CodeGenModule.h; path = lib/CodeGen/CodeGenModule.h; sourceTree = "<group>"; tabWidth = 2; };
+ DE928B7E0C0A615600231DA4 /* CodeGenModule.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = CodeGenModule.cpp; path = lib/CodeGen/CodeGenModule.cpp; sourceTree = "<group>"; tabWidth = 2; };
+ DE928B800C0A615B00231DA4 /* CodeGenFunction.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = CodeGenFunction.h; path = lib/CodeGen/CodeGenFunction.h; sourceTree = "<group>"; tabWidth = 2; usesTabs = 0; };
+ DE928B820C0A616000231DA4 /* CodeGenFunction.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = CodeGenFunction.cpp; path = lib/CodeGen/CodeGenFunction.cpp; sourceTree = "<group>"; tabWidth = 2; };
+ DEA09A6E0F31756F000C2258 /* ASTDiagnostic.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = ASTDiagnostic.h; path = clang/AST/ASTDiagnostic.h; sourceTree = "<group>"; tabWidth = 2; };
+ DEA09A830F3175BF000C2258 /* LexDiagnostic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LexDiagnostic.h; sourceTree = "<group>"; };
+ DEA09A860F3175CA000C2258 /* ParseDiagnostic.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = ParseDiagnostic.h; path = clang/Parse/ParseDiagnostic.h; sourceTree = "<group>"; tabWidth = 2; };
+ DEA09A890F3175D9000C2258 /* SemaDiagnostic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SemaDiagnostic.h; path = clang/Sema/SemaDiagnostic.h; sourceTree = "<group>"; };
+ DEAABDF70F5F477C0098928A /* PrettyStackTrace.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PrettyStackTrace.h; sourceTree = "<group>"; };
+ DEAEE98A0A5A2B970045101B /* MultipleIncludeOpt.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = MultipleIncludeOpt.h; sourceTree = "<group>"; };
+ DEAEED4A0A5AF89A0045101B /* NOTES.txt */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = NOTES.txt; sourceTree = "<group>"; };
+ DEB076C90F3A221200F5A2BE /* DeclTemplate.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = DeclTemplate.h; path = clang/AST/DeclTemplate.h; sourceTree = "<group>"; tabWidth = 2; };
+ DEB076CE0F3A222200F5A2BE /* DeclTemplate.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = DeclTemplate.cpp; path = lib/AST/DeclTemplate.cpp; sourceTree = "<group>"; tabWidth = 2; };
+ DEB077930F44F96000F5A2BE /* TokenConcatenation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TokenConcatenation.h; sourceTree = "<group>"; };
+ DEB077980F44F97800F5A2BE /* TokenConcatenation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TokenConcatenation.cpp; sourceTree = "<group>"; };
+ DEB07AC70F4A427E00F5A2BE /* SemaAttr.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = SemaAttr.cpp; path = lib/Sema/SemaAttr.cpp; sourceTree = "<group>"; tabWidth = 2; };
+ DEB089EE0F12F1D900522C07 /* TypeTraits.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TypeTraits.h; sourceTree = "<group>"; };
+ DEC63B190C7B940200DBF169 /* CFG.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = CFG.cpp; path = lib/AST/CFG.cpp; sourceTree = "<group>"; tabWidth = 2; };
+ DEC63B1B0C7B940600DBF169 /* CFG.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = CFG.h; path = clang/AST/CFG.h; sourceTree = "<group>"; tabWidth = 2; };
+ DEC8D9900A9433CD00353FCA /* Decl.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = Decl.h; path = clang/AST/Decl.h; sourceTree = "<group>"; tabWidth = 2; };
+ DEC8D9A30A94346E00353FCA /* AST.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = AST.h; path = clang/AST/AST.h; sourceTree = "<group>"; tabWidth = 2; };
+ DECAB0CF0DB3C84200E13CCB /* RewriteRope.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RewriteRope.cpp; path = lib/Rewrite/RewriteRope.cpp; sourceTree = "<group>"; };
+ DECB6D640F9AE26600F5FBC7 /* JumpDiagnostics.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = JumpDiagnostics.cpp; path = lib/Sema/JumpDiagnostics.cpp; sourceTree = "<group>"; tabWidth = 2; };
+ DECB6F030F9D939A00F5FBC7 /* InitPreprocessor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = InitPreprocessor.h; path = clang/Frontend/InitPreprocessor.h; sourceTree = "<group>"; };
+ DECB6F060F9D93A800F5FBC7 /* InitPreprocessor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = InitPreprocessor.cpp; path = lib/Frontend/InitPreprocessor.cpp; sourceTree = "<group>"; };
+ DECB734E0FA3ED8400F5FBC7 /* StmtObjC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = StmtObjC.h; path = clang/AST/StmtObjC.h; sourceTree = "<group>"; };
+ DECB73550FA3EE5A00F5FBC7 /* StmtCXX.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = StmtCXX.h; path = clang/AST/StmtCXX.h; sourceTree = "<group>"; };
+ DECB77120FA5752300F5FBC7 /* PCHReaderStmt.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PCHReaderStmt.cpp; path = lib/Frontend/PCHReaderStmt.cpp; sourceTree = "<group>"; };
+ DECB77780FA579B000F5FBC7 /* PCHReaderDecl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PCHReaderDecl.cpp; path = lib/Frontend/PCHReaderDecl.cpp; sourceTree = "<group>"; };
+ DECB77F60FA5850200F5FBC7 /* PCHWriterDecl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PCHWriterDecl.cpp; path = lib/Frontend/PCHWriterDecl.cpp; sourceTree = "<group>"; };
+ DECB78160FA5882F00F5FBC7 /* PCHWriterStmt.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PCHWriterStmt.cpp; path = lib/Frontend/PCHWriterStmt.cpp; sourceTree = "<group>"; };
+ DECB78540FA58F5500F5FBC7 /* AccessSpecifier.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AccessSpecifier.h; path = clang/Parse/AccessSpecifier.h; sourceTree = "<group>"; };
+ DED626C80AE0C065001E80A4 /* TargetInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; path = TargetInfo.cpp; sourceTree = "<group>"; tabWidth = 2; };
+ DED62ABA0AE2EDF1001E80A4 /* Decl.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = Decl.cpp; path = lib/AST/Decl.cpp; sourceTree = "<group>"; tabWidth = 2; usesTabs = 0; };
+ DED7D7310A524295003AD0FB /* Diagnostic.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.c.h; path = Diagnostic.h; sourceTree = "<group>"; tabWidth = 2; };
+ DED7D7330A524295003AD0FB /* FileManager.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.c.h; path = FileManager.h; sourceTree = "<group>"; tabWidth = 2; };
+ DED7D7350A524295003AD0FB /* SourceLocation.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.c.h; path = SourceLocation.h; sourceTree = "<group>"; tabWidth = 2; };
+ DED7D7360A524295003AD0FB /* SourceManager.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.c.h; path = SourceManager.h; sourceTree = "<group>"; tabWidth = 2; };
+ DED7D7370A524295003AD0FB /* TokenKinds.def */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = text; path = TokenKinds.def; sourceTree = "<group>"; tabWidth = 2; };
+ DED7D7380A524295003AD0FB /* TokenKinds.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.c.h; path = TokenKinds.h; sourceTree = "<group>"; tabWidth = 2; };
+ DED7D73B0A524295003AD0FB /* Lexer.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Lexer.h; sourceTree = "<group>"; };
+ DED7D73E0A524295003AD0FB /* MacroInfo.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = MacroInfo.h; sourceTree = "<group>"; };
+ DED7D73F0A524295003AD0FB /* Pragma.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Pragma.h; sourceTree = "<group>"; };
+ DED7D7400A524295003AD0FB /* Preprocessor.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Preprocessor.h; sourceTree = "<group>"; };
+ DED7D75D0A5242C7003AD0FB /* Diagnostic.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; path = Diagnostic.cpp; sourceTree = "<group>"; tabWidth = 2; };
+ DED7D75E0A5242C7003AD0FB /* FileManager.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; path = FileManager.cpp; sourceTree = "<group>"; tabWidth = 2; };
+ DED7D76D0A5242C7003AD0FB /* SourceManager.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; path = SourceManager.cpp; sourceTree = "<group>"; tabWidth = 2; };
+ DED7D76E0A5242C7003AD0FB /* TokenKinds.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; path = TokenKinds.cpp; sourceTree = "<group>"; tabWidth = 2; };
+ DED7D79E0A5242E6003AD0FB /* Lexer.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Lexer.cpp; sourceTree = "<group>"; };
+ DED7D7A00A5242E6003AD0FB /* MacroInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = MacroInfo.cpp; sourceTree = "<group>"; };
+ DED7D7A20A5242E6003AD0FB /* PPExpressions.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = PPExpressions.cpp; sourceTree = "<group>"; };
+ DED7D7A30A5242E6003AD0FB /* Pragma.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Pragma.cpp; sourceTree = "<group>"; };
+ DED7D7A40A5242E6003AD0FB /* Preprocessor.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Preprocessor.cpp; sourceTree = "<group>"; };
+ DED7D7D70A524302003AD0FB /* README.txt */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = README.txt; sourceTree = "<group>"; };
+ DED7D9170A52518C003AD0FB /* ScratchBuffer.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ScratchBuffer.h; sourceTree = "<group>"; };
+ DED7D9E40A5257F6003AD0FB /* ScratchBuffer.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = ScratchBuffer.cpp; sourceTree = "<group>"; };
+ DEDFE5270F63A9230035BD10 /* DeclNodes.def */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = text; name = DeclNodes.def; path = clang/AST/DeclNodes.def; sourceTree = "<group>"; tabWidth = 2; };
+ DEDFE5CB0F7206CC0035BD10 /* NestedNameSpecifier.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NestedNameSpecifier.h; path = clang/AST/NestedNameSpecifier.h; sourceTree = "<group>"; };
+ DEDFE5CE0F7206E40035BD10 /* NestedNameSpecifier.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = NestedNameSpecifier.cpp; path = lib/AST/NestedNameSpecifier.cpp; sourceTree = "<group>"; };
+ DEDFE6450F7B3B4E0035BD10 /* driver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = driver.cpp; path = tools/driver/driver.cpp; sourceTree = "<group>"; };
+ DEDFE6480F7B3B830035BD10 /* Types.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Types.cpp; path = lib/Driver/Types.cpp; sourceTree = "<group>"; };
+ DEDFE6490F7B3B830035BD10 /* Tools.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Tools.h; path = lib/Driver/Tools.h; sourceTree = "<group>"; };
+ DEDFE64A0F7B3B830035BD10 /* Tools.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Tools.cpp; path = lib/Driver/Tools.cpp; sourceTree = "<group>"; };
+ DEDFE64B0F7B3B830035BD10 /* ToolChains.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ToolChains.h; path = lib/Driver/ToolChains.h; sourceTree = "<group>"; };
+ DEDFE64C0F7B3B830035BD10 /* Compilation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Compilation.cpp; path = lib/Driver/Compilation.cpp; sourceTree = "<group>"; };
+ DEDFE64D0F7B3B830035BD10 /* ArgList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ArgList.cpp; path = lib/Driver/ArgList.cpp; sourceTree = "<group>"; };
+ DEDFE64E0F7B3B830035BD10 /* Arg.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Arg.cpp; path = lib/Driver/Arg.cpp; sourceTree = "<group>"; };
+ DEDFE64F0F7B3B830035BD10 /* Action.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Action.cpp; path = lib/Driver/Action.cpp; sourceTree = "<group>"; };
+ DEDFE6500F7B3B830035BD10 /* Phases.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Phases.cpp; path = lib/Driver/Phases.cpp; sourceTree = "<group>"; };
+ DEDFE6510F7B3B830035BD10 /* OptTable.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OptTable.cpp; path = lib/Driver/OptTable.cpp; sourceTree = "<group>"; };
+ DEDFE6520F7B3B830035BD10 /* Option.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Option.cpp; path = lib/Driver/Option.cpp; sourceTree = "<group>"; };
+ DEDFE6530F7B3B830035BD10 /* Job.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Job.cpp; path = lib/Driver/Job.cpp; sourceTree = "<group>"; };
+ DEDFE6540F7B3B830035BD10 /* InputInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = InputInfo.h; path = lib/Driver/InputInfo.h; sourceTree = "<group>"; };
+ DEDFE6550F7B3B830035BD10 /* ToolChains.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ToolChains.cpp; path = lib/Driver/ToolChains.cpp; sourceTree = "<group>"; };
+ DEDFE6560F7B3B830035BD10 /* ToolChain.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ToolChain.cpp; path = lib/Driver/ToolChain.cpp; sourceTree = "<group>"; };
+ DEDFE6570F7B3B830035BD10 /* Tool.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Tool.cpp; path = lib/Driver/Tool.cpp; sourceTree = "<group>"; };
+ DEDFE6580F7B3B830035BD10 /* HostInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = HostInfo.cpp; path = lib/Driver/HostInfo.cpp; sourceTree = "<group>"; };
+ DEDFE6590F7B3B830035BD10 /* Driver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Driver.cpp; path = lib/Driver/Driver.cpp; sourceTree = "<group>"; };
+ DEDFF87F0F848CE30035BD10 /* TemplateName.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TemplateName.h; path = clang/AST/TemplateName.h; sourceTree = "<group>"; };
+ DEDFF8870F848CF80035BD10 /* TemplateName.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TemplateName.cpp; path = lib/AST/TemplateName.cpp; sourceTree = "<group>"; };
+ DEDFFF070F959EE60035BD10 /* Diagnostic.td */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Diagnostic.td; sourceTree = "<group>"; };
+ DEDFFF530F9704580035BD10 /* DiagnosticGroups.td */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DiagnosticGroups.td; sourceTree = "<group>"; };
+ DEEBBD430C19C5D200A9FE82 /* TODO.txt */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = TODO.txt; sourceTree = "<group>"; };
+ DEEBC3B90C2363B800A9FE82 /* CodeGenTypes.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = CodeGenTypes.h; path = lib/CodeGen/CodeGenTypes.h; sourceTree = "<group>"; tabWidth = 2; };
+ DEEBC3BB0C2363BC00A9FE82 /* CodeGenTypes.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = CodeGenTypes.cpp; path = lib/CodeGen/CodeGenTypes.cpp; sourceTree = "<group>"; tabWidth = 2; };
+ DEF1615E0F65C81C0098507F /* InitHeaderSearch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = InitHeaderSearch.h; path = clang/Frontend/InitHeaderSearch.h; sourceTree = "<group>"; };
+ DEF1615F0F65C81C0098507F /* ManagerRegistry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ManagerRegistry.h; path = clang/Frontend/ManagerRegistry.h; sourceTree = "<group>"; };
+ DEF161600F65C81C0098507F /* TextDiagnosticBuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TextDiagnosticBuffer.h; path = clang/Frontend/TextDiagnosticBuffer.h; sourceTree = "<group>"; };
+ DEF161610F65C81C0098507F /* PathDiagnosticClients.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PathDiagnosticClients.h; path = clang/Frontend/PathDiagnosticClients.h; sourceTree = "<group>"; };
+ DEF161620F65C81C0098507F /* CompileOptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CompileOptions.h; path = clang/Frontend/CompileOptions.h; sourceTree = "<group>"; };
+ DEF161630F65C81C0098507F /* TextDiagnosticPrinter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TextDiagnosticPrinter.h; path = clang/Frontend/TextDiagnosticPrinter.h; sourceTree = "<group>"; };
+ DEF165140F8D46980098507F /* Tool.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Tool.h; path = clang/Driver/Tool.h; sourceTree = "<group>"; };
+ DEF165150F8D46980098507F /* Types.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Types.h; path = clang/Driver/Types.h; sourceTree = "<group>"; };
+ DEF165160F8D46980098507F /* Action.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Action.h; path = clang/Driver/Action.h; sourceTree = "<group>"; };
+ DEF165170F8D46980098507F /* Compilation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Compilation.h; path = clang/Driver/Compilation.h; sourceTree = "<group>"; };
+ DEF165180F8D46980098507F /* Options.def */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = Options.def; path = clang/Driver/Options.def; sourceTree = "<group>"; };
+ DEF165190F8D46980098507F /* Option.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Option.h; path = clang/Driver/Option.h; sourceTree = "<group>"; };
+ DEF1651A0F8D46980098507F /* Types.def */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = Types.def; path = clang/Driver/Types.def; sourceTree = "<group>"; };
+ DEF1651B0F8D46980098507F /* ToolChain.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ToolChain.h; path = clang/Driver/ToolChain.h; sourceTree = "<group>"; };
+ DEF1651C0F8D46980098507F /* Options.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Options.h; path = clang/Driver/Options.h; sourceTree = "<group>"; };
+ DEF1651D0F8D46980098507F /* ArgList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ArgList.h; path = clang/Driver/ArgList.h; sourceTree = "<group>"; };
+ DEF1651E0F8D46980098507F /* Arg.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Arg.h; path = clang/Driver/Arg.h; sourceTree = "<group>"; };
+ DEF1651F0F8D46980098507F /* HostInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HostInfo.h; path = clang/Driver/HostInfo.h; sourceTree = "<group>"; };
+ DEF165200F8D46980098507F /* Driver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Driver.h; path = clang/Driver/Driver.h; sourceTree = "<group>"; };
+ DEF165210F8D46980098507F /* Job.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Job.h; path = clang/Driver/Job.h; sourceTree = "<group>"; };
+ DEF165220F8D46980098507F /* Util.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Util.h; path = clang/Driver/Util.h; sourceTree = "<group>"; };
+ DEF165230F8D46980098507F /* Phases.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Phases.h; path = clang/Driver/Phases.h; sourceTree = "<group>"; };
+ DEF165240F8D46980098507F /* DriverDiagnostic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DriverDiagnostic.h; path = clang/Driver/DriverDiagnostic.h; sourceTree = "<group>"; };
+ DEF165700F8FB34D0098507F /* PCHWriter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = PCHWriter.cpp; path = lib/Frontend/PCHWriter.cpp; sourceTree = "<group>"; tabWidth = 2; };
+ DEF165740F8FB3510098507F /* PCHReader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = PCHReader.cpp; path = lib/Frontend/PCHReader.cpp; sourceTree = "<group>"; tabWidth = 2; };
+ DEF165780F8FB3690098507F /* PCHWriter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PCHWriter.h; path = clang/Frontend/PCHWriter.h; sourceTree = "<group>"; };
+ DEF1657B0F8FB36E0098507F /* PCHReader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PCHReader.h; path = clang/Frontend/PCHReader.h; sourceTree = "<group>"; };
+ DEF1657E0F8FB3730098507F /* PCHBitCodes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PCHBitCodes.h; path = clang/Frontend/PCHBitCodes.h; sourceTree = "<group>"; };
+ DEF1683F0F9548DC0098507F /* FixItRewriter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FixItRewriter.cpp; path = lib/Frontend/FixItRewriter.cpp; sourceTree = "<group>"; };
+ DEF168620F9549250098507F /* FixItRewriter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FixItRewriter.h; path = clang/Frontend/FixItRewriter.h; sourceTree = "<group>"; };
+ DEF169220F9645960098507F /* FrontendDiagnostic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FrontendDiagnostic.h; path = clang/Frontend/FrontendDiagnostic.h; sourceTree = "<group>"; };
+ DEF1692C0F9645BF0098507F /* AnalysisDiagnostic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AnalysisDiagnostic.h; path = clang/Analysis/AnalysisDiagnostic.h; sourceTree = "<group>"; };
+ DEF16BE40FA13A5B0098507F /* TypeNodes.def */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = TypeNodes.def; path = clang/AST/TypeNodes.def; sourceTree = "<group>"; };
+ DEF16BE50FA13A650098507F /* TypeOrdering.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TypeOrdering.h; path = clang/AST/TypeOrdering.h; sourceTree = "<group>"; };
+ DEF2E95E0C5FBD74000C4259 /* InternalsManual.html */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.html; name = InternalsManual.html; path = docs/InternalsManual.html; sourceTree = "<group>"; };
+ DEF2EDA60C6A4252000C4259 /* StmtDumper.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = StmtDumper.cpp; path = lib/AST/StmtDumper.cpp; sourceTree = "<group>"; tabWidth = 2; };
+ DEF2EFF20C6CDD74000C4259 /* CGExprAgg.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = CGExprAgg.cpp; path = lib/CodeGen/CGExprAgg.cpp; sourceTree = "<group>"; tabWidth = 2; };
+ DEF2F00F0C6CFED5000C4259 /* SemaChecking.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = SemaChecking.cpp; path = lib/Sema/SemaChecking.cpp; sourceTree = "<group>"; tabWidth = 2; };
+ DEF7D9F60C9C8B1A0001F598 /* Rewriter.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = Rewriter.h; path = clang/Rewrite/Rewriter.h; sourceTree = "<group>"; };
+ DEF7D9F80C9C8B1D0001F598 /* Rewriter.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = Rewriter.cpp; path = lib/Rewrite/Rewriter.cpp; sourceTree = "<group>"; };
+ DEFFECA30DB093D100B4E7C3 /* DeltaTree.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DeltaTree.h; path = clang/Rewrite/DeltaTree.h; sourceTree = "<group>"; };
+ DEFFECA60DB1546600B4E7C3 /* DeltaTree.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DeltaTree.cpp; path = lib/Rewrite/DeltaTree.cpp; sourceTree = "<group>"; };
+/* End PBXFileReference section */
+
+/* Begin PBXFrameworksBuildPhase section */
+ 8DD76F660486A84900D96B5E /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXFrameworksBuildPhase section */
+
+/* Begin PBXGroup section */
+ 08FB7794FE84155DC02AAC07 /* clang */ = {
+ isa = PBXGroup;
+ children = (
+ DED7D72E0A524295003AD0FB /* include */,
+ 08FB7795FE84155DC02AAC07 /* Libraries */,
+ DEDFE61F0F7B3AE10035BD10 /* Tools */,
+ C6859E8C029090F304C91782 /* Documentation */,
+ 1AB674ADFE9D54B511CA2CBB /* Products */,
+ );
+ name = clang;
+ sourceTree = "<group>";
+ };
+ 08FB7795FE84155DC02AAC07 /* Libraries */ = {
+ isa = PBXGroup;
+ children = (
+ DED7D7500A5242C7003AD0FB /* Basic */,
+ DED7D78C0A5242E6003AD0FB /* Lex */,
+ DE1F22600A7D8C9B00FBF588 /* Parse */,
+ DEC8D9920A9433F400353FCA /* AST */,
+ DE67E7070C020EAB00F66BC5 /* Sema */,
+ DE927FCC0C0557CD00231DA4 /* CodeGen */,
+ 356EF9B30C8F7DCA006650F5 /* Analysis */,
+ DEF7D9F50C9C8B0C0001F598 /* Rewrite */,
+ 352246E00F5C6BC000D0D279 /* Frontend */,
+ DEDFE6470F7B3B560035BD10 /* Driver */,
+ );
+ name = Libraries;
+ sourceTree = "<group>";
+ };
+ 1AB674ADFE9D54B511CA2CBB /* Products */ = {
+ isa = PBXGroup;
+ children = (
+ 8DD76F6C0486A84900D96B5E /* clang */,
+ );
+ name = Products;
+ sourceTree = "<group>";
+ };
+ 3507E4C30E27FE3800FB7B57 /* Checks */ = {
+ isa = PBXGroup;
+ children = (
+ 35BAC1E70E82C5B7003FB76F /* CheckNSError.cpp */,
+ 356B89760D9BFDC100CBEBE9 /* BasicObjCFoundationChecks.h */,
+ 35F8D0D50D9B82CD00D91C5E /* BasicObjCFoundationChecks.cpp */,
+ 35862B0C0E3628CB0009F542 /* CheckDeadStores.cpp */,
+ 3595AFB70E1C8D62004CDF09 /* CheckObjCDealloc.cpp */,
+ 3507E4C10E27FE2D00FB7B57 /* CheckObjCInstMethSignature.cpp */,
+ 35F2A01D0E36AFF100D17527 /* CheckObjCUnusedIVars.cpp */,
+ DE4121290D7F1C1C0080F80A /* UninitializedValues.cpp */,
+ );
+ name = Checks;
+ sourceTree = "<group>";
+ };
+ 3507E4C60E27FE5500FB7B57 /* Core */ = {
+ isa = PBXGroup;
+ children = (
+ 35A057E10EAE2D950069249F /* SVals.cpp */,
+ 355106850E9A8507006A4E44 /* MemRegion.cpp */,
+ 35D55B240D81D8C60092E734 /* BasicValueFactory.cpp */,
+ 3536456A0E23EBF7009C6509 /* Environment.cpp */,
+ DE4121280D7F1C1C0080F80A /* ExplodedGraph.cpp */,
+ DE4121300D7F1C1C0080F80A /* GRBlockCounter.cpp */,
+ DE41212A0D7F1C1C0080F80A /* GRCoreEngine.cpp */,
+ DE4121310D7F1C1C0080F80A /* GRExprEngine.cpp */,
+ 35862B110E3629850009F542 /* GRExprEngineInternalChecks.cpp */,
+ 358F51510E529AA4007F2102 /* GRState.cpp */,
+ 35EFEFB50DB67ED60020783D /* GRTransferFuncs.cpp */,
+ DE4121270D7F1C1C0080F80A /* SymbolManager.cpp */,
+ );
+ name = Core;
+ sourceTree = "<group>";
+ };
+ 3507E4C90E27FE9000FB7B57 /* Bug Reporting */ = {
+ isa = PBXGroup;
+ children = (
+ 35A8FCF80D9B4B29001C2F97 /* PathDiagnostic.cpp */,
+ 359379090DA48ABA0043B19C /* BugReporter.cpp */,
+ );
+ name = "Bug Reporting";
+ sourceTree = "<group>";
+ };
+ 3507E4CC0E27FEB900FB7B57 /* Flow-Sensitive Analyses */ = {
+ isa = PBXGroup;
+ children = (
+ 356EF9B40C8F7DDF006650F5 /* LiveVariables.cpp */,
+ );
+ name = "Flow-Sensitive Analyses";
+ sourceTree = "<group>";
+ };
+ 352246E00F5C6BC000D0D279 /* Frontend */ = {
+ isa = PBXGroup;
+ children = (
+ 1A2A54A40FD1DD1C00F4CE45 /* AnalysisConsumer.cpp */,
+ 1A2A54A50FD1DD1C00F4CE45 /* ASTConsumers.cpp */,
+ 1A2A54A60FD1DD1C00F4CE45 /* Backend.cpp */,
+ 1A2A54A70FD1DD1C00F4CE45 /* CacheTokens.cpp */,
+ 1A2A54A80FD1DD1C00F4CE45 /* DependencyFile.cpp */,
+ 1A2A54A90FD1DD1C00F4CE45 /* DiagChecker.cpp */,
+ 1A2A54AA0FD1DD1C00F4CE45 /* DocumentXML.cpp */,
+ DEF1683F0F9548DC0098507F /* FixItRewriter.cpp */,
+ 1A2A54AB0FD1DD1C00F4CE45 /* GeneratePCH.cpp */,
+ 352246E10F5C6BE000D0D279 /* HTMLDiagnostics.cpp */,
+ 1A2A54AC0FD1DD1C00F4CE45 /* HTMLPrint.cpp */,
+ 352246E20F5C6BE000D0D279 /* InitHeaderSearch.cpp */,
+ DECB6F060F9D93A800F5FBC7 /* InitPreprocessor.cpp */,
+ 352246E30F5C6BE000D0D279 /* ManagerRegistry.cpp */,
+ DEF165740F8FB3510098507F /* PCHReader.cpp */,
+ DECB77780FA579B000F5FBC7 /* PCHReaderDecl.cpp */,
+ DECB77120FA5752300F5FBC7 /* PCHReaderStmt.cpp */,
+ DEF165700F8FB34D0098507F /* PCHWriter.cpp */,
+ DECB77F60FA5850200F5FBC7 /* PCHWriterDecl.cpp */,
+ DECB78160FA5882F00F5FBC7 /* PCHWriterStmt.cpp */,
+ 352246E40F5C6BE000D0D279 /* PlistDiagnostics.cpp */,
+ 1A2A54AD0FD1DD1C00F4CE45 /* PrintParserCallbacks.cpp */,
+ 1A2A54AE0FD1DD1C00F4CE45 /* PrintPreprocessedOutput.cpp */,
+ 352246E50F5C6BE000D0D279 /* TextDiagnosticBuffer.cpp */,
+ 352246E60F5C6BE000D0D279 /* TextDiagnosticPrinter.cpp */,
+ 1A2A54AF0FD1DD1C00F4CE45 /* RewriteBlocks.cpp */,
+ 1A2A54B00FD1DD1C00F4CE45 /* RewriteMacros.cpp */,
+ 1A2A54B10FD1DD1C00F4CE45 /* RewriteObjC.cpp */,
+ 1A2A54B20FD1DD1C00F4CE45 /* RewriteTest.cpp */,
+ 1A2A54B30FD1DD1C00F4CE45 /* StmtXML.cpp */,
+ 1A2A54B40FD1DD1C00F4CE45 /* Warnings.cpp */,
+ );
+ name = Frontend;
+ sourceTree = "<group>";
+ };
+ 352C19DB0CA321AC0045DB98 /* Visitors */ = {
+ isa = PBXGroup;
+ children = (
+ 352C19DC0CA321C80045DB98 /* CFGRecStmtDeclVisitor.h */,
+ 352C19DD0CA321C80045DB98 /* CFGRecStmtVisitor.h */,
+ 352C19DE0CA321C80045DB98 /* CFGStmtVisitor.h */,
+ 352C19DF0CA321C80045DB98 /* CFGVarDeclVisitor.h */,
+ );
+ name = Visitors;
+ sourceTree = "<group>";
+ };
+ 35544B820F5C7F6600D92AA9 /* StoreManagers */ = {
+ isa = PBXGroup;
+ children = (
+ 35A057E00EAE2D950069249F /* RegionStore.cpp */,
+ 3558F76C0E267C8300A5B0DF /* BasicStore.cpp */,
+ );
+ name = StoreManagers;
+ sourceTree = "<group>";
+ };
+ 35544B830F5C7F8900D92AA9 /* ConstraintManagers */ = {
+ isa = PBXGroup;
+ children = (
+ 35544B870F5C7FD700D92AA9 /* SimpleConstraintManager.h */,
+ 35544B860F5C7FD700D92AA9 /* SimpleConstraintManager.cpp */,
+ 358CFBB70E65AB04002A8E19 /* BasicConstraintManager.cpp */,
+ 35544B850F5C7FD700D92AA9 /* RangeConstraintManager.cpp */,
+ );
+ name = ConstraintManagers;
+ sourceTree = "<group>";
+ };
+ 35544B840F5C7F9D00D92AA9 /* Path-Sensitive */ = {
+ isa = PBXGroup;
+ children = (
+ 3507E4C60E27FE5500FB7B57 /* Core */,
+ 35544B820F5C7F6600D92AA9 /* StoreManagers */,
+ 35862B130E3629BC0009F542 /* Transfer Function Analyses */,
+ 35544B830F5C7F8900D92AA9 /* ConstraintManagers */,
+ );
+ name = "Path-Sensitive";
+ sourceTree = "<group>";
+ };
+ 356EF9AF0C8F7DA4006650F5 /* Analysis */ = {
+ isa = PBXGroup;
+ children = (
+ DEF1692C0F9645BF0098507F /* AnalysisDiagnostic.h */,
+ 35A8FCF60D9B4ADD001C2F97 /* ProgramPoint.h */,
+ 35A8FCF70D9B4ADD001C2F97 /* PathDiagnostic.h */,
+ 355CF6820C90A8B600A08AA3 /* LocalCheckers.h */,
+ 35F9B1540D1C6AFC00DDFDAE /* Analyses */,
+ 35D1DDCF0CA9C6BE0096E967 /* FlowSensitive */,
+ DE4121130D7F1B980080F80A /* PathSensitive */,
+ 35F9B1520D1C6ACB00DDFDAE /* Support */,
+ 352C19DB0CA321AC0045DB98 /* Visitors */,
+ );
+ name = Analysis;
+ sourceTree = "<group>";
+ };
+ 356EF9B30C8F7DCA006650F5 /* Analysis */ = {
+ isa = PBXGroup;
+ children = (
+ 35544B840F5C7F9D00D92AA9 /* Path-Sensitive */,
+ 3507E4CC0E27FEB900FB7B57 /* Flow-Sensitive Analyses */,
+ 3507E4C30E27FE3800FB7B57 /* Checks */,
+ 3507E4C90E27FE9000FB7B57 /* Bug Reporting */,
+ );
+ name = Analysis;
+ sourceTree = "<group>";
+ };
+ 35862B130E3629BC0009F542 /* Transfer Function Analyses */ = {
+ isa = PBXGroup;
+ children = (
+ 35D55B250D81D8C60092E734 /* CFRefCount.cpp */,
+ DE41212F0D7F1C1C0080F80A /* GRSimpleVals.cpp */,
+ DE41212C0D7F1C1C0080F80A /* GRSimpleVals.h */,
+ );
+ name = "Transfer Function Analyses";
+ sourceTree = "<group>";
+ };
+ 35D1DDCF0CA9C6BE0096E967 /* FlowSensitive */ = {
+ isa = PBXGroup;
+ children = (
+ 35D1DDD10CA9C6D50096E967 /* DataflowSolver.h */,
+ 35D1DDD20CA9C6D50096E967 /* DataflowValues.h */,
+ );
+ name = FlowSensitive;
+ sourceTree = "<group>";
+ };
+ 35F9B1520D1C6ACB00DDFDAE /* Support */ = {
+ isa = PBXGroup;
+ children = (
+ 3537AA0C0ECD088F008F7CDC /* BlkExprDeclBitVector.h */,
+ );
+ name = Support;
+ sourceTree = "<group>";
+ };
+ 35F9B1540D1C6AFC00DDFDAE /* Analyses */ = {
+ isa = PBXGroup;
+ children = (
+ 35F9B1550D1C6B2E00DDFDAE /* LiveVariables.h */,
+ 35F9B1560D1C6B2E00DDFDAE /* UninitializedValues.h */,
+ );
+ name = Analyses;
+ sourceTree = "<group>";
+ };
+ C6859E8C029090F304C91782 /* Documentation */ = {
+ isa = PBXGroup;
+ children = (
+ DEAEED4A0A5AF89A0045101B /* NOTES.txt */,
+ DED7D7D70A524302003AD0FB /* README.txt */,
+ DEEBBD430C19C5D200A9FE82 /* TODO.txt */,
+ DEF2E95E0C5FBD74000C4259 /* InternalsManual.html */,
+ );
+ name = Documentation;
+ sourceTree = "<group>";
+ };
+ DE1F21F20A7D84E800FBF588 /* Parse */ = {
+ isa = PBXGroup;
+ children = (
+ 3551068E0E9A855F006A4E44 /* AccessSpecifier.h */,
+ 84D9A88B0C1A581300AC7ABC /* AttributeList.h */,
+ DE06E8130A8FF9330050E87E /* Action.h */,
+ DE17336F0B068DC60080B521 /* DeclSpec.h */,
+ DE3B92230EB5152000D01046 /* Designator.h */,
+ DE1263C20EF2341900F56D2B /* Ownership.h */,
+ DEA09A860F3175CA000C2258 /* ParseDiagnostic.h */,
+ DE1F22020A7D852A00FBF588 /* Parser.h */,
+ DE06BECA0A854E4B0050E87E /* Scope.h */,
+ );
+ name = Parse;
+ sourceTree = "<group>";
+ };
+ DE1F22600A7D8C9B00FBF588 /* Parse */ = {
+ isa = PBXGroup;
+ children = (
+ 84D9A8870C1A57E100AC7ABC /* AttributeList.cpp */,
+ DE17336D0B068DC20080B521 /* DeclSpec.cpp */,
+ DE3B90DE0EAC5EF200D01046 /* ExtensionRAIIObject.h */,
+ DE3461260AFE68BE00DBC861 /* MinimalAction.cpp */,
+ DE34600E0AFDCCCE00DBC861 /* ParseDecl.cpp */,
+ DE2255FB0C8004E600D370A5 /* ParseDeclCXX.cpp */,
+ DE3460120AFDCCDA00DBC861 /* ParseExpr.cpp */,
+ DE06756B0C051CFE00EBBFD8 /* ParseExprCXX.cpp */,
+ 3534A01C0E129849002709B2 /* ParseCXXInlineMethods.cpp */,
+ DE3460040AFDCC6500DBC861 /* ParseInit.cpp */,
+ DE345FFF0AFDCC1900DBC861 /* ParseObjc.cpp */,
+ 3551068F0E9A857C006A4E44 /* ParsePragma.h */,
+ 3551068A0E9A8546006A4E44 /* ParsePragma.cpp */,
+ DE34600A0AFDCCBF00DBC861 /* ParseStmt.cpp */,
+ 353959D40EE5F88A00E82461 /* ParseTemplate.cpp */,
+ 3551068B0E9A8546006A4E44 /* ParseTentative.cpp */,
+ DE06D42F0A8BB52D0050E87E /* Parser.cpp */,
+ );
+ name = Parse;
+ sourceTree = "<group>";
+ };
+ DE4121130D7F1B980080F80A /* PathSensitive */ = {
+ isa = PBXGroup;
+ children = (
+ 35D55B290D81D8E50092E734 /* BasicValueFactory.h */,
+ 359378FF0DA486490043B19C /* BugReporter.h */,
+ 3536457C0E2406B0009C6509 /* Environment.h */,
+ DE4121200D7F1BBE0080F80A /* ExplodedGraph.h */,
+ 35F1ACE60E66166C001F4532 /* ConstraintManager.h */,
+ 35F8D0CB0D9B7E8200D91C5E /* GRAuditor.h */,
+ DE41211F0D7F1BBE0080F80A /* GRBlockCounter.h */,
+ DE4121230D7F1BBE0080F80A /* GRCoreEngine.h */,
+ DE4121210D7F1BBE0080F80A /* GRExprEngine.h */,
+ 358F514F0E529A87007F2102 /* GRState.h */,
+ 3553EB9A0E5F7089007D7359 /* GRStateTrait.h */,
+ 35F8D0CA0D9B7E8200D91C5E /* GRSimpleAPICheck.h */,
+ DE4121220D7F1BBE0080F80A /* GRTransferFuncs.h */,
+ DE41211D0D7F1BBE0080F80A /* GRWorkList.h */,
+ 355106880E9A851B006A4E44 /* MemRegion.h */,
+ 3558F76F0E267C9A00A5B0DF /* Store.h */,
+ 35A057D20EAE2D2B0069249F /* SVals.h */,
+ DE41211E0D7F1BBE0080F80A /* SymbolManager.h */,
+ );
+ name = PathSensitive;
+ sourceTree = "<group>";
+ };
+ DE67E7070C020EAB00F66BC5 /* Sema */ = {
+ isa = PBXGroup;
+ children = (
+ 35585DBD0EAFBC4500D0A97A /* CXXFieldCollector.h */,
+ 3527124F0DAFE54700C76352 /* IdentifierResolver.h */,
+ 352712500DAFE54700C76352 /* IdentifierResolver.cpp */,
+ DECB6D640F9AE26600F5FBC7 /* JumpDiagnostics.cpp */,
+ DE67E7190C020F4F00F66BC5 /* ParseAST.cpp */,
+ DE67E7140C020EDF00F66BC5 /* Sema.h */,
+ DE67E7160C020EE400F66BC5 /* Sema.cpp */,
+ 1A701B630F7C8FE400FEC4D1 /* SemaAccess.cpp */,
+ DEB07AC70F4A427E00F5A2BE /* SemaAttr.cpp */,
+ DEF2F00F0C6CFED5000C4259 /* SemaChecking.cpp */,
+ 35E194670ECB82FB00F21733 /* SemaCXXScopeSpec.cpp */,
+ DE67E7120C020ED900F66BC5 /* SemaDecl.cpp */,
+ DE22BCF10E14197E0094DC60 /* SemaDeclAttr.cpp */,
+ 35EF676F0DAD1D2C00B19414 /* SemaDeclCXX.cpp */,
+ DE704B250D0FBEBE009C7762 /* SemaDeclObjC.cpp */,
+ DE67E7100C020ED400F66BC5 /* SemaExpr.cpp */,
+ DE67E70E0C020ECF00F66BC5 /* SemaExprCXX.cpp */,
+ DE47999B0D2EBE1A00706D2D /* SemaExprObjC.cpp */,
+ 3557D1EF0EB13BB700C59739 /* SemaInherit.cpp */,
+ DE3B921C0EB1A81400D01046 /* SemaInherit.h */,
+ 3599299A0DE2425300A8A33E /* SemaInit.cpp */,
+ 357EA27C0F2526F300439B60 /* SemaLookup.cpp */,
+ 35E194680ECB82FB00F21733 /* SemaNamedCast.cpp */,
+ 35585DBE0EAFBC4500D0A97A /* SemaOverload.cpp */,
+ 35585DBF0EAFBC4500D0A97A /* SemaOverload.h */,
+ DE67E70C0C020ECA00F66BC5 /* SemaStmt.cpp */,
+ 3591853E0EFB1088000039AF /* SemaTemplate.cpp */,
+ BDF87CF60FD746F300BBF872 /* SemaTemplateDeduction.cpp */,
+ 35544B8B0F5C803200D92AA9 /* SemaTemplateInstantiate.cpp */,
+ 1ADF47AE0F782C3200E48A8A /* SemaTemplateInstantiateDecl.cpp */,
+ 1A410F840FBCE51100351440 /* SemaTemplateInstantiateExpr.cpp */,
+ 1A5119C30FBDF71000A1FF22 /* SemaTemplateInstantiateStmt.cpp */,
+ DE67E70A0C020EC500F66BC5 /* SemaType.cpp */,
+ );
+ name = Sema;
+ sourceTree = "<group>";
+ };
+ DE67E7260C02108300F66BC5 /* Sema */ = {
+ isa = PBXGroup;
+ children = (
+ 9063F2210F9E8BDF002F7251 /* ExternalSemaSource.h */,
+ 9063F2220F9E8BDF002F7251 /* SemaConsumer.h */,
+ DE67E7270C02109800F66BC5 /* ParseAST.h */,
+ DEA09A890F3175D9000C2258 /* SemaDiagnostic.h */,
+ );
+ name = Sema;
+ sourceTree = "<group>";
+ };
+ DE927FCC0C0557CD00231DA4 /* CodeGen */ = {
+ isa = PBXGroup;
+ children = (
+ 1A2193CB0F45EEB700C0713D /* ABIInfo.h */,
+ 1A471AB40F437BC500753CE8 /* CGBlocks.cpp */,
+ 1A649E1D0F9599D9005B965E /* CGBlocks.h */,
+ DE8822350EC80C0A00CBC30A /* CGBuilder.h */,
+ 1ABC36930C7A4BDC006DB0AB /* CGBuiltin.cpp */,
+ 35475B1F0E79973F0000BFE4 /* CGCall.cpp */,
+ 35475B220E7997680000BFE4 /* CGCall.h */,
+ 1A5D5E570E5E81010023C059 /* CGCXX.cpp */,
+ 1A649E1E0F9599DA005B965E /* CGCXX.h */,
+ 1A6FE7080FD6F85800E00CA9 /* CGCXXTemp.cpp */,
+ 35A3E7000DD3874400757F74 /* CGDebugInfo.cpp */,
+ 35A3E7010DD3874400757F74 /* CGDebugInfo.h */,
+ DE4264FB0C113592005A861D /* CGDecl.cpp */,
+ DE4772FB0C10EAEC002239E8 /* CGExpr.cpp */,
+ DEF2EFF20C6CDD74000C4259 /* CGExprAgg.cpp */,
+ DE224FF70C7AA98800D370A5 /* CGExprComplex.cpp */,
+ 1A376A2C0D4AED9B002A1C52 /* CGExprConstant.cpp */,
+ DE22526F0C7E82D000D370A5 /* CGExprScalar.cpp */,
+ 1A7342470C7B57D500122F56 /* CGObjC.cpp */,
+ DE38CD4E0D794CF900A273B6 /* CGObjCRuntime.h */,
+ DE38CD4F0D794D0100A273B6 /* CGObjCGNU.cpp */,
+ 3552E7580E520DD7003A8CA5 /* CGObjCMac.cpp */,
+ DE4772F90C10EAE5002239E8 /* CGStmt.cpp */,
+ 35475B230E7997680000BFE4 /* CGValue.h */,
+ DE928B800C0A615B00231DA4 /* CodeGenFunction.h */,
+ DE928B820C0A616000231DA4 /* CodeGenFunction.cpp */,
+ DE928B7C0C0A615100231DA4 /* CodeGenModule.h */,
+ DE928B7E0C0A615600231DA4 /* CodeGenModule.cpp */,
+ DEEBC3BB0C2363BC00A9FE82 /* CodeGenTypes.cpp */,
+ DEEBC3B90C2363B800A9FE82 /* CodeGenTypes.h */,
+ 1A2193CC0F45EEB700C0713D /* Mangle.cpp */,
+ 1A2193CD0F45EEB700C0713D /* Mangle.h */,
+ DE928B120C05659200231DA4 /* ModuleBuilder.cpp */,
+ );
+ name = CodeGen;
+ sourceTree = "<group>";
+ };
+ DE928B140C05659A00231DA4 /* CodeGen */ = {
+ isa = PBXGroup;
+ children = (
+ DE928B1F0C0565B000231DA4 /* ModuleBuilder.h */,
+ );
+ name = CodeGen;
+ sourceTree = "<group>";
+ };
+ DEC8D98B0A9433BC00353FCA /* AST */ = {
+ isa = PBXGroup;
+ children = (
+ DECB78540FA58F5500F5FBC7 /* AccessSpecifier.h */,
+ DE613EF30E0E148D00B05B79 /* APValue.h */,
+ DEC8D9A30A94346E00353FCA /* AST.h */,
+ 35BFBD2B0C9EDE1E006CB644 /* ASTConsumer.h */,
+ DE75ED280B044DC90020CF81 /* ASTContext.h */,
+ DEA09A6E0F31756F000C2258 /* ASTDiagnostic.h */,
+ 1A72BEAC0D641E9400B085E9 /* Attr.h */,
+ 90FB99DE0F98FB1D008F9415 /* DeclContextInternals.h */,
+ 90FB99DF0F98FB1D008F9415 /* DeclVisitor.h */,
+ 90FB99E00F98FB1D008F9415 /* ExternalASTSource.h */,
+ DEC63B1B0C7B940600DBF169 /* CFG.h */,
+ DEC8D9900A9433CD00353FCA /* Decl.h */,
+ 3538FDB60ED24A2C005EC283 /* DeclarationName.h */,
+ 035611470DA6A45C00D2EF2A /* DeclBase.h */,
+ 84AF36A00CB17A3B00C820A5 /* DeclObjC.h */,
+ 35EE48AD0E0C4CB200715C54 /* DeclCXX.h */,
+ 358D23090E8BEB850003DDCC /* DeclGroup.h */,
+ DEDFE5270F63A9230035BD10 /* DeclNodes.def */,
+ DEB076C90F3A221200F5A2BE /* DeclTemplate.h */,
+ DE0FCA620A95859D00248FD5 /* Expr.h */,
+ 1A30A9E80B93A4C800201A91 /* ExprCXX.h */,
+ 35CEA05A0DF9E82700A41296 /* ExprObjC.h */,
+ DEDFE5CB0F7206CC0035BD10 /* NestedNameSpecifier.h */,
+ 35EE48AE0E0C4CB200715C54 /* ParentMap.h */,
+ 3547129D0C88881300B3E1D5 /* PrettyPrinter.h */,
+ DE6951C60C4D1F5D00A5826B /* RecordLayout.h */,
+ DE3452800AEF1B1800DBC861 /* Stmt.h */,
+ DECB73550FA3EE5A00F5FBC7 /* StmtCXX.h */,
+ DE345F210AFD347900DBC861 /* StmtNodes.def */,
+ DECB734E0FA3ED8400F5FBC7 /* StmtObjC.h */,
+ DE345C190AFC658B00DBC861 /* StmtVisitor.h */,
+ 35847BE30CC7DB9000C40FFF /* StmtIterator.h */,
+ 35CFFE010CA1CBDD00E6F2BE /* StmtGraphTraits.h */,
+ DEDFF87F0F848CE30035BD10 /* TemplateName.h */,
+ DEF16BE40FA13A5B0098507F /* TypeNodes.def */,
+ DEF16BE50FA13A650098507F /* TypeOrdering.h */,
+ DE3464210B03040900DBC861 /* Type.h */,
+ );
+ name = AST;
+ sourceTree = "<group>";
+ };
+ DEC8D9920A9433F400353FCA /* AST */ = {
+ isa = PBXGroup;
+ children = (
+ DE8823CA0ED0046600CBC30A /* APValue.cpp */,
+ 35BB2D7E0D19954000944DB5 /* ASTConsumer.cpp */,
+ DE1732FF0B068B700080B521 /* ASTContext.cpp */,
+ DEC63B190C7B940200DBF169 /* CFG.cpp */,
+ 35FE6BCE0DF6EE1F00739712 /* DeclBase.cpp */,
+ DED62ABA0AE2EDF1001E80A4 /* Decl.cpp */,
+ 3538FDB70ED24A4E005EC283 /* DeclarationName.cpp */,
+ 35EE48AF0E0C4CCA00715C54 /* DeclCXX.cpp */,
+ 358D230A0E8BEB9D0003DDCC /* DeclGroup.cpp */,
+ 1A14D3A60FD78A3F00DA2835 /* DeclPrinter.cpp */,
+ DE38CF260D8C9E6C00A273B6 /* DeclObjC.cpp */,
+ DEB076CE0F3A222200F5A2BE /* DeclTemplate.cpp */,
+ DE0FCB330A9C21F100248FD5 /* Expr.cpp */,
+ 1A32C17E0E1C87AD00A6B483 /* ExprConstant.cpp */,
+ 35260CA40C7F75C000D66CE9 /* ExprCXX.cpp */,
+ 3557D1A80EB136B100C59739 /* InheritViz.cpp */,
+ DEDFE5CE0F7206E40035BD10 /* NestedNameSpecifier.cpp */,
+ 35EE48B00E0C4CCA00715C54 /* ParentMap.cpp */,
+ DE3452400AEF1A2D00DBC861 /* Stmt.cpp */,
+ DEF2EDA60C6A4252000C4259 /* StmtDumper.cpp */,
+ DE34621C0AFEB19B00DBC861 /* StmtPrinter.cpp */,
+ 35847BE40CC7DBAF00C40FFF /* StmtIterator.cpp */,
+ 35CFFDFF0CA1CBCB00E6F2BE /* StmtViz.cpp */,
+ DEDFF8870F848CF80035BD10 /* TemplateName.cpp */,
+ DE75EDF00B06880E0020CF81 /* Type.cpp */,
+ );
+ name = AST;
+ sourceTree = "<group>";
+ };
+ DED7D72E0A524295003AD0FB /* include */ = {
+ isa = PBXGroup;
+ children = (
+ DED7D7300A524295003AD0FB /* Basic */,
+ DED7D7390A524295003AD0FB /* Lex */,
+ DE1F21F20A7D84E800FBF588 /* Parse */,
+ DEC8D98B0A9433BC00353FCA /* AST */,
+ DE67E7260C02108300F66BC5 /* Sema */,
+ DE928B140C05659A00231DA4 /* CodeGen */,
+ 356EF9AF0C8F7DA4006650F5 /* Analysis */,
+ DEF7D9F40C9C8B020001F598 /* Rewrite */,
+ DEF1615D0F65C7FC0098507F /* Frontend */,
+ DEF165020F8D46810098507F /* Driver */,
+ );
+ path = include;
+ sourceTree = "<group>";
+ };
+ 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 */,
+ 1A7019E90F79BC1100FEC4D1 /* DiagnosticAnalysisKinds.td */,
+ 1A7019EA0F79BC1100FEC4D1 /* DiagnosticASTKinds.td */,
+ 1A7019EB0F79BC1100FEC4D1 /* DiagnosticCommonKinds.td */,
+ 1A7019EC0F79BC1100FEC4D1 /* DiagnosticDriverKinds.td */,
+ 1A7019ED0F79BC1100FEC4D1 /* DiagnosticFrontendKinds.td */,
+ DEDFFF530F9704580035BD10 /* DiagnosticGroups.td */,
+ 1A7019EE0F79BC1100FEC4D1 /* DiagnosticLexKinds.td */,
+ 1A7019EF0F79BC1100FEC4D1 /* DiagnosticParseKinds.td */,
+ 1A701A250F79CE1C00FEC4D1 /* DiagnosticSemaKinds.td */,
+ DED7D7330A524295003AD0FB /* FileManager.h */,
+ DE3986EF0CB8D4B300223765 /* IdentifierTable.h */,
+ DE06B73D0A8307640050E87E /* LangOptions.h */,
+ 9063F2280F9E911F002F7251 /* OnDiskHashTable.h */,
+ DE8824560ED1244600CBC30A /* OperatorKinds.def */,
+ DE8824530ED1243E00CBC30A /* OperatorKinds.h */,
+ DEAABDF70F5F477C0098928A /* PrettyStackTrace.h */,
+ DED7D7350A524295003AD0FB /* SourceLocation.h */,
+ DED7D7360A524295003AD0FB /* SourceManager.h */,
+ 9063F2290F9E911F002F7251 /* SourceManagerInternals.h */,
+ DE3725310FE4822800CF2CC2 /* TargetBuiltins.h */,
+ DE46BF270AE0A82D00CC047C /* TargetInfo.h */,
+ 9063F22A0F9E911F002F7251 /* TemplateKinds.h */,
+ DED7D7380A524295003AD0FB /* TokenKinds.h */,
+ DED7D7370A524295003AD0FB /* TokenKinds.def */,
+ DEB089EE0F12F1D900522C07 /* TypeTraits.h */,
+ );
+ name = Basic;
+ path = clang/Basic;
+ sourceTree = "<group>";
+ };
+ DED7D7390A524295003AD0FB /* Lex */ = {
+ isa = PBXGroup;
+ children = (
+ DE3450D60AEB543100DBC861 /* DirectoryLookup.h */,
+ DE704BD10D1647E7009C7762 /* HeaderMap.h */,
+ DE344AB70AE5DF6D00DBC861 /* HeaderSearch.h */,
+ DEA09A830F3175BF000C2258 /* LexDiagnostic.h */,
+ DED7D73B0A524295003AD0FB /* Lexer.h */,
+ 1A869A6E0BA2164C008DA07A /* LiteralSupport.h */,
+ DED7D73E0A524295003AD0FB /* MacroInfo.h */,
+ DEAEE98A0A5A2B970045101B /* MultipleIncludeOpt.h */,
+ DE01DA480B12ADA300AC22CE /* PPCallbacks.h */,
+ DE8823DE0ED0B78600CBC30A /* PTHLexer.h */,
+ 3598EBEB0EDE23EF0070CA16 /* PTHManager.h */,
+ DED7D73F0A524295003AD0FB /* Pragma.h */,
+ DED7D7400A524295003AD0FB /* Preprocessor.h */,
+ 35B820740ECB811A0020BEC0 /* PreprocessorLexer.h */,
+ DED7D9170A52518C003AD0FB /* ScratchBuffer.h */,
+ DE6954630C5121BD00A5826B /* Token.h */,
+ DEB077930F44F96000F5A2BE /* TokenConcatenation.h */,
+ DE85CD840D8380F20070E26E /* TokenLexer.h */,
+ );
+ name = Lex;
+ path = clang/Lex;
+ sourceTree = "<group>";
+ };
+ DED7D7500A5242C7003AD0FB /* Basic */ = {
+ isa = PBXGroup;
+ children = (
+ DE37252D0FE481AD00CF2CC2 /* Builtins.cpp */,
+ 906BF4AF0F83BA2E001071FA /* ConvertUTF.c */,
+ DED7D75D0A5242C7003AD0FB /* Diagnostic.cpp */,
+ DED7D75E0A5242C7003AD0FB /* FileManager.cpp */,
+ DE3986F30CB8D50C00223765 /* IdentifierTable.cpp */,
+ 35707EFD0CD0F5CC000B2204 /* SourceLocation.cpp */,
+ DED7D76D0A5242C7003AD0FB /* SourceManager.cpp */,
+ DED626C80AE0C065001E80A4 /* TargetInfo.cpp */,
+ 03F50AC50D416EAA00B9CF60 /* Targets.cpp */,
+ DED7D76E0A5242C7003AD0FB /* TokenKinds.cpp */,
+ );
+ name = Basic;
+ path = lib/Basic;
+ sourceTree = "<group>";
+ };
+ DED7D78C0A5242E6003AD0FB /* Lex */ = {
+ isa = PBXGroup;
+ children = (
+ DE704DD10D1668A4009C7762 /* HeaderMap.cpp */,
+ DE344B530AE5E46C00DBC861 /* HeaderSearch.cpp */,
+ DED7D79E0A5242E6003AD0FB /* Lexer.cpp */,
+ 1A869AA70BA21ABA008DA07A /* LiteralSupport.cpp */,
+ DE85CD9E0D8382DD0070E26E /* MacroArgs.h */,
+ DE85CDA20D8383B20070E26E /* MacroArgs.cpp */,
+ DED7D7A00A5242E6003AD0FB /* MacroInfo.cpp */,
+ 3552E7540E520D80003A8CA5 /* PPCaching.cpp */,
+ DE85CDAF0D838C390070E26E /* PPDirectives.cpp */,
+ DED7D7A20A5242E6003AD0FB /* PPExpressions.cpp */,
+ DE85CDB50D839BAE0070E26E /* PPLexerChange.cpp */,
+ DE85CDAB0D838C120070E26E /* PPMacroExpansion.cpp */,
+ DED7D7A30A5242E6003AD0FB /* Pragma.cpp */,
+ DED7D7A40A5242E6003AD0FB /* Preprocessor.cpp */,
+ 3537AA0D0ECD08A4008F7CDC /* PreprocessorLexer.cpp */,
+ 35E1946C0ECB83C100F21733 /* PTHLexer.cpp */,
+ DED7D9E40A5257F6003AD0FB /* ScratchBuffer.cpp */,
+ DEB077980F44F97800F5A2BE /* TokenConcatenation.cpp */,
+ DE85CD800D8380B10070E26E /* TokenLexer.cpp */,
+ );
+ name = Lex;
+ path = lib/Lex;
+ sourceTree = "<group>";
+ };
+ DEDFE61F0F7B3AE10035BD10 /* Tools */ = {
+ isa = PBXGroup;
+ children = (
+ DEDFE6200F7B3AE90035BD10 /* clang-cc */,
+ DEDFE6210F7B3AF10035BD10 /* clang */,
+ );
+ name = Tools;
+ sourceTree = "<group>";
+ };
+ DEDFE6200F7B3AE90035BD10 /* clang-cc */ = {
+ isa = PBXGroup;
+ children = (
+ 1AFEF4050F8A6B2300476F2B /* clang-cc.cpp */,
+ );
+ name = "clang-cc";
+ sourceTree = "<group>";
+ };
+ DEDFE6210F7B3AF10035BD10 /* clang */ = {
+ isa = PBXGroup;
+ children = (
+ DEDFE6450F7B3B4E0035BD10 /* driver.cpp */,
+ );
+ name = clang;
+ sourceTree = "<group>";
+ };
+ DEDFE6470F7B3B560035BD10 /* Driver */ = {
+ isa = PBXGroup;
+ children = (
+ DEDFE6480F7B3B830035BD10 /* Types.cpp */,
+ DEDFE6490F7B3B830035BD10 /* Tools.h */,
+ DEDFE64A0F7B3B830035BD10 /* Tools.cpp */,
+ DEDFE64B0F7B3B830035BD10 /* ToolChains.h */,
+ DEDFE64C0F7B3B830035BD10 /* Compilation.cpp */,
+ DEDFE64D0F7B3B830035BD10 /* ArgList.cpp */,
+ DEDFE64E0F7B3B830035BD10 /* Arg.cpp */,
+ DEDFE64F0F7B3B830035BD10 /* Action.cpp */,
+ DEDFE6500F7B3B830035BD10 /* Phases.cpp */,
+ DEDFE6510F7B3B830035BD10 /* OptTable.cpp */,
+ DEDFE6520F7B3B830035BD10 /* Option.cpp */,
+ DEDFE6530F7B3B830035BD10 /* Job.cpp */,
+ DEDFE6540F7B3B830035BD10 /* InputInfo.h */,
+ DEDFE6550F7B3B830035BD10 /* ToolChains.cpp */,
+ DEDFE6560F7B3B830035BD10 /* ToolChain.cpp */,
+ DEDFE6570F7B3B830035BD10 /* Tool.cpp */,
+ DEDFE6580F7B3B830035BD10 /* HostInfo.cpp */,
+ DEDFE6590F7B3B830035BD10 /* Driver.cpp */,
+ );
+ name = Driver;
+ sourceTree = "<group>";
+ };
+ DEF1615D0F65C7FC0098507F /* Frontend */ = {
+ isa = PBXGroup;
+ children = (
+ DEF161620F65C81C0098507F /* CompileOptions.h */,
+ DEF168620F9549250098507F /* FixItRewriter.h */,
+ DEF169220F9645960098507F /* FrontendDiagnostic.h */,
+ DEF1615E0F65C81C0098507F /* InitHeaderSearch.h */,
+ DECB6F030F9D939A00F5FBC7 /* InitPreprocessor.h */,
+ DEF1615F0F65C81C0098507F /* ManagerRegistry.h */,
+ DEF1657E0F8FB3730098507F /* PCHBitCodes.h */,
+ DEF1657B0F8FB36E0098507F /* PCHReader.h */,
+ DEF165780F8FB3690098507F /* PCHWriter.h */,
+ DEF161610F65C81C0098507F /* PathDiagnosticClients.h */,
+ DEF161600F65C81C0098507F /* TextDiagnosticBuffer.h */,
+ DEF161630F65C81C0098507F /* TextDiagnosticPrinter.h */,
+ );
+ name = Frontend;
+ sourceTree = "<group>";
+ };
+ DEF165020F8D46810098507F /* Driver */ = {
+ isa = PBXGroup;
+ children = (
+ DEF165160F8D46980098507F /* Action.h */,
+ DEF1651D0F8D46980098507F /* ArgList.h */,
+ DEF1651E0F8D46980098507F /* Arg.h */,
+ DEF165170F8D46980098507F /* Compilation.h */,
+ DEF165240F8D46980098507F /* DriverDiagnostic.h */,
+ DEF165200F8D46980098507F /* Driver.h */,
+ DEF1651F0F8D46980098507F /* HostInfo.h */,
+ DEF165210F8D46980098507F /* Job.h */,
+ DEF165180F8D46980098507F /* Options.def */,
+ DEF165190F8D46980098507F /* Option.h */,
+ DEF1651C0F8D46980098507F /* Options.h */,
+ DEF165230F8D46980098507F /* Phases.h */,
+ DEF165140F8D46980098507F /* Tool.h */,
+ DEF165150F8D46980098507F /* Types.h */,
+ DEF1651A0F8D46980098507F /* Types.def */,
+ DEF1651B0F8D46980098507F /* ToolChain.h */,
+ DEF165220F8D46980098507F /* Util.h */,
+ );
+ name = Driver;
+ sourceTree = "<group>";
+ };
+ DEF7D9F40C9C8B020001F598 /* Rewrite */ = {
+ isa = PBXGroup;
+ children = (
+ DEFFECA30DB093D100B4E7C3 /* DeltaTree.h */,
+ 35F2BE7B0DAC2963006E7668 /* HTMLRewrite.h */,
+ DEF7D9F60C9C8B1A0001F598 /* Rewriter.h */,
+ DE53370B0CE2D96F00D9A028 /* RewriteRope.h */,
+ DE4DC7980EA1BE4400069E5A /* TokenRewriter.h */,
+ );
+ name = Rewrite;
+ sourceTree = "<group>";
+ };
+ DEF7D9F50C9C8B0C0001F598 /* Rewrite */ = {
+ isa = PBXGroup;
+ children = (
+ DEFFECA60DB1546600B4E7C3 /* DeltaTree.cpp */,
+ 72D16C1E0D9975C400E6DA4A /* HTMLRewrite.cpp */,
+ DEF7D9F80C9C8B1D0001F598 /* Rewriter.cpp */,
+ DECAB0CF0DB3C84200E13CCB /* RewriteRope.cpp */,
+ DE4DC7A20EA1C33E00069E5A /* TokenRewriter.cpp */,
+ );
+ name = Rewrite;
+ sourceTree = "<group>";
+ };
+/* End PBXGroup section */
+
+/* Begin PBXNativeTarget section */
+ 8DD76F620486A84900D96B5E /* clang */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 1DEB923108733DC60010E9CD /* Build configuration list for PBXNativeTarget "clang" */;
+ buildPhases = (
+ 8DD76F640486A84900D96B5E /* Sources */,
+ 8DD76F660486A84900D96B5E /* Frameworks */,
+ 8DD76F690486A84900D96B5E /* CopyFiles */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = clang;
+ productInstallPath = "$(HOME)/bin";
+ productName = clang;
+ productReference = 8DD76F6C0486A84900D96B5E /* clang */;
+ productType = "com.apple.product-type.tool";
+ };
+/* End PBXNativeTarget section */
+
+/* Begin PBXProject section */
+ 08FB7793FE84155DC02AAC07 /* Project object */ = {
+ isa = PBXProject;
+ buildConfigurationList = 1DEB923508733DC60010E9CD /* Build configuration list for PBXProject "clang" */;
+ compatibilityVersion = "Xcode 2.4";
+ hasScannedForEncodings = 1;
+ mainGroup = 08FB7794FE84155DC02AAC07 /* clang */;
+ projectDirPath = "";
+ projectRoot = "";
+ targets = (
+ 8DD76F620486A84900D96B5E /* clang */,
+ );
+ };
+/* End PBXProject section */
+
+/* Begin PBXSourcesBuildPhase section */
+ 8DD76F640486A84900D96B5E /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ DED7D77A0A5242C7003AD0FB /* Diagnostic.cpp in Sources */,
+ DED7D77B0A5242C7003AD0FB /* FileManager.cpp in Sources */,
+ DED7D7890A5242C7003AD0FB /* SourceManager.cpp in Sources */,
+ DED7D78A0A5242C7003AD0FB /* TokenKinds.cpp in Sources */,
+ DED7D7C30A5242E6003AD0FB /* Lexer.cpp in Sources */,
+ DED7D7C50A5242E6003AD0FB /* MacroInfo.cpp in Sources */,
+ DED7D7C70A5242E6003AD0FB /* PPExpressions.cpp in Sources */,
+ DED7D7C80A5242E6003AD0FB /* Pragma.cpp in Sources */,
+ DED7D7C90A5242E6003AD0FB /* Preprocessor.cpp in Sources */,
+ DED7D9E50A5257F6003AD0FB /* ScratchBuffer.cpp in Sources */,
+ DE06D4310A8BB52D0050E87E /* Parser.cpp in Sources */,
+ DE0FCB340A9C21F100248FD5 /* Expr.cpp in Sources */,
+ DED626C90AE0C065001E80A4 /* TargetInfo.cpp in Sources */,
+ DED62ABB0AE2EDF1001E80A4 /* Decl.cpp in Sources */,
+ DE344B540AE5E46C00DBC861 /* HeaderSearch.cpp in Sources */,
+ DE3452410AEF1A2D00DBC861 /* Stmt.cpp in Sources */,
+ DE3460000AFDCC1900DBC861 /* ParseObjc.cpp in Sources */,
+ DE3460050AFDCC6500DBC861 /* ParseInit.cpp in Sources */,
+ DE34600B0AFDCCBF00DBC861 /* ParseStmt.cpp in Sources */,
+ DE34600F0AFDCCCE00DBC861 /* ParseDecl.cpp in Sources */,
+ DE3460130AFDCCDA00DBC861 /* ParseExpr.cpp in Sources */,
+ DE3461270AFE68BE00DBC861 /* MinimalAction.cpp in Sources */,
+ DE34621D0AFEB19B00DBC861 /* StmtPrinter.cpp in Sources */,
+ DE75EDF10B06880E0020CF81 /* Type.cpp in Sources */,
+ DE1733000B068B700080B521 /* ASTContext.cpp in Sources */,
+ DE17336E0B068DC20080B521 /* DeclSpec.cpp in Sources */,
+ 1A869AA80BA21ABA008DA07A /* LiteralSupport.cpp in Sources */,
+ DE67E70B0C020EC500F66BC5 /* SemaType.cpp in Sources */,
+ DE67E70D0C020ECA00F66BC5 /* SemaStmt.cpp in Sources */,
+ DE67E70F0C020ECF00F66BC5 /* SemaExprCXX.cpp in Sources */,
+ DE67E7110C020ED400F66BC5 /* SemaExpr.cpp in Sources */,
+ DE67E7130C020ED900F66BC5 /* SemaDecl.cpp in Sources */,
+ DE67E7170C020EE400F66BC5 /* Sema.cpp in Sources */,
+ DE67E71A0C020F4F00F66BC5 /* ParseAST.cpp in Sources */,
+ DE06756C0C051CFE00EBBFD8 /* ParseExprCXX.cpp in Sources */,
+ DE928B130C05659200231DA4 /* ModuleBuilder.cpp in Sources */,
+ DE928B7F0C0A615600231DA4 /* CodeGenModule.cpp in Sources */,
+ DE928B830C0A616000231DA4 /* CodeGenFunction.cpp in Sources */,
+ DE4772FA0C10EAE5002239E8 /* CGStmt.cpp in Sources */,
+ DE4772FC0C10EAEC002239E8 /* CGExpr.cpp in Sources */,
+ DE4264FC0C113592005A861D /* CGDecl.cpp in Sources */,
+ 84D9A8880C1A57E100AC7ABC /* AttributeList.cpp in Sources */,
+ DEEBC3BC0C2363BC00A9FE82 /* CodeGenTypes.cpp in Sources */,
+ DEF2EDA70C6A4252000C4259 /* StmtDumper.cpp in Sources */,
+ DEF2EFF30C6CDD74000C4259 /* CGExprAgg.cpp in Sources */,
+ DEF2F0100C6CFED5000C4259 /* SemaChecking.cpp in Sources */,
+ 1ABC36940C7A4BDC006DB0AB /* CGBuiltin.cpp in Sources */,
+ DE224FF80C7AA98800D370A5 /* CGExprComplex.cpp in Sources */,
+ 1A7342480C7B57D500122F56 /* CGObjC.cpp in Sources */,
+ DEC63B1A0C7B940200DBF169 /* CFG.cpp in Sources */,
+ DE2252700C7E82D000D370A5 /* CGExprScalar.cpp in Sources */,
+ 35260CA50C7F75C000D66CE9 /* ExprCXX.cpp in Sources */,
+ DE2255FC0C8004E600D370A5 /* ParseDeclCXX.cpp in Sources */,
+ 356EF9B50C8F7DDF006650F5 /* LiveVariables.cpp in Sources */,
+ DEF7D9F90C9C8B1D0001F598 /* Rewriter.cpp in Sources */,
+ 35CFFE000CA1CBCB00E6F2BE /* StmtViz.cpp in Sources */,
+ DE3986F40CB8D50C00223765 /* IdentifierTable.cpp in Sources */,
+ 35847BE50CC7DBAF00C40FFF /* StmtIterator.cpp in Sources */,
+ 35707EFE0CD0F5CC000B2204 /* SourceLocation.cpp in Sources */,
+ DE704B260D0FBEBE009C7762 /* SemaDeclObjC.cpp in Sources */,
+ DE704DD20D1668A4009C7762 /* HeaderMap.cpp in Sources */,
+ 35BB2D7F0D19954000944DB5 /* ASTConsumer.cpp in Sources */,
+ DE47999C0D2EBE1A00706D2D /* SemaExprObjC.cpp in Sources */,
+ 03F50AC60D416EAA00B9CF60 /* Targets.cpp in Sources */,
+ 1A376A2D0D4AED9B002A1C52 /* CGExprConstant.cpp in Sources */,
+ DE38CD500D794D0100A273B6 /* CGObjCGNU.cpp in Sources */,
+ DE4121350D7F1C1C0080F80A /* SymbolManager.cpp in Sources */,
+ DE4121360D7F1C1C0080F80A /* ExplodedGraph.cpp in Sources */,
+ DE4121370D7F1C1C0080F80A /* UninitializedValues.cpp in Sources */,
+ DE4121380D7F1C1C0080F80A /* GRCoreEngine.cpp in Sources */,
+ DE41213C0D7F1C1C0080F80A /* GRSimpleVals.cpp in Sources */,
+ DE41213D0D7F1C1C0080F80A /* GRBlockCounter.cpp in Sources */,
+ DE41213E0D7F1C1C0080F80A /* GRExprEngine.cpp in Sources */,
+ 35D55B270D81D8C60092E734 /* BasicValueFactory.cpp in Sources */,
+ 35D55B280D81D8C60092E734 /* CFRefCount.cpp in Sources */,
+ DE85CD810D8380B10070E26E /* TokenLexer.cpp in Sources */,
+ DE85CDA30D8383B20070E26E /* MacroArgs.cpp in Sources */,
+ DE85CDAC0D838C120070E26E /* PPMacroExpansion.cpp in Sources */,
+ DE85CDB00D838C390070E26E /* PPDirectives.cpp in Sources */,
+ DE85CDB60D839BAE0070E26E /* PPLexerChange.cpp in Sources */,
+ DE38CF270D8C9E6C00A273B6 /* DeclObjC.cpp in Sources */,
+ 72D16C1F0D9975C400E6DA4A /* HTMLRewrite.cpp in Sources */,
+ 35A8FCF90D9B4B2A001C2F97 /* PathDiagnostic.cpp in Sources */,
+ 35F8D0D60D9B82CD00D91C5E /* BasicObjCFoundationChecks.cpp in Sources */,
+ 3593790A0DA48ABA0043B19C /* BugReporter.cpp in Sources */,
+ 35EF67700DAD1D2C00B19414 /* SemaDeclCXX.cpp in Sources */,
+ 352712510DAFE54700C76352 /* IdentifierResolver.cpp in Sources */,
+ DEFFECA70DB1546600B4E7C3 /* DeltaTree.cpp in Sources */,
+ DECAB0D00DB3C84200E13CCB /* RewriteRope.cpp in Sources */,
+ 35EFEFB60DB67ED60020783D /* GRTransferFuncs.cpp in Sources */,
+ 35A3E7020DD3874400757F74 /* CGDebugInfo.cpp in Sources */,
+ 3599299B0DE2425300A8A33E /* SemaInit.cpp in Sources */,
+ 35FE6BCF0DF6EE1F00739712 /* DeclBase.cpp in Sources */,
+ 35EE48B10E0C4CCA00715C54 /* DeclCXX.cpp in Sources */,
+ 35EE48B20E0C4CCA00715C54 /* ParentMap.cpp in Sources */,
+ 3534A01D0E129849002709B2 /* ParseCXXInlineMethods.cpp in Sources */,
+ DE22BCF20E14197E0094DC60 /* SemaDeclAttr.cpp in Sources */,
+ 1A32C17F0E1C87AD00A6B483 /* ExprConstant.cpp in Sources */,
+ 3595AFB80E1C8D62004CDF09 /* CheckObjCDealloc.cpp in Sources */,
+ 3536456B0E23EBF7009C6509 /* Environment.cpp in Sources */,
+ 3558F76D0E267C8300A5B0DF /* BasicStore.cpp in Sources */,
+ 3507E4C20E27FE2D00FB7B57 /* CheckObjCInstMethSignature.cpp in Sources */,
+ 35862B0D0E3628CB0009F542 /* CheckDeadStores.cpp in Sources */,
+ 35862B120E3629850009F542 /* GRExprEngineInternalChecks.cpp in Sources */,
+ 35F2A01E0E36AFF100D17527 /* CheckObjCUnusedIVars.cpp in Sources */,
+ 3552E7550E520D80003A8CA5 /* PPCaching.cpp in Sources */,
+ 3552E7590E520DD7003A8CA5 /* CGObjCMac.cpp in Sources */,
+ 358F51520E529AA4007F2102 /* GRState.cpp in Sources */,
+ 1A5D5E580E5E81010023C059 /* CGCXX.cpp in Sources */,
+ 358CFBB80E65AB04002A8E19 /* BasicConstraintManager.cpp in Sources */,
+ 35475B200E79973F0000BFE4 /* CGCall.cpp in Sources */,
+ 35BAC1E80E82C5B7003FB76F /* CheckNSError.cpp in Sources */,
+ 358D230B0E8BEB9D0003DDCC /* DeclGroup.cpp in Sources */,
+ 355106860E9A8507006A4E44 /* MemRegion.cpp in Sources */,
+ 3551068C0E9A8546006A4E44 /* ParsePragma.cpp in Sources */,
+ 3551068D0E9A8546006A4E44 /* ParseTentative.cpp in Sources */,
+ DE4DC7A30EA1C33E00069E5A /* TokenRewriter.cpp in Sources */,
+ 35A057E20EAE2D950069249F /* RegionStore.cpp in Sources */,
+ 35A057E30EAE2D950069249F /* SVals.cpp in Sources */,
+ 35585DC00EAFBC4500D0A97A /* SemaOverload.cpp in Sources */,
+ 3557D1A90EB136B100C59739 /* InheritViz.cpp in Sources */,
+ 3557D1F00EB13BB700C59739 /* SemaInherit.cpp in Sources */,
+ 35E194690ECB82FB00F21733 /* SemaCXXScopeSpec.cpp in Sources */,
+ 35E1946A0ECB82FB00F21733 /* SemaNamedCast.cpp in Sources */,
+ 35E1946D0ECB83C100F21733 /* PTHLexer.cpp in Sources */,
+ 3537AA0E0ECD08A4008F7CDC /* PreprocessorLexer.cpp in Sources */,
+ DE8823CB0ED0046600CBC30A /* APValue.cpp in Sources */,
+ 3538FDB80ED24A4E005EC283 /* DeclarationName.cpp in Sources */,
+ 353959D50EE5F88A00E82461 /* ParseTemplate.cpp in Sources */,
+ 3591853F0EFB1088000039AF /* SemaTemplate.cpp in Sources */,
+ 357EA27D0F2526F300439B60 /* SemaLookup.cpp in Sources */,
+ DEB076CF0F3A222200F5A2BE /* DeclTemplate.cpp in Sources */,
+ 1A471AB50F437BC500753CE8 /* CGBlocks.cpp in Sources */,
+ DEB077990F44F97800F5A2BE /* TokenConcatenation.cpp in Sources */,
+ 1A2193CE0F45EEB700C0713D /* Mangle.cpp in Sources */,
+ DEB07AC80F4A427E00F5A2BE /* SemaAttr.cpp in Sources */,
+ 352246E70F5C6BE000D0D279 /* HTMLDiagnostics.cpp in Sources */,
+ 352246E80F5C6BE000D0D279 /* InitHeaderSearch.cpp in Sources */,
+ 352246E90F5C6BE000D0D279 /* ManagerRegistry.cpp in Sources */,
+ 352246EA0F5C6BE000D0D279 /* PlistDiagnostics.cpp in Sources */,
+ 352246EB0F5C6BE000D0D279 /* TextDiagnosticBuffer.cpp in Sources */,
+ 352246EC0F5C6BE000D0D279 /* TextDiagnosticPrinter.cpp in Sources */,
+ 35544B880F5C7FD700D92AA9 /* RangeConstraintManager.cpp in Sources */,
+ 35544B890F5C7FD700D92AA9 /* SimpleConstraintManager.cpp in Sources */,
+ 35544B8C0F5C803200D92AA9 /* SemaTemplateInstantiate.cpp in Sources */,
+ DEDFE5CF0F7206E40035BD10 /* NestedNameSpecifier.cpp in Sources */,
+ 1ADF47AF0F782C3200E48A8A /* SemaTemplateInstantiateDecl.cpp in Sources */,
+ DEDFE6460F7B3B4E0035BD10 /* driver.cpp in Sources */,
+ DEDFE65A0F7B3B830035BD10 /* Types.cpp in Sources */,
+ DEDFE65B0F7B3B830035BD10 /* Tools.cpp in Sources */,
+ DEDFE65C0F7B3B830035BD10 /* Compilation.cpp in Sources */,
+ DEDFE65D0F7B3B830035BD10 /* ArgList.cpp in Sources */,
+ DEDFE65E0F7B3B830035BD10 /* Arg.cpp in Sources */,
+ DEDFE65F0F7B3B830035BD10 /* Action.cpp in Sources */,
+ DEDFE6600F7B3B830035BD10 /* Phases.cpp in Sources */,
+ DEDFE6610F7B3B830035BD10 /* OptTable.cpp in Sources */,
+ DEDFE6620F7B3B830035BD10 /* Option.cpp in Sources */,
+ DEDFE6630F7B3B830035BD10 /* Job.cpp in Sources */,
+ DEDFE6640F7B3B830035BD10 /* ToolChains.cpp in Sources */,
+ DEDFE6650F7B3B830035BD10 /* ToolChain.cpp in Sources */,
+ DEDFE6660F7B3B830035BD10 /* Tool.cpp in Sources */,
+ DEDFE6670F7B3B830035BD10 /* HostInfo.cpp in Sources */,
+ DEDFE6680F7B3B830035BD10 /* Driver.cpp in Sources */,
+ 1A701B640F7C8FE400FEC4D1 /* SemaAccess.cpp in Sources */,
+ 906BF4B00F83BA2E001071FA /* ConvertUTF.c in Sources */,
+ DEDFF8880F848CF80035BD10 /* TemplateName.cpp in Sources */,
+ 1AFEF4070F8A6B2300476F2B /* clang-cc.cpp in Sources */,
+ DEF165710F8FB34D0098507F /* PCHWriter.cpp in Sources */,
+ DEF165750F8FB3510098507F /* PCHReader.cpp in Sources */,
+ DEF168400F9548DC0098507F /* FixItRewriter.cpp in Sources */,
+ DECB6D650F9AE26600F5FBC7 /* JumpDiagnostics.cpp in Sources */,
+ DECB6F070F9D93A800F5FBC7 /* InitPreprocessor.cpp in Sources */,
+ DECB77130FA5752300F5FBC7 /* PCHReaderStmt.cpp in Sources */,
+ DECB77790FA579B000F5FBC7 /* PCHReaderDecl.cpp in Sources */,
+ DECB77F70FA5850200F5FBC7 /* PCHWriterDecl.cpp in Sources */,
+ DECB78170FA5882F00F5FBC7 /* PCHWriterStmt.cpp in Sources */,
+ 1A410F850FBCE51100351440 /* SemaTemplateInstantiateExpr.cpp in Sources */,
+ 1A5119C40FBDF71000A1FF22 /* SemaTemplateInstantiateStmt.cpp in Sources */,
+ 1A2A54B50FD1DD1C00F4CE45 /* AnalysisConsumer.cpp in Sources */,
+ 1A2A54B60FD1DD1C00F4CE45 /* ASTConsumers.cpp in Sources */,
+ 1A2A54B70FD1DD1C00F4CE45 /* Backend.cpp in Sources */,
+ 1A2A54B80FD1DD1C00F4CE45 /* CacheTokens.cpp in Sources */,
+ 1A2A54B90FD1DD1C00F4CE45 /* DependencyFile.cpp in Sources */,
+ 1A2A54BA0FD1DD1C00F4CE45 /* DiagChecker.cpp in Sources */,
+ 1A2A54BB0FD1DD1C00F4CE45 /* DocumentXML.cpp in Sources */,
+ 1A2A54BC0FD1DD1C00F4CE45 /* GeneratePCH.cpp in Sources */,
+ 1A2A54BD0FD1DD1C00F4CE45 /* HTMLPrint.cpp in Sources */,
+ 1A2A54BE0FD1DD1C00F4CE45 /* PrintParserCallbacks.cpp in Sources */,
+ 1A2A54BF0FD1DD1C00F4CE45 /* PrintPreprocessedOutput.cpp in Sources */,
+ 1A2A54C00FD1DD1C00F4CE45 /* RewriteBlocks.cpp in Sources */,
+ 1A2A54C10FD1DD1C00F4CE45 /* RewriteMacros.cpp in Sources */,
+ 1A2A54C20FD1DD1C00F4CE45 /* RewriteObjC.cpp in Sources */,
+ 1A2A54C30FD1DD1C00F4CE45 /* RewriteTest.cpp in Sources */,
+ 1A2A54C40FD1DD1C00F4CE45 /* StmtXML.cpp in Sources */,
+ 1A2A54C50FD1DD1C00F4CE45 /* Warnings.cpp in Sources */,
+ 1A6FE7090FD6F85800E00CA9 /* CGCXXTemp.cpp in Sources */,
+ BDF87CF70FD746F300BBF872 /* SemaTemplateDeduction.cpp in Sources */,
+ 1A14D3A70FD78A3F00DA2835 /* DeclPrinter.cpp in Sources */,
+ DE37252E0FE481AD00CF2CC2 /* Builtins.cpp in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXSourcesBuildPhase section */
+
+/* Begin XCBuildConfiguration section */
+ 1DEB923208733DC60010E9CD /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ARCHS = "$(NATIVE_ARCH_ACTUAL)";
+ COPY_PHASE_STRIP = NO;
+ GCC_CW_ASM_SYNTAX = NO;
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_ENABLE_CPP_EXCEPTIONS = NO;
+ GCC_ENABLE_CPP_RTTI = NO;
+ GCC_ENABLE_PASCAL_STRINGS = NO;
+ GCC_ENABLE_SYMBOL_SEPARATION = NO;
+ GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
+ GCC_INLINES_ARE_PRIVATE_EXTERN = NO;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ __STDC_CONSTANT_MACROS,
+ "__STDC_LIMIT_MACROS=1",
+ );
+ GCC_STRICT_ALIASING = YES;
+ GCC_SYMBOLS_PRIVATE_EXTERN = NO;
+ GCC_THREADSAFE_STATICS = NO;
+ GCC_USE_GCC3_PFE_SUPPORT = NO;
+ INSTALL_PATH = "$(HOME)/bin";
+ OTHER_LDFLAGS = (
+ "-lLLVMBitWriter",
+ "-lLLVMBitReader",
+ "-lLLVMAsmPrinter",
+ "-lLLVMSelectionDAG",
+ "-lLLVMCodeGen",
+ "-lLLVMipo",
+ "-lLLVMScalarOpts",
+ "-lLLVMTransformUtils",
+ "-lLLVMipa",
+ "-lLLVMAnalysis",
+ "-lLLVMTarget",
+ "-lLLVMCore",
+ "-lLLVMSupport",
+ "-lLLVMSystem",
+ );
+ PRECOMPS_INCLUDE_HEADERS_FROM_BUILT_PRODUCTS_DIR = NO;
+ PRODUCT_NAME = clang;
+ };
+ name = Debug;
+ };
+ 1DEB923308733DC60010E9CD /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ARCHS = "$(NATIVE_ARCH_ACTUAL)";
+ GCC_CW_ASM_SYNTAX = NO;
+ GCC_ENABLE_CPP_EXCEPTIONS = NO;
+ GCC_ENABLE_CPP_RTTI = NO;
+ GCC_ENABLE_PASCAL_STRINGS = NO;
+ GCC_ENABLE_SYMBOL_SEPARATION = NO;
+ GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
+ GCC_INLINES_ARE_PRIVATE_EXTERN = NO;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ __STDC_CONSTANT_MACROS,
+ "__STDC_LIMIT_MACROS=1",
+ );
+ GCC_STRICT_ALIASING = YES;
+ GCC_SYMBOLS_PRIVATE_EXTERN = NO;
+ GCC_THREADSAFE_STATICS = NO;
+ GCC_USE_GCC3_PFE_SUPPORT = NO;
+ INSTALL_PATH = "$(HOME)/bin";
+ OTHER_LDFLAGS = (
+ "-lLLVMBitWriter",
+ "-lLLVMBitReader",
+ "-lLLVMAsmPrinter",
+ "-lLLVMSelectionDAG",
+ "-lLLVMCodeGen",
+ "-lLLVMipo",
+ "-lLLVMScalarOpts",
+ "-lLLVMTransformUtils",
+ "-lLLVMipa",
+ "-lLLVMAnalysis",
+ "-lLLVMTarget",
+ "-lLLVMCore",
+ "-lLLVMSupport",
+ "-lLLVMSystem",
+ );
+ PRECOMPS_INCLUDE_HEADERS_FROM_BUILT_PRODUCTS_DIR = NO;
+ PRODUCT_NAME = clang;
+ };
+ name = Release;
+ };
+ 1DEB923608733DC60010E9CD /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ GCC_VERSION = "";
+ GCC_WARN_ABOUT_RETURN_TYPE = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ HEADER_SEARCH_PATHS = (
+ ../../include,
+ include,
+ );
+ LIBRARY_SEARCH_PATHS = ../../Debug/lib;
+ OTHER_LDFLAGS = "";
+ PREBINDING = NO;
+ };
+ name = Debug;
+ };
+ 1DEB923708733DC60010E9CD /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ GCC_WARN_ABOUT_RETURN_TYPE = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ HEADER_SEARCH_PATHS = (
+ ../../include,
+ include,
+ );
+ LIBRARY_SEARCH_PATHS = ../../Release;
+ OTHER_LDFLAGS = "";
+ PREBINDING = NO;
+ };
+ name = Release;
+ };
+/* End XCBuildConfiguration section */
+
+/* Begin XCConfigurationList section */
+ 1DEB923108733DC60010E9CD /* Build configuration list for PBXNativeTarget "clang" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 1DEB923208733DC60010E9CD /* Debug */,
+ 1DEB923308733DC60010E9CD /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ 1DEB923508733DC60010E9CD /* Build configuration list for PBXProject "clang" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 1DEB923608733DC60010E9CD /* Debug */,
+ 1DEB923708733DC60010E9CD /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+/* End XCConfigurationList section */
+ };
+ rootObject = 08FB7793FE84155DC02AAC07 /* Project object */;
+}
diff --git a/include/clang/AST/ASTContext.h b/include/clang/AST/ASTContext.h
index b686b0edd30a..aa01b7fdf06f 100644
--- a/include/clang/AST/ASTContext.h
+++ b/include/clang/AST/ASTContext.h
@@ -192,6 +192,7 @@ public:
QualType VoidPtrTy, NullPtrTy;
QualType OverloadTy;
QualType DependentTy;
+ QualType UndeducedAutoTy;
ASTContext(const LangOptions& LOpts, SourceManager &SM, TargetInfo &t,
IdentifierTable &idents, SelectorTable &sels,
@@ -360,6 +361,9 @@ public:
QualType getTypeOfExprType(Expr *e);
QualType getTypeOfType(QualType t);
+ /// getDecltypeType - C++0x decltype.
+ QualType getDecltypeType(Expr *e);
+
/// getTagDeclType - Return the unique reference to the type for the
/// specified TagDecl (struct/union/class/enum) decl.
QualType getTagDeclType(TagDecl *Decl);
diff --git a/include/clang/AST/Attr.h b/include/clang/AST/Attr.h
index a5b7ad4ca382..7d3009b01129 100644
--- a/include/clang/AST/Attr.h
+++ b/include/clang/AST/Attr.h
@@ -72,6 +72,7 @@ public:
Packed,
Pure,
Regparm,
+ ReqdWorkGroupSize, // OpenCL-specific
Section,
Sentinel,
StdCall,
@@ -501,6 +502,27 @@ public:
static bool classof(const RegparmAttr *A) { return true; }
};
+class ReqdWorkGroupSizeAttr : public Attr {
+ unsigned X, Y, Z;
+public:
+ ReqdWorkGroupSizeAttr(unsigned X, unsigned Y, unsigned Z)
+ : Attr(ReqdWorkGroupSize), X(X), Y(Y), Z(Z) {}
+
+ unsigned getXDim() const { return X; }
+ unsigned getYDim() const { return Y; }
+ unsigned getZDim() const { return Z; }
+
+ virtual Attr *clone(ASTContext &C) const {
+ return ::new (C) ReqdWorkGroupSizeAttr(X, Y, Z);
+ }
+
+ // Implement isa/cast/dyncast/etc.
+ static bool classof(const Attr *A) {
+ return A->getKind() == ReqdWorkGroupSize;
+ }
+ static bool classof(const ReqdWorkGroupSizeAttr *A) { return true; }
+};
+
// Checker-specific attributes.
DEF_SIMPLE_ATTR(CFReturnsRetained);
DEF_SIMPLE_ATTR(NSReturnsRetained);
diff --git a/include/clang/AST/Decl.h b/include/clang/AST/Decl.h
index f594db27bc8f..3de01f3baeb5 100644
--- a/include/clang/AST/Decl.h
+++ b/include/clang/AST/Decl.h
@@ -25,7 +25,8 @@ class FunctionTemplateDecl;
class Stmt;
class CompoundStmt;
class StringLiteral;
-
+class TemplateArgumentList;
+
/// TranslationUnitDecl - The top declaration context.
class TranslationUnitDecl : public Decl, public DeclContext {
TranslationUnitDecl()
@@ -105,6 +106,13 @@ public:
/// \brief Determine whether this declaration has linkage.
bool hasLinkage() const;
+ /// \brief Looks through UsingDecls and ObjCCompatibleAliasDecls for
+ /// the underlying named decl.
+ NamedDecl *getUnderlyingDecl();
+ const NamedDecl *getUnderlyingDecl() const {
+ return const_cast<NamedDecl*>(this)->getUnderlyingDecl();
+ }
+
static bool classof(const Decl *D) {
return D->getKind() >= NamedFirst && D->getKind() <= NamedLast;
}
@@ -614,10 +622,17 @@ public:
None, Extern, Static, PrivateExtern
};
private:
+ /// \brief Provides information about a function template specialization,
+ /// which is a FunctionDecl that has been explicitly specialization or
+ /// instantiated from a function template.
+ struct TemplateSpecializationInfo {
+ FunctionTemplateDecl *Template;
+ const TemplateArgumentList *TemplateArguments;
+ };
+
/// ParamInfo - new[]'d array of pointers to VarDecls for the formal
/// parameters of this function. This is null if a prototype or if there are
- /// no formals. TODO: we could allocate this space immediately after the
- /// FunctionDecl object to save an allocation like FunctionType does.
+ /// no formals.
ParmVarDecl **ParamInfo;
LazyDeclStmtPtr Body;
@@ -664,8 +679,12 @@ private:
/// pointer to a FunctionTemplateDecl. For member functions
/// of class template specializations, this will be the
/// FunctionDecl from which the member function was instantiated.
- llvm::PointerUnion<FunctionTemplateDecl*, FunctionDecl*>
- TemplateOrInstantiation;
+ /// For function template specializations, this will be a
+ /// FunctionTemplateSpecializationInfo, which contains information about
+ /// the template being specialized and the template arguments involved in
+ /// that specialization.
+ llvm::PointerUnion3<FunctionTemplateDecl*, FunctionDecl*,
+ TemplateSpecializationInfo*> TemplateOrSpecialization;
protected:
FunctionDecl(Kind DK, DeclContext *DC, SourceLocation L,
@@ -678,7 +697,7 @@ protected:
SClass(S), IsInline(isInline), C99InlineDefinition(false),
IsVirtualAsWritten(false), IsPure(false), HasInheritedPrototype(false),
HasWrittenPrototype(true), IsDeleted(false), TypeSpecStartLoc(TSSL),
- EndRangeLoc(L), TemplateOrInstantiation() {}
+ EndRangeLoc(L), TemplateOrSpecialization() {}
virtual ~FunctionDecl() {}
virtual void Destroy(ASTContext& C);
@@ -887,13 +906,13 @@ public:
/// X<int>::A is required, it will be instantiated from the
/// declaration returned by getInstantiatedFromMemberFunction().
FunctionDecl *getInstantiatedFromMemberFunction() const {
- return TemplateOrInstantiation.dyn_cast<FunctionDecl*>();
+ return TemplateOrSpecialization.dyn_cast<FunctionDecl*>();
}
/// \brief Specify that this record is an instantiation of the
/// member function RD.
void setInstantiationOfMemberFunction(FunctionDecl *RD) {
- TemplateOrInstantiation = RD;
+ TemplateOrSpecialization = RD;
}
/// \brief Retrieves the function template that is described by this
@@ -909,13 +928,54 @@ public:
/// getDescribedFunctionTemplate() retrieves the
/// FunctionTemplateDecl from a FunctionDecl.
FunctionTemplateDecl *getDescribedFunctionTemplate() const {
- return TemplateOrInstantiation.dyn_cast<FunctionTemplateDecl*>();
+ return TemplateOrSpecialization.dyn_cast<FunctionTemplateDecl*>();
}
void setDescribedFunctionTemplate(FunctionTemplateDecl *Template) {
- TemplateOrInstantiation = Template;
+ TemplateOrSpecialization = Template;
}
+ /// \brief Retrieve the primary template that this function template
+ /// specialization either specializes or was instantiated from.
+ ///
+ /// If this function declaration is not a function template specialization,
+ /// returns NULL.
+ FunctionTemplateDecl *getPrimaryTemplate() const {
+ if (TemplateSpecializationInfo *Info
+ = TemplateOrSpecialization.dyn_cast<TemplateSpecializationInfo*>()) {
+ return Info->Template;
+ }
+ return 0;
+ }
+
+ /// \brief Retrieve the template arguments used to produce this function
+ /// template specialization from the primary template.
+ ///
+ /// If this function declaration is not a function template specialization,
+ /// returns NULL.
+ const TemplateArgumentList *getTemplateSpecializationArgs() const {
+ if (TemplateSpecializationInfo *Info
+ = TemplateOrSpecialization.dyn_cast<TemplateSpecializationInfo*>()) {
+ return Info->TemplateArguments;
+ }
+ return 0;
+ }
+
+
+ /// \brief Specify that this function declaration is actually a function
+ /// template specialization.
+ ///
+ /// \param Context the AST context in which this function resides.
+ ///
+ /// \param Template the function template that this function template
+ /// specialization specializes.
+ ///
+ /// \param TemplateArgs the template arguments that produced this
+ /// function template specialization from the template.
+ void setFunctionTemplateSpecialization(ASTContext &Context,
+ FunctionTemplateDecl *Template,
+ const TemplateArgumentList *TemplateArgs);
+
// Implement isa/cast/dyncast/etc.
static bool classof(const Decl *D) {
return D->getKind() >= FunctionFirst && D->getKind() <= FunctionLast;
diff --git a/include/clang/AST/DeclBase.h b/include/clang/AST/DeclBase.h
index a75eecd02220..c959b05473fe 100644
--- a/include/clang/AST/DeclBase.h
+++ b/include/clang/AST/DeclBase.h
@@ -329,6 +329,9 @@ public:
/// template parameter pack.
bool isTemplateParameterPack() const;
+ /// \brief Whether this declaration is a function or function template.
+ bool isFunctionOrFunctionTemplate() const;
+
// Implement isa/cast/dyncast/etc.
static bool classof(const Decl *) { return true; }
static DeclContext *castToDeclContext(const Decl *);
diff --git a/include/clang/AST/DeclCXX.h b/include/clang/AST/DeclCXX.h
index 52ed0ec8535e..a2fe24e83105 100644
--- a/include/clang/AST/DeclCXX.h
+++ b/include/clang/AST/DeclCXX.h
@@ -27,6 +27,40 @@ class CXXConversionDecl;
class CXXMethodDecl;
class ClassTemplateSpecializationDecl;
+/// \brief Represents any kind of function declaration, whether it is a
+/// concrete function or a function template.
+class AnyFunctionDecl {
+ NamedDecl *Function;
+
+public:
+ AnyFunctionDecl(FunctionDecl *FD) : Function(FD) { }
+ AnyFunctionDecl(FunctionTemplateDecl *FTD);
+
+ /// \brief Implicily converts any function or function template into a
+ /// named declaration.
+ operator NamedDecl *() const { return Function; }
+
+ /// \brief Retrieve the underlying function or function template.
+ NamedDecl *get() const { return Function; }
+};
+
+} // end namespace clang
+
+namespace llvm {
+ /// Implement simplify_type for AnyFunctionDecl, so that we can dyn_cast from
+ /// AnyFunctionDecl to any function or function template declaration.
+ template<> struct simplify_type<const ::clang::AnyFunctionDecl> {
+ typedef ::clang::NamedDecl* SimpleType;
+ static SimpleType getSimplifiedValue(const ::clang::AnyFunctionDecl &Val) {
+ return Val;
+ }
+ };
+ template<> struct simplify_type< ::clang::AnyFunctionDecl>
+ : public simplify_type<const ::clang::AnyFunctionDecl> {};
+} // end namespace llvm
+
+namespace clang {
+
/// OverloadedFunctionDecl - An instance of this class represents a
/// set of overloaded functions. All of the functions have the same
/// name and occur within the same scope.
@@ -43,15 +77,15 @@ protected:
/// Functions - the set of overloaded functions contained in this
/// overload set.
- llvm::SmallVector<FunctionDecl *, 4> Functions;
+ llvm::SmallVector<AnyFunctionDecl, 4> Functions;
// FIXME: This should go away when we stop using
// OverloadedFunctionDecl to store conversions in CXXRecordDecl.
friend class CXXRecordDecl;
public:
- typedef llvm::SmallVector<FunctionDecl *, 4>::iterator function_iterator;
- typedef llvm::SmallVector<FunctionDecl *, 4>::const_iterator
+ typedef llvm::SmallVector<AnyFunctionDecl, 4>::iterator function_iterator;
+ typedef llvm::SmallVector<AnyFunctionDecl, 4>::const_iterator
function_const_iterator;
static OverloadedFunctionDecl *Create(ASTContext &C, DeclContext *DC,
@@ -71,30 +105,18 @@ public:
this->setLocation(FD->getLocation());
}
+ /// addOverload - Add an overloaded function template FTD to this set of
+ /// overloaded functions.
+ void addOverload(FunctionTemplateDecl *FTD);
+
function_iterator function_begin() { return Functions.begin(); }
function_iterator function_end() { return Functions.end(); }
function_const_iterator function_begin() const { return Functions.begin(); }
function_const_iterator function_end() const { return Functions.end(); }
- /// getNumFunctions - the number of overloaded functions stored in
+ /// \brief Returns the number of overloaded functions stored in
/// this set.
- unsigned getNumFunctions() const { return Functions.size(); }
-
- /// getFunction - retrieve the ith function in the overload set.
- const FunctionDecl *getFunction(unsigned i) const {
- assert(i < getNumFunctions() && "Illegal function #");
- return Functions[i];
- }
- FunctionDecl *getFunction(unsigned i) {
- assert(i < getNumFunctions() && "Illegal function #");
- return Functions[i];
- }
-
- // getDeclContext - Get the context of these overloaded functions.
- DeclContext *getDeclContext() {
- assert(getNumFunctions() > 0 && "Context of an empty overload set");
- return getFunction(0)->getDeclContext();
- }
+ unsigned size() const { return Functions.size(); }
// Implement isa/cast/dyncast/etc.
static bool classof(const Decl *D) {
@@ -449,6 +471,15 @@ public:
/// getDestructor - Returns the destructor decl for this class.
const CXXDestructorDecl *getDestructor(ASTContext &Context);
+ /// isLocalClass - If the class is a local class [class.local], returns
+ /// the enclosing function declaration.
+ const FunctionDecl *isLocalClass() const {
+ if (const CXXRecordDecl *RD = dyn_cast<CXXRecordDecl>(getDeclContext()))
+ return RD->isLocalClass();
+
+ return dyn_cast<FunctionDecl>(getDeclContext());
+ }
+
/// viewInheritance - Renders and displays an inheritance diagram
/// for this C++ class and all of its base classes (transitively) using
/// GraphViz.
@@ -1070,17 +1101,25 @@ class UsingDecl : public NamedDecl {
public:
/// \brief Returns the source range that covers the nested-name-specifier
/// preceding the namespace name.
- SourceRange getNestedNameRange() { return(NestedNameRange); }
+ SourceRange getNestedNameRange() { return NestedNameRange; }
+
/// \brief Returns the source location of the target declaration name.
- SourceLocation getTargetNameLocation() { return(TargetNameLocation); }
+ SourceLocation getTargetNameLocation() { return TargetNameLocation; }
+
/// \brief Returns the source location of the "using" location itself.
- SourceLocation getUsingLocation() { return(UsingLocation); }
+ SourceLocation getUsingLocation() { return UsingLocation; }
+
/// \brief getTargetDecl - Returns target specified by using-decl.
- NamedDecl *getTargetDecl() { return(TargetDecl); }
+ NamedDecl *getTargetDecl() { return TargetDecl; }
+ const NamedDecl *getTargetDecl() const { return TargetDecl; }
+
/// \brief Get target nested name declaration.
- NestedNameSpecifier* getTargetNestedNameDecl() { return(TargetNestedNameDecl); }
+ NestedNameSpecifier* getTargetNestedNameDecl() {
+ return TargetNestedNameDecl;
+ }
+
/// isTypeName - Return true if using decl had 'typename'.
- bool isTypeName() const { return(IsTypeName); }
+ bool isTypeName() const { return IsTypeName; }
static UsingDecl *Create(ASTContext &C, DeclContext *DC,
SourceLocation L, SourceRange NNR, SourceLocation TargetNL,
diff --git a/include/clang/AST/DeclTemplate.h b/include/clang/AST/DeclTemplate.h
index 2608dd9d3157..aad19a63ef0f 100644
--- a/include/clang/AST/DeclTemplate.h
+++ b/include/clang/AST/DeclTemplate.h
@@ -153,7 +153,7 @@ protected:
NamedDecl *TemplatedDecl;
TemplateParameterList* TemplateParams;
};
-
+
/// Declaration of a template function.
class FunctionTemplateDecl : public TemplateDecl {
protected:
@@ -580,6 +580,30 @@ public:
return reinterpret_cast<Expr *>(TypeOrValue);
}
+ /// \brief Iterator that traverses the elements of a template argument pack.
+ typedef const TemplateArgument * pack_iterator;
+
+ /// \brief Iterator referencing the first argument of a template argument
+ /// pack.
+ pack_iterator pack_begin() const {
+ assert(Kind == Pack);
+ return Args.Args;
+ }
+
+ /// \brief Iterator referencing one past the last argument of a template
+ /// argument pack.
+ pack_iterator pack_end() const {
+ assert(Kind == Pack);
+ return Args.Args + Args.NumArgs;
+ }
+
+ /// \brief The number of template arguments in the given template argument
+ /// pack.
+ unsigned pack_size() const {
+ assert(Kind == Pack);
+ return Args.NumArgs;
+ }
+
/// \brief Retrieve the location where the template argument starts.
SourceLocation getLocation() const { return StartLoc; }
@@ -957,6 +981,10 @@ public:
virtual void Destroy(ASTContext& C);
};
+/// Implementation of inline functions that require the template declarations
+inline AnyFunctionDecl::AnyFunctionDecl(FunctionTemplateDecl *FTD)
+ : Function(FTD) { }
+
} /* end of namespace clang */
#endif
diff --git a/include/clang/AST/Type.h b/include/clang/AST/Type.h
index ca55ea670b24..321b1f204fcf 100644
--- a/include/clang/AST/Type.h
+++ b/include/clang/AST/Type.h
@@ -572,7 +572,10 @@ public:
NullPtr, // This is the type of C++0x 'nullptr'.
Overload, // This represents the type of an overloaded function declaration.
- Dependent // This represents the type of a type-dependent expression.
+ Dependent, // This represents the type of a type-dependent expression.
+
+ UndeducedAuto // In C++0x, this represents the type of an auto variable
+ // that has not been deduced yet.
};
private:
Kind TypeKind;
@@ -1103,11 +1106,17 @@ public:
case '7': return 7;
case '8': return 8;
case '9': return 9;
+ case 'A':
case 'a': return 10;
+ case 'B':
case 'b': return 11;
+ case 'C':
case 'c': return 12;
+ case 'D':
case 'd': return 13;
+ case 'E':
case 'e': return 14;
+ case 'F':
case 'f': return 15;
}
}
@@ -1358,6 +1367,21 @@ public:
static bool classof(const TypeOfType *) { return true; }
};
+/// DecltypeType (C++0x)
+class DecltypeType : public Type {
+ Expr *E;
+ DecltypeType(Expr *E, QualType can);
+ friend class ASTContext; // ASTContext creates these.
+public:
+ Expr *getUnderlyingExpr() const { return E; }
+
+ virtual void getAsStringInternal(std::string &InnerString,
+ const PrintingPolicy &Policy) const;
+
+ static bool classof(const Type *T) { return T->getTypeClass() == Decltype; }
+ static bool classof(const DecltypeType *) { return true; }
+};
+
class TagType : public Type {
/// Stores the TagDecl associated with this type. The decl will
/// point to the TagDecl that actually defines the entity (or is a
diff --git a/include/clang/AST/TypeNodes.def b/include/clang/AST/TypeNodes.def
index 5555a9b0ae7e..64a09d800270 100644
--- a/include/clang/AST/TypeNodes.def
+++ b/include/clang/AST/TypeNodes.def
@@ -69,6 +69,7 @@ TYPE(FunctionNoProto, FunctionType)
NON_CANONICAL_TYPE(Typedef, Type)
NON_CANONICAL_TYPE(TypeOfExpr, Type)
NON_CANONICAL_TYPE(TypeOf, Type)
+NON_CANONICAL_TYPE(Decltype, Type)
ABSTRACT_TYPE(Tag, Type)
TYPE(Record, TagType)
TYPE(Enum, TagType)
diff --git a/include/clang/Analysis/LocalCheckers.h b/include/clang/Analysis/LocalCheckers.h
index 23610f9a2d97..9ff3f52f89aa 100644
--- a/include/clang/Analysis/LocalCheckers.h
+++ b/include/clang/Analysis/LocalCheckers.h
@@ -37,7 +37,6 @@ void CheckDeadStores(LiveVariables& L, BugReporter& BR);
void CheckUninitializedValues(CFG& cfg, ASTContext& Ctx, Diagnostic& Diags,
bool FullUninitTaint=false);
-GRTransferFuncs* MakeGRSimpleValsTF();
GRTransferFuncs* MakeCFRefCountTF(ASTContext& Ctx, bool GCEnabled,
const LangOptions& lopts);
diff --git a/include/clang/Analysis/PathSensitive/ConstraintManager.h b/include/clang/Analysis/PathSensitive/ConstraintManager.h
index eb519e0e7431..689bebb450f4 100644
--- a/include/clang/Analysis/PathSensitive/ConstraintManager.h
+++ b/include/clang/Analysis/PathSensitive/ConstraintManager.h
@@ -45,7 +45,7 @@ public:
virtual const GRState *RemoveDeadBindings(const GRState *state,
SymbolReaper& SymReaper) = 0;
- virtual void print(const GRState *state, std::ostream& Out,
+ virtual void print(const GRState *state, llvm::raw_ostream& Out,
const char* nl, const char *sep) = 0;
virtual void EndPath(const GRState *state) {}
diff --git a/include/clang/Analysis/PathSensitive/GRExprEngine.h b/include/clang/Analysis/PathSensitive/GRExprEngine.h
index 5db666c4b83f..f05bc680a7e2 100644
--- a/include/clang/Analysis/PathSensitive/GRExprEngine.h
+++ b/include/clang/Analysis/PathSensitive/GRExprEngine.h
@@ -20,6 +20,7 @@
#include "clang/Analysis/PathSensitive/GRState.h"
#include "clang/Analysis/PathSensitive/GRSimpleAPICheck.h"
#include "clang/Analysis/PathSensitive/GRTransferFuncs.h"
+#include "clang/Analysis/PathSensitive/SValuator.h"
#include "clang/Analysis/PathSensitive/BugReporter.h"
#include "clang/AST/Type.h"
#include "clang/AST/ExprObjC.h"
@@ -67,6 +68,9 @@ protected:
/// ValMgr - Object that manages/creates SVals.
ValueManager &ValMgr;
+ /// SVator - SValuator object that creates SVals from expressions.
+ llvm::OwningPtr<SValuator> SVator;
+
/// EntryNode - The immediate predecessor node.
NodeTy* EntryNode;
@@ -603,41 +607,32 @@ protected:
return X;
if (isa<Loc>(X))
- return getTF().EvalCast(*this, cast<Loc>(X), CastT);
+ return SVator->EvalCast(cast<Loc>(X), CastT);
else
- return getTF().EvalCast(*this, cast<NonLoc>(X), CastT);
+ return SVator->EvalCast(cast<NonLoc>(X), CastT);
}
- SVal EvalMinus(UnaryOperator* U, SVal X) {
- return X.isValid() ? getTF().EvalMinus(*this, U, cast<NonLoc>(X)) : X;
+ SVal EvalMinus(SVal X) {
+ return X.isValid() ? SVator->EvalMinus(cast<NonLoc>(X)) : X;
}
SVal EvalComplement(SVal X) {
- return X.isValid() ? getTF().EvalComplement(*this, cast<NonLoc>(X)) : X;
+ return X.isValid() ? SVator->EvalComplement(cast<NonLoc>(X)) : X;
}
public:
- SVal EvalBinOp(BinaryOperator::Opcode Op, NonLoc L, NonLoc R, QualType T) {
- return R.isValid() ? getTF().DetermEvalBinOpNN(*this, Op, L, R, T)
- : R;
+ SVal EvalBinOp(BinaryOperator::Opcode op, NonLoc L, NonLoc R, QualType T) {
+ return SVator->EvalBinOpNN(op, L, R, T);
}
- SVal EvalBinOp(BinaryOperator::Opcode Op, NonLoc L, SVal R, QualType T) {
- return R.isValid() ? getTF().DetermEvalBinOpNN(*this, Op, L,
- cast<NonLoc>(R), T) : R;
+ SVal EvalBinOp(BinaryOperator::Opcode op, NonLoc L, SVal R, QualType T) {
+ return R.isValid() ? SVator->EvalBinOpNN(op, L, cast<NonLoc>(R), T) : R;
}
- void EvalBinOp(ExplodedNodeSet<GRState>& Dst, Expr* Ex,
- BinaryOperator::Opcode Op, NonLoc L, NonLoc R,
- ExplodedNode<GRState>* Pred, QualType T);
-
- void EvalBinOp(GRStateSet& OStates, const GRState* St, Expr* Ex,
- BinaryOperator::Opcode Op, NonLoc L, NonLoc R, QualType T);
-
- SVal EvalBinOp(const GRState *state, BinaryOperator::Opcode Op, SVal L,SVal R,
- QualType T);
-
+ SVal EvalBinOp(const GRState *state, BinaryOperator::Opcode op,
+ SVal lhs, SVal rhs, QualType T);
+
protected:
void EvalCall(NodeSet& Dst, CallExpr* CE, SVal L, NodeTy* Pred);
diff --git a/include/clang/Analysis/PathSensitive/GRState.h b/include/clang/Analysis/PathSensitive/GRState.h
index 98f1242ad81e..0da8f5243e9c 100644
--- a/include/clang/Analysis/PathSensitive/GRState.h
+++ b/include/clang/Analysis/PathSensitive/GRState.h
@@ -34,7 +34,7 @@
#include "llvm/ADT/DenseSet.h"
#include "llvm/Support/Allocator.h"
#include "llvm/Support/Compiler.h"
-#include "llvm/Support/Streams.h"
+#include "llvm/Support/raw_ostream.h"
#include <functional>
@@ -199,6 +199,14 @@ public:
bool assumption) const;
//==---------------------------------------------------------------------==//
+ // Utility methods for getting regions.
+ //==---------------------------------------------------------------------==//
+
+ const VarRegion* getRegion(const VarDecl* D) const;
+
+ const MemRegion* getSelfRegion() const;
+
+ //==---------------------------------------------------------------------==//
// Binding and retrieving values to/from the environment and symbolic store.
//==---------------------------------------------------------------------==//
@@ -218,6 +226,10 @@ public:
return bindExpr(Ex, V, true, false);
}
+ const GRState *bindDecl(const VarDecl* VD, SVal IVal) const;
+
+ const GRState *bindDeclWithNoInit(const VarDecl* VD) const;
+
const GRState *bindLoc(Loc location, SVal V) const;
const GRState *bindLoc(SVal location, SVal V) const;
@@ -314,17 +326,17 @@ public:
class Printer {
public:
virtual ~Printer() {}
- virtual void Print(std::ostream& Out, const GRState* state,
+ virtual void Print(llvm::raw_ostream& Out, const GRState* state,
const char* nl, const char* sep) = 0;
};
// Pretty-printing.
- void print(std::ostream& Out, const char *nl = "\n",
+ void print(llvm::raw_ostream& Out, const char *nl = "\n",
const char *sep = "") const;
void printStdErr() const;
- void printDOT(std::ostream& Out) const;
+ void printDOT(llvm::raw_ostream& Out) const;
// Tags used for the Generic Data Map.
struct NullDerefTag {
@@ -427,18 +439,7 @@ private:
/// Liveness - live-variables information of the ValueDecl* and block-level
/// Expr* in the CFG. Used to get initial store and prune out dead state.
LiveVariables& Liveness;
-
-private:
-
- Environment RemoveBlkExpr(const Environment& Env, Expr* E) {
- return EnvMgr.RemoveBlkExpr(Env, E);
- }
- // FIXME: Remove when we do lazy initializaton of variable bindings.
-// const GRState* BindVar(const GRState* St, VarDecl* D, SVal V) {
-// return SetSVal(St, getLoc(D), V);
-// }
-
public:
GRStateManager(ASTContext& Ctx,
@@ -460,7 +461,7 @@ public:
~GRStateManager();
- const GRState* getInitialState();
+ const GRState *getInitialState();
ASTContext &getContext() { return ValueMgr.getContext(); }
const ASTContext &getContext() const { return ValueMgr.getContext(); }
@@ -498,16 +499,6 @@ public:
StoreManager& getStoreManager() { return *StoreMgr; }
ConstraintManager& getConstraintManager() { return *ConstraintMgr; }
- const GRState* BindDecl(const GRState* St, const VarDecl* VD, SVal IVal) {
- // Store manager should return a persistent state.
- return StoreMgr->BindDecl(St, VD, IVal);
- }
-
- const GRState* BindDeclWithNoInit(const GRState* St, const VarDecl* VD) {
- // Store manager should return a persistent state.
- return StoreMgr->BindDeclWithNoInit(St, VD);
- }
-
const GRState* RemoveDeadBindings(const GRState* St, Stmt* Loc,
SymbolReaper& SymReaper);
@@ -516,55 +507,7 @@ public:
NewSt.Env = EnvMgr.RemoveSubExprBindings(NewSt.Env);
return getPersistentState(NewSt);
}
-
-
- // Utility methods for getting regions.
-
- VarRegion* getRegion(const VarDecl* D) {
- return getRegionManager().getVarRegion(D);
- }
-
- const MemRegion* getSelfRegion(const GRState* state) {
- return StoreMgr->getSelfRegion(state->getStore());
- }
-
-private:
-
- SVal GetBlkExprSVal(const GRState* St, const Stmt* Ex) {
- return St->getEnvironment().GetBlkExprSVal(Ex, ValueMgr);
- }
-
- const GRState* BindExpr(const GRState* St, const Stmt* Ex, SVal V,
- bool isBlkExpr, bool Invalidate) {
-
- const Environment& OldEnv = St->getEnvironment();
- Environment NewEnv = EnvMgr.BindExpr(OldEnv, Ex, V, isBlkExpr, Invalidate);
-
- if (NewEnv == OldEnv)
- return St;
-
- GRState NewSt = *St;
- NewSt.Env = NewEnv;
- return getPersistentState(NewSt);
- }
- const GRState* BindExpr(const GRState* St, const Stmt* Ex, SVal V,
- bool Invalidate = true) {
-
- bool isBlkExpr = false;
-
- if (Ex == CurrentStmt) {
- // FIXME: Should this just be an assertion? When would we want to set
- // the value of a block-level expression if it wasn't CurrentStmt?
- isBlkExpr = cfg.isBlkExpr(Ex);
-
- if (!isBlkExpr)
- return St;
- }
-
- return BindExpr(St, Ex, V, isBlkExpr, Invalidate);
- }
-
public:
SVal ArrayToPointer(Loc Array) {
@@ -579,37 +522,7 @@ public:
void iterBindings(const GRState* state, StoreManager::BindingsHandler& F) {
StoreMgr->iterBindings(state->getStore(), F);
}
-
- SVal GetSVal(const GRState* state, const MemRegion* R) {
- return StoreMgr->Retrieve(state, loc::MemRegionVal(R));
- }
-
- SVal GetSValAsScalarOrLoc(const GRState* state, const MemRegion *R) {
- // We only want to do fetches from regions that we can actually bind
- // values. For example, SymbolicRegions of type 'id<...>' cannot
- // have direct bindings (but their can be bindings on their subregions).
- if (!R->isBoundable())
- return UnknownVal();
-
- if (const TypedRegion *TR = dyn_cast<TypedRegion>(R)) {
- QualType T = TR->getValueType(getContext());
- if (Loc::IsLocType(T) || T->isIntegerType())
- return GetSVal(state, R);
- }
-
- return UnknownVal();
- }
-
- const GRState* BindLoc(const GRState* St, Loc LV, SVal V) {
- return StoreMgr->Bind(St, LV, V);
- }
- void Unbind(GRState& St, Loc LV) {
- St.St = StoreMgr->Remove(St.St, LV);
- }
-
- const GRState* Unbind(const GRState* St, Loc LV);
-
const GRState* getPersistentState(GRState& Impl);
bool isEqual(const GRState* state, Expr* Ex, const llvm::APSInt& V);
@@ -695,6 +608,14 @@ public:
// Out-of-line method definitions for GRState.
//===----------------------------------------------------------------------===//
+inline const VarRegion* GRState::getRegion(const VarDecl* D) const {
+ return Mgr->getRegionManager().getVarRegion(D);
+}
+
+inline const MemRegion* GRState::getSelfRegion() const {
+ return Mgr->StoreMgr->getSelfRegion(getStore());
+}
+
inline const GRState *GRState::assume(SVal Cond, bool Assumption) const {
return Mgr->ConstraintMgr->Assume(this, Cond, Assumption);
}
@@ -709,18 +630,16 @@ inline const GRState *GRState::bindCompoundLiteral(const CompoundLiteralExpr* CL
return Mgr->StoreMgr->BindCompoundLiteral(this, CL, V);
}
-inline const GRState *GRState::bindExpr(const Stmt* Ex, SVal V, bool isBlkExpr,
- bool Invalidate) const {
- return Mgr->BindExpr(this, Ex, V, isBlkExpr, Invalidate);
+inline const GRState *GRState::bindDecl(const VarDecl* VD, SVal IVal) const {
+ return Mgr->StoreMgr->BindDecl(this, VD, IVal);
}
-inline const GRState *GRState::bindExpr(const Stmt* Ex, SVal V,
- bool Invalidate) const {
- return Mgr->BindExpr(this, Ex, V, Invalidate);
+inline const GRState *GRState::bindDeclWithNoInit(const VarDecl* VD) const {
+ return Mgr->StoreMgr->BindDeclWithNoInit(this, VD);
}
inline const GRState *GRState::bindLoc(Loc LV, SVal V) const {
- return Mgr->BindLoc(this, LV, V);
+ return Mgr->StoreMgr->Bind(this, LV, V);
}
inline const GRState *GRState::bindLoc(SVal LV, SVal V) const {
@@ -756,11 +675,11 @@ inline const llvm::APSInt *GRState::getSymVal(SymbolRef sym) const {
}
inline SVal GRState::getSVal(const Stmt* Ex) const {
- return getEnvironment().GetSVal(Ex, Mgr->ValueMgr);
+ return Env.GetSVal(Ex, Mgr->ValueMgr);
}
inline SVal GRState::getBlkExprSVal(const Stmt* Ex) const {
- return Mgr->GetBlkExprSVal(this, Ex);
+ return Env.GetBlkExprSVal(Ex, Mgr->ValueMgr);
}
inline SVal GRState::getSValAsScalarOrLoc(const Stmt *S) const {
@@ -778,11 +697,7 @@ inline SVal GRState::getSVal(Loc LV, QualType T) const {
}
inline SVal GRState::getSVal(const MemRegion* R) const {
- return Mgr->GetSVal(this, R);
-}
-
-inline SVal GRState::getSValAsScalarOrLoc(const MemRegion *R) const {
- return Mgr->GetSValAsScalarOrLoc(this, R);
+ return Mgr->StoreMgr->Retrieve(this, loc::MemRegionVal(R));
}
inline BasicValueFactory &GRState::getBasicVals() const {
@@ -842,10 +757,6 @@ CB GRState::scanReachableSymbols(SVal val) const {
scanReachableSymbols(val, cb);
return cb;
}
-
-inline const GRState *GRState::unbindLoc(Loc LV) const {
- return Mgr->Unbind(this, LV);
-}
} // end clang namespace
diff --git a/include/clang/Analysis/PathSensitive/GRTransferFuncs.h b/include/clang/Analysis/PathSensitive/GRTransferFuncs.h
index c2f8f5aae0e9..db23f81e2d67 100644
--- a/include/clang/Analysis/PathSensitive/GRTransferFuncs.h
+++ b/include/clang/Analysis/PathSensitive/GRTransferFuncs.h
@@ -22,20 +22,12 @@
namespace clang {
- class GRExprEngine;
- class BugReporter;
- class ObjCMessageExpr;
- class GRStmtNodeBuilderRef;
+class GRExprEngine;
+class BugReporter;
+class ObjCMessageExpr;
+class GRStmtNodeBuilderRef;
class GRTransferFuncs {
- friend class GRExprEngine;
-protected:
- virtual SVal DetermEvalBinOpNN(GRExprEngine& Eng,
- BinaryOperator::Opcode Op,
- NonLoc L, NonLoc R, QualType T) {
- return UnknownVal();
- }
-
public:
GRTransferFuncs() {}
virtual ~GRTransferFuncs() {}
@@ -43,33 +35,7 @@ public:
virtual void RegisterPrinters(std::vector<GRState::Printer*>& Printers) {}
virtual void RegisterChecks(BugReporter& BR) {}
- // Casts.
-
- virtual SVal EvalCast(GRExprEngine& Engine, NonLoc V, QualType CastT) =0;
- virtual SVal EvalCast(GRExprEngine& Engine, Loc V, QualType CastT) = 0;
-
- // Unary Operators.
-
- virtual SVal EvalMinus(GRExprEngine& Engine, UnaryOperator* U, NonLoc X) = 0;
-
- virtual SVal EvalComplement(GRExprEngine& Engine, NonLoc X) = 0;
- // Binary Operators.
- // FIXME: We're moving back towards using GREXprEngine directly. No need
- // for OStates
- virtual void EvalBinOpNN(GRStateSet& OStates, GRExprEngine& Eng,
- const GRState* St, Expr* Ex,
- BinaryOperator::Opcode Op, NonLoc L, NonLoc R,
- QualType T);
-
- virtual SVal EvalBinOp(GRExprEngine& Engine, BinaryOperator::Opcode Op,
- Loc L, Loc R) = 0;
-
- // Pointer arithmetic.
-
- virtual SVal EvalBinOp(GRExprEngine& Engine, const GRState *state,
- BinaryOperator::Opcode Op, Loc L, NonLoc R) = 0;
-
// Calls.
virtual void EvalCall(ExplodedNodeSet<GRState>& Dst,
@@ -108,8 +74,7 @@ public:
ReturnStmt* S,
ExplodedNode<GRState>* Pred) {}
- // Assumptions.
-
+ // Assumptions.
virtual const GRState* EvalAssume(const GRState *state,
SVal Cond, bool Assumption) {
return state;
diff --git a/include/clang/Analysis/PathSensitive/SVals.h b/include/clang/Analysis/PathSensitive/SVals.h
index de74dbdb17b0..36137fb117b3 100644
--- a/include/clang/Analysis/PathSensitive/SVals.h
+++ b/include/clang/Analysis/PathSensitive/SVals.h
@@ -111,7 +111,6 @@ public:
/// return that expression. Otherwise return NULL.
const SymExpr *getAsSymbolicExpression() const;
- void print(std::ostream& OS) const;
void print(llvm::raw_ostream& OS) const;
void printStdErr() const;
@@ -255,12 +254,12 @@ public:
}
// Transfer functions for binary/unary operations on ConcreteInts.
- SVal EvalBinOp(BasicValueFactory& BasicVals, BinaryOperator::Opcode Op,
+ SVal evalBinOp(ValueManager &ValMgr, BinaryOperator::Opcode Op,
const ConcreteInt& R) const;
- ConcreteInt EvalComplement(BasicValueFactory& BasicVals) const;
+ ConcreteInt evalComplement(ValueManager &ValMgr) const;
- ConcreteInt EvalMinus(BasicValueFactory& BasicVals, UnaryOperator* U) const;
+ ConcreteInt evalMinus(ValueManager &ValMgr) const;
// Implement isa<T> support.
static inline bool classof(const SVal* V) {
diff --git a/include/clang/Analysis/PathSensitive/SValuator.h b/include/clang/Analysis/PathSensitive/SValuator.h
new file mode 100644
index 000000000000..490c04e5978e
--- /dev/null
+++ b/include/clang/Analysis/PathSensitive/SValuator.h
@@ -0,0 +1,55 @@
+// SValuator.h - Construction of SVals from evaluating expressions -*- C++ -*---
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file defines SValuator, a class that defines the interface for
+// "symbolical evaluators" which construct an SVal from an expression.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_ANALYSIS_SVALUATOR
+#define LLVM_CLANG_ANALYSIS_SVALUATOR
+
+#include "clang/AST/Expr.h"
+#include "clang/Analysis/PathSensitive/SVals.h"
+
+namespace clang {
+
+class GRState;
+class ValueManager;
+
+class SValuator {
+protected:
+ ValueManager &ValMgr;
+
+public:
+ SValuator(ValueManager &valMgr) : ValMgr(valMgr) {}
+ virtual ~SValuator() {}
+
+ virtual SVal EvalCast(NonLoc val, QualType castTy) = 0;
+
+ virtual SVal EvalCast(Loc val, QualType castTy) = 0;
+
+ virtual SVal EvalMinus(NonLoc val) = 0;
+
+ virtual SVal EvalComplement(NonLoc val) = 0;
+
+ virtual SVal EvalBinOpNN(BinaryOperator::Opcode Op, NonLoc lhs,
+ NonLoc rhs, QualType resultTy) = 0;
+
+ virtual SVal EvalBinOpLL(BinaryOperator::Opcode Op, Loc lhs, Loc rhs,
+ QualType resultTy) = 0;
+
+ virtual SVal EvalBinOpLN(const GRState *state, BinaryOperator::Opcode Op,
+ Loc lhs, NonLoc rhs, QualType resultTy) = 0;
+};
+
+SValuator* CreateSimpleSValuator(ValueManager &valMgr);
+
+} // end clang namespace
+#endif
diff --git a/include/clang/Analysis/PathSensitive/Store.h b/include/clang/Analysis/PathSensitive/Store.h
index 0c5df2e98e17..5aa53507fd14 100644
--- a/include/clang/Analysis/PathSensitive/Store.h
+++ b/include/clang/Analysis/PathSensitive/Store.h
@@ -21,7 +21,6 @@
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/SmallSet.h"
#include "llvm/ADT/SmallVector.h"
-#include <iosfwd>
namespace clang {
@@ -139,7 +138,7 @@ public:
/// EvalBinOp - Perform pointer arithmetic.
virtual SVal EvalBinOp(const GRState *state, BinaryOperator::Opcode Op,
- Loc lhs, NonLoc rhs) {
+ Loc lhs, NonLoc rhs, QualType resultTy) {
return UnknownVal();
}
@@ -171,7 +170,7 @@ public:
return state;
}
- virtual void print(Store store, std::ostream& Out,
+ virtual void print(Store store, llvm::raw_ostream& Out,
const char* nl, const char *sep) = 0;
class BindingsHandler {
diff --git a/include/clang/Analysis/PathSensitive/SymbolManager.h b/include/clang/Analysis/PathSensitive/SymbolManager.h
index d074e30333d4..f32a7e3481dd 100644
--- a/include/clang/Analysis/PathSensitive/SymbolManager.h
+++ b/include/clang/Analysis/PathSensitive/SymbolManager.h
@@ -328,9 +328,4 @@ namespace llvm {
llvm::raw_ostream& operator<<(llvm::raw_ostream& Out,
const clang::SymExpr *SE);
}
-namespace std {
- std::ostream& operator<<(std::ostream& Out,
- const clang::SymExpr *SE);
-}
-
#endif
diff --git a/include/clang/Analysis/PathSensitive/ValueManager.h b/include/clang/Analysis/PathSensitive/ValueManager.h
index d8e557f76036..de318a0f03e8 100644
--- a/include/clang/Analysis/PathSensitive/ValueManager.h
+++ b/include/clang/Analysis/PathSensitive/ValueManager.h
@@ -87,14 +87,18 @@ public:
return nonloc::ConcreteInt(BasicVals.getZeroWithPtrWidth(false));
}
- NonLoc makeIntVal(const IntegerLiteral* I) {
+ nonloc::ConcreteInt makeIntVal(const IntegerLiteral* I) {
return nonloc::ConcreteInt(BasicVals.getValue(I->getValue(),
I->getType()->isUnsignedIntegerType()));
}
- NonLoc makeIntVal(const llvm::APSInt& V) {
+ nonloc::ConcreteInt makeIntVal(const llvm::APSInt& V) {
return nonloc::ConcreteInt(BasicVals.getValue(V));
}
+
+ loc::ConcreteInt makeIntLocVal(const llvm::APSInt &v) {
+ return loc::ConcreteInt(BasicVals.getValue(v));
+ }
NonLoc makeIntVal(const llvm::APInt& V, bool isUnsigned) {
return nonloc::ConcreteInt(BasicVals.getValue(V, isUnsigned));
diff --git a/include/clang/Basic/DiagnosticFrontendKinds.td b/include/clang/Basic/DiagnosticFrontendKinds.td
index 9c439851b182..815ae8d70003 100644
--- a/include/clang/Basic/DiagnosticFrontendKinds.td
+++ b/include/clang/Basic/DiagnosticFrontendKinds.td
@@ -60,6 +60,12 @@ def warn_pch_heinous_extensions : Error<
def warn_pch_lax_vector_conversions : Error<
"lax vector conversions were %select{disabled|enabled}0 in PCH file but "
"are currently %select{disabled|enabled}1">;
+def warn_pch_altivec : Error<
+ "AltiVec initializers were %select{disabled|enabled}0 in PCH file but "
+ "are currently %select{disabled|enabled}1">;
+def warn_pch_opencl : Error<
+ "OpenCL language extensions were %select{disabled|enabled}0 in PCH file "
+ "but are currently %select{disabled|enabled}1">;
def warn_pch_exceptions : Error<
"exceptions were %select{disabled|enabled}0 in PCH file but "
"are currently %select{disabled|enabled}1">;
diff --git a/include/clang/Basic/DiagnosticSemaKinds.td b/include/clang/Basic/DiagnosticSemaKinds.td
index 79a9efac8554..4ba1083089e6 100644
--- a/include/clang/Basic/DiagnosticSemaKinds.td
+++ b/include/clang/Basic/DiagnosticSemaKinds.td
@@ -398,6 +398,15 @@ def err_init_reference_member_uninitialized : Error<
def note_uninit_reference_member : Note<
"uninitialized reference member is here">;
+// C++0x auto
+def err_auto_variable_cannot_appear_in_own_initializer : Error<
+ "variable %0 declared with 'auto' type cannot appear in its own initializer">;
+def err_illegal_decl_array_of_auto : Error<
+ "'%0' declared as array of 'auto'">;
+def err_auto_not_allowed : Error<
+ "'auto' not allowed in %select{function prototype|struct member|union member"
+ "|class member|exception declaration|template parameter|block literal}0">;
+
// Objective-C++
def err_objc_decls_may_only_appear_in_global_scope : Error<
"Objective-C declarations may only appear in global scope">;
@@ -584,6 +593,12 @@ def err_defining_default_ctor : Error<
"%2 does not have any default constructor">;
def note_previous_class_decl : Note<
"%0 declared here">;
+def err_uninitialized_member_for_assign : Error<
+ "cannot define the implicit default assignment operator for %0, because "
+ "non-static %select{reference|const}1 member %2 can't use default "
+ "assignment operator">;
+def note_first_required_here : Note<
+ "synthesized method is first required here">;
def err_unintialized_member : Error<
"cannot define the implicit default constructor for %0, because "
"%select{reference|const}1 member %2 cannot be default-initialized">;
@@ -651,6 +666,7 @@ def note_template_export_unsupported : Note<
def err_template_outside_namespace_or_class_scope : Error<
"templates can only be declared in namespace or class scope">;
def err_template_linkage : Error<"templates must have C++ linkage">;
+def err_template_typedef : Error<"a typedef cannot be a template">;
def err_template_unnamed_class : Error<
"cannot declare a class template with no name">;
def err_template_param_list_different_arity : Error<
@@ -697,14 +713,15 @@ def err_template_arg_must_be_expr : Error<
def err_template_arg_nontype_ambig : Error<
"template argument for non-type template parameter is treated as type %0">;
def err_template_arg_must_be_template : Error<
- "template argument for template template parameter must be a template">;
+ "template argument for template template parameter must be a class template">;
def err_template_arg_local_type : Error<"template argument uses local type %0">;
def err_template_arg_unnamed_type : Error<
"template argument uses unnamed type">;
def note_template_unnamed_type_here : Note<
"unnamed type used in template argument was declared here">;
def err_template_arg_not_class_template : Error<
- "template argument does not refer to a class template">;
+ "template argument does not refer to a class template or template "
+ "template parameter">;
def note_template_arg_refers_here_func : Note<
"template argument refers to function template %0, here">;
def err_template_arg_template_params_mismatch : Error<
@@ -813,6 +830,9 @@ def note_template_member_class_here : Note<
"in instantiation of member class %0 requested here">;
def note_template_member_function_here : Note<
"in instantiation of member function %q0 requested here">;
+def note_function_template_spec_here : Note<
+ "in instantiation of function template specialization %q0 requested here">;
+
def note_default_arg_instantiation_here : Note<
"in instantiation of default argument for '%0' required here">;
def note_partial_spec_deduct_instantiation_here : Note<
@@ -1602,6 +1622,14 @@ def err_anonymous_record_nonpublic_member : Error<
"anonymous %select{struct|union}0 cannot contain a "
"%select{private|protected}1 data member">;
+// C++ local classes
+def err_reference_to_local_var_in_enclosing_function : Error<
+ "reference to local variable %0 declared in enclosed function %1">;
+def note_local_variable_declared_here : Note<
+ "%0 declared here">;
+def err_static_data_member_not_allowed_in_local_class : Error<
+ "static data member %0 not allowed in local class %1">;
+
// C++ derived classes
def err_base_clause_on_union : Error<"unions cannot have base classes">;
def err_base_must_be_class : Error<"base specifier must name a class">;
@@ -1841,6 +1869,9 @@ def err_selector_element_type : Error<
def err_collection_expr_type : Error<
"collection expression type %0 is not a valid object">;
+def err_invalid_conversion_between_ext_vectors : Error<
+ "invalid conversion between ext-vector type %0 and %1">;
+
// Type
def ext_invalid_sign_spec : Extension<"'%0' cannot be signed or unsigned">;
def warn_receiver_forward_class : Warning<
diff --git a/include/clang/Basic/LangOptions.h b/include/clang/Basic/LangOptions.h
index 7c578e32f814..543a0fff8e7b 100644
--- a/include/clang/Basic/LangOptions.h
+++ b/include/clang/Basic/LangOptions.h
@@ -43,6 +43,7 @@ public:
unsigned PascalStrings : 1; // Allow Pascal strings
unsigned WritableStrings : 1; // Allow writable strings
unsigned LaxVectorConversions : 1;
+ unsigned AltiVec : 1; // Support AltiVec-style vector initializers.
unsigned Exceptions : 1; // Support exception handling.
unsigned NeXTRuntime : 1; // Use NeXT runtime.
@@ -80,6 +81,10 @@ public:
unsigned AccessControl : 1; // Whether C++ access control should
// be enabled.
unsigned CharIsSigned : 1; // Whether char is a signed or unsigned type
+
+ unsigned OpenCL : 1; // OpenCL C99 language extensions.
+
+
private:
unsigned GC : 2; // Objective-C Garbage Collection modes. We declare
// this enum as unsigned because MSVC insists on making enums
@@ -111,6 +116,7 @@ public:
Exceptions = NeXTRuntime = Freestanding = NoBuiltin = 0;
LaxVectorConversions = 1;
HeinousExtensions = 0;
+ AltiVec = OpenCL = 0;
SymbolVisibility = (unsigned) Default;
diff --git a/include/clang/Basic/SourceManager.h b/include/clang/Basic/SourceManager.h
index bcfb83b8942c..249ca89f717d 100644
--- a/include/clang/Basic/SourceManager.h
+++ b/include/clang/Basic/SourceManager.h
@@ -326,6 +326,11 @@ class SourceManager {
// Statistics for -print-stats.
mutable unsigned NumLinearScans, NumBinaryProbes;
+ // Cache results for the isBeforeInTranslationUnit method.
+ mutable FileID LastLFIDForBeforeTUCheck;
+ mutable FileID LastRFIDForBeforeTUCheck;
+ mutable bool LastResForBeforeTUCheck;
+
// SourceManager doesn't support copy construction.
explicit SourceManager(const SourceManager&);
void operator=(const SourceManager&);
@@ -637,6 +642,11 @@ public:
SourceLocation getLocation(const FileEntry *SourceFile,
unsigned Line, unsigned Col) const;
+ /// \brief Determines the order of 2 source locations in the translation unit.
+ ///
+ /// \returns true if LHS source location comes before RHS, false otherwise.
+ bool isBeforeInTranslationUnit(SourceLocation LHS, SourceLocation RHS) const;
+
// Iterators over FileInfos.
typedef llvm::DenseMap<const FileEntry*, SrcMgr::ContentCache*>
::const_iterator fileinfo_iterator;
diff --git a/include/clang/Basic/TokenKinds.def b/include/clang/Basic/TokenKinds.def
index 497b1884a3d8..ed0270acd0dd 100644
--- a/include/clang/Basic/TokenKinds.def
+++ b/include/clang/Basic/TokenKinds.def
@@ -224,7 +224,7 @@ KEYWORD(__func__ , KEYALL)
// C++ 2.11p1: Keywords.
KEYWORD(asm , KEYCXX|KEYGNU)
-KEYWORD(bool , KEYCXX)
+KEYWORD(bool , KEYCXX|BOOLSUPPORT)
KEYWORD(catch , KEYCXX)
KEYWORD(class , KEYCXX)
KEYWORD(const_cast , KEYCXX)
@@ -232,7 +232,7 @@ KEYWORD(delete , KEYCXX)
KEYWORD(dynamic_cast , KEYCXX)
KEYWORD(explicit , KEYCXX)
KEYWORD(export , KEYCXX)
-KEYWORD(false , KEYCXX)
+KEYWORD(false , KEYCXX|BOOLSUPPORT)
KEYWORD(friend , KEYCXX)
KEYWORD(mutable , KEYCXX)
KEYWORD(namespace , KEYCXX)
@@ -246,7 +246,7 @@ KEYWORD(static_cast , KEYCXX)
KEYWORD(template , KEYCXX)
KEYWORD(this , KEYCXX)
KEYWORD(throw , KEYCXX)
-KEYWORD(true , KEYCXX)
+KEYWORD(true , KEYCXX|BOOLSUPPORT)
KEYWORD(try , KEYCXX)
KEYWORD(typename , KEYCXX)
KEYWORD(typeid , KEYCXX)
diff --git a/include/clang/Frontend/Analyses.def b/include/clang/Frontend/Analyses.def
index 3492d09c10aa..ad799c3a8b25 100644
--- a/include/clang/Frontend/Analyses.def
+++ b/include/clang/Frontend/Analyses.def
@@ -41,13 +41,9 @@ ANALYSIS(WarnObjCDealloc, "warn-objc-missing-dealloc",
ANALYSIS(WarnObjCUnusedIvars, "warn-objc-unused-ivars",
"Warn about private ivars that are never used", ObjCImplementation)
-ANALYSIS(CheckerSimple, "checker-simple",
- "Perform simple path-sensitive checks.", Code)
-
ANALYSIS(CheckerCFRef, "checker-cfref",
"Run the [Core] Foundation reference count checker", Code)
-
#ifndef ANALYSIS_STORE
#define ANALYSIS_STORE(NAME, CMDFLAG, DESC, CREATFN)
#endif
diff --git a/include/clang/Frontend/CommandLineSourceLoc.h b/include/clang/Frontend/CommandLineSourceLoc.h
new file mode 100644
index 000000000000..1eaa958995f5
--- /dev/null
+++ b/include/clang/Frontend/CommandLineSourceLoc.h
@@ -0,0 +1,85 @@
+//===--- CommandLineSourceLoc.h - Parsing for source locations-*- C++ -*---===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// Command line parsing for source locations.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_FRONTEND_COMMANDLINESOURCELOC_H
+#define LLVM_CLANG_FRONTEND_COMMANDLINESOURCELOC_H
+
+#include "llvm/Support/CommandLine.h"
+#include <cstdio>
+
+namespace clang {
+
+/// \brief A source location that has been parsed on the command line.
+struct ParsedSourceLocation {
+ std::string FileName;
+ unsigned Line;
+ unsigned Column;
+};
+
+}
+
+namespace llvm {
+ namespace cl {
+ /// \brief Command-line option parser that parses source locations.
+ ///
+ /// Source locations are of the form filename:line:column.
+ template<>
+ class parser<clang::ParsedSourceLocation>
+ : public basic_parser<clang::ParsedSourceLocation> {
+ public:
+ bool parse(Option &O, const char *ArgName,
+ const std::string &ArgValue,
+ clang::ParsedSourceLocation &Val);
+ };
+
+ bool
+ parser<clang::ParsedSourceLocation>::
+ parse(Option &O, const char *ArgName, const std::string &ArgValue,
+ clang::ParsedSourceLocation &Val) {
+ using namespace clang;
+
+ const char *ExpectedFormat
+ = "source location must be of the form filename:line:column";
+ std::string::size_type SecondColon = ArgValue.rfind(':');
+ if (SecondColon == std::string::npos) {
+ std::fprintf(stderr, "%s\n", ExpectedFormat);
+ return true;
+ }
+ char *EndPtr;
+ long Column
+ = std::strtol(ArgValue.c_str() + SecondColon + 1, &EndPtr, 10);
+ if (EndPtr != ArgValue.c_str() + ArgValue.size()) {
+ std::fprintf(stderr, "%s\n", ExpectedFormat);
+ return true;
+ }
+
+ std::string::size_type FirstColon = ArgValue.rfind(':', SecondColon-1);
+ if (FirstColon == std::string::npos) {
+ std::fprintf(stderr, "%s\n", ExpectedFormat);
+ return true;
+ }
+ long Line = std::strtol(ArgValue.c_str() + FirstColon + 1, &EndPtr, 10);
+ if (EndPtr != ArgValue.c_str() + SecondColon) {
+ std::fprintf(stderr, "%s\n", ExpectedFormat);
+ return true;
+ }
+
+ Val.FileName = ArgValue.substr(0, FirstColon);
+ Val.Line = Line;
+ Val.Column = Column;
+ return false;
+ }
+ }
+}
+
+#endif
diff --git a/include/clang/Frontend/PCHBitCodes.h b/include/clang/Frontend/PCHBitCodes.h
index e546a12c49e9..63222725d529 100644
--- a/include/clang/Frontend/PCHBitCodes.h
+++ b/include/clang/Frontend/PCHBitCodes.h
@@ -387,7 +387,9 @@ namespace clang {
/// \brief An ObjCQualifiedInterfaceType record.
TYPE_OBJC_QUALIFIED_INTERFACE = 22,
/// \brief An ObjCObjectPointerType record.
- TYPE_OBJC_OBJECT_POINTER = 23
+ TYPE_OBJC_OBJECT_POINTER = 23,
+ /// \brief a DecltypeType record.
+ TYPE_DECLTYPE = 24
};
/// \brief The type IDs for special types constructed by semantic
diff --git a/include/clang/Frontend/Utils.h b/include/clang/Frontend/Utils.h
index 41eb31a0fc35..77df60cd7210 100644
--- a/include/clang/Frontend/Utils.h
+++ b/include/clang/Frontend/Utils.h
@@ -32,6 +32,10 @@ class IdentifierTable;
class SourceManager;
class PreprocessorFactory;
class LangOptions;
+class Decl;
+class Stmt;
+class ASTContext;
+class SourceLocation;
/// ProcessWarningOptions - Initialize the diagnostic client and process the
/// warning options specified on the command line.
@@ -74,6 +78,33 @@ void AttachDependencyFileGen(Preprocessor *PP, llvm::raw_ostream *OS,
/// a seekable stream.
void CacheTokens(Preprocessor& PP, llvm::raw_fd_ostream* OS);
+/// \brief Returns the AST node that a source location points to.
+///
+/// Returns a pair of Decl* and Stmt*. If no AST node is found for the source
+/// location, the pair will contain null pointers.
+///
+/// If the source location points to just a declaration, the statement part of
+/// the pair will be null, e.g.,
+/// @code
+/// int foo;
+/// @endcode
+/// If the source location points at 'foo', the pair will contain the VarDecl
+/// of foo and a null Stmt.
+///
+/// If the source location points to a statement node, the returned declaration
+/// will be the immediate 'parent' declaration of the statement node, e.g.,
+/// @code
+/// void f() {
+/// int foo = 100;
+/// ++foo;
+/// }
+/// @endcode
+/// Pointing at '100' will return a <VarDecl 'foo', IntegerLiteral '100'> pair.
+/// Pointing at '++foo' will return a <FunctionDecl 'f', UnaryOperator> pair.
+///
+std::pair<Decl *, Stmt *> ResolveLocationInAST(ASTContext &Ctx,
+ SourceLocation Loc);
+
} // end namespace clang
#endif
diff --git a/include/clang/Parse/Action.h b/include/clang/Parse/Action.h
index 8c85ba60ac2e..bfb74748c5f1 100644
--- a/include/clang/Parse/Action.h
+++ b/include/clang/Parse/Action.h
@@ -967,12 +967,13 @@ public:
/// ActOnUsingDirective - This is called when using-directive is parsed.
virtual DeclPtrTy ActOnUsingDeclaration(Scope *CurScope,
- SourceLocation UsingLoc,
- const CXXScopeSpec &SS,
- SourceLocation IdentLoc,
- IdentifierInfo *TargetName,
- AttributeList *AttrList,
- bool IsTypeName);
+ SourceLocation UsingLoc,
+ const CXXScopeSpec &SS,
+ SourceLocation IdentLoc,
+ IdentifierInfo *TargetName,
+ OverloadedOperatorKind Op,
+ AttributeList *AttrList,
+ bool IsTypeName);
/// ActOnParamDefaultArgument - Parse default argument for function parameter
virtual void ActOnParamDefaultArgument(DeclPtrTy param,
@@ -1453,6 +1454,26 @@ public:
return DeclResult();
}
+ /// \brief Invoked when a declarator that has one or more template parameter
+ /// lists has been parsed.
+ ///
+ /// This action is similar to ActOnDeclarator(), except that the declaration
+ /// being created somehow involves a template, e.g., it is a template
+ /// declaration or specialization.
+ virtual DeclPtrTy ActOnTemplateDeclarator(Scope *S,
+ MultiTemplateParamsArg TemplateParameterLists,
+ Declarator &D) {
+ return DeclPtrTy();
+ }
+
+ /// \brief Invoked when the parser is beginning to parse a function template
+ /// or function template specialization definition.
+ virtual DeclPtrTy ActOnStartOfFunctionTemplateDef(Scope *FnBodyScope,
+ MultiTemplateParamsArg TemplateParameterLists,
+ Declarator &D) {
+ return DeclPtrTy();
+ }
+
/// \brief Process the explicit instantiation of a class template
/// specialization.
///
diff --git a/include/clang/Parse/AttributeList.h b/include/clang/Parse/AttributeList.h
index 26cebf0915b4..50ca88acbce9 100644
--- a/include/clang/Parse/AttributeList.h
+++ b/include/clang/Parse/AttributeList.h
@@ -97,6 +97,7 @@ public:
AT_warn_unused_result,
AT_weak,
AT_weak_import,
+ AT_reqd_wg_size,
IgnoredAttribute,
UnknownAttribute
};
diff --git a/include/clang/Parse/DeclSpec.h b/include/clang/Parse/DeclSpec.h
index a0b9b1e7cc23..300602e5147c 100644
--- a/include/clang/Parse/DeclSpec.h
+++ b/include/clang/Parse/DeclSpec.h
@@ -82,6 +82,8 @@ public:
TST_typename, // Typedef, C++ class-name or enum name, etc.
TST_typeofType,
TST_typeofExpr,
+ TST_decltype, // C++0x decltype
+ TST_auto, // C++0x auto
TST_error // erroneous type
};
diff --git a/include/clang/Parse/Parser.h b/include/clang/Parse/Parser.h
index 75587936065b..e5f62ec683e3 100644
--- a/include/clang/Parse/Parser.h
+++ b/include/clang/Parse/Parser.h
@@ -636,7 +636,8 @@ private:
DeclGroupPtrTy ParseDeclarationOrFunctionDefinition(
AccessSpecifier AS = AS_none);
- DeclPtrTy ParseFunctionDefinition(Declarator &D);
+ DeclPtrTy ParseFunctionDefinition(Declarator &D,
+ const ParsedTemplateInfo &TemplateInfo = ParsedTemplateInfo());
void ParseKNRParamDeclarations(Declarator &D);
// EndLoc, if non-NULL, is filled with the location of the last token of
// the simple-asm.
@@ -909,7 +910,8 @@ private:
DeclGroupPtrTy ParseSimpleDeclaration(unsigned Context,
SourceLocation &DeclEnd,
bool RequireSemi = true);
- DeclPtrTy ParseDeclarationAfterDeclarator(Declarator &D);
+ DeclPtrTy ParseDeclarationAfterDeclarator(Declarator &D,
+ const ParsedTemplateInfo &TemplateInfo = ParsedTemplateInfo());
DeclGroupPtrTy ParseInitDeclaratorListAfterFirstDeclarator(Declarator &D);
DeclPtrTy ParseFunctionStatementBody(DeclPtrTy Decl);
DeclPtrTy ParseFunctionTryBlock(DeclPtrTy Decl);
@@ -1069,6 +1071,7 @@ private:
AttributeList *ParseMicrosoftDeclSpec(AttributeList* CurrAttr = 0);
AttributeList *ParseMicrosoftTypeAttributes(AttributeList* CurrAttr = 0);
void ParseTypeofSpecifier(DeclSpec &DS);
+ void ParseDecltypeSpecifier(DeclSpec &DS);
/// DeclaratorScopeObj - RAII object used in Parser::ParseDirectDeclarator to
/// enter a new C++ declarator scope and exit it when the function is
@@ -1190,7 +1193,7 @@ private:
TemplateArgLocationList &TemplateArgLocations,
SourceLocation &RAngleLoc);
- void AnnotateTemplateIdToken(TemplateTy Template, TemplateNameKind TNK,
+ bool AnnotateTemplateIdToken(TemplateTy Template, TemplateNameKind TNK,
const CXXScopeSpec *SS,
SourceLocation TemplateKWLoc = SourceLocation(),
bool AllowTypeAnnotation = true);
diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp
index b80142fef309..12f75ae863a2 100644
--- a/lib/AST/ASTContext.cpp
+++ b/lib/AST/ASTContext.cpp
@@ -179,6 +179,10 @@ void ASTContext::InitBuiltinTypes() {
// expressions.
InitBuiltinType(DependentTy, BuiltinType::Dependent);
+ // Placeholder type for C++0x auto declarations whose real type has
+ // not yet been deduced.
+ InitBuiltinType(UndeducedAutoTy, BuiltinType::UndeducedAuto);
+
// C99 6.2.5p11.
FloatComplexTy = getComplexType(FloatTy);
DoubleComplexTy = getComplexType(DoubleTy);
@@ -460,6 +464,10 @@ ASTContext::getTypeInfo(const Type *T) {
case Type::TypeOf:
return getTypeInfo(cast<TypeOfType>(T)->getUnderlyingType().getTypePtr());
+ case Type::Decltype:
+ return getTypeInfo(cast<DecltypeType>(T)->getUnderlyingExpr()->getType()
+ .getTypePtr());
+
case Type::QualifiedName:
return getTypeInfo(cast<QualifiedNameType>(T)->getNamedType().getTypePtr());
@@ -1659,6 +1667,50 @@ QualType ASTContext::getTypeOfType(QualType tofType) {
return QualType(tot, 0);
}
+/// getDecltypeForExpr - Given an expr, will return the decltype for that
+/// expression, according to the rules in C++0x [dcl.type.simple]p4
+static QualType getDecltypeForExpr(const Expr *e, ASTContext &Context) {
+ if (e->isTypeDependent())
+ return Context.DependentTy;
+
+ // If e is an id expression or a class member access, decltype(e) is defined
+ // as the type of the entity named by e.
+ if (const DeclRefExpr *DRE = dyn_cast<DeclRefExpr>(e)) {
+ if (const ValueDecl *VD = dyn_cast<ValueDecl>(DRE->getDecl()))
+ return VD->getType();
+ }
+ if (const MemberExpr *ME = dyn_cast<MemberExpr>(e)) {
+ if (const FieldDecl *FD = dyn_cast<FieldDecl>(ME->getMemberDecl()))
+ return FD->getType();
+ }
+ // If e is a function call or an invocation of an overloaded operator,
+ // (parentheses around e are ignored), decltype(e) is defined as the
+ // return type of that function.
+ if (const CallExpr *CE = dyn_cast<CallExpr>(e->IgnoreParens()))
+ return CE->getCallReturnType();
+
+ QualType T = e->getType();
+
+ // Otherwise, where T is the type of e, if e is an lvalue, decltype(e) is
+ // defined as T&, otherwise decltype(e) is defined as T.
+ if (e->isLvalue(Context) == Expr::LV_Valid)
+ T = Context.getLValueReferenceType(T);
+
+ return T;
+}
+
+/// getDecltypeType - Unlike many "get<Type>" functions, we don't unique
+/// DecltypeType AST's. The only motivation to unique these nodes would be
+/// memory savings. Since decltype(t) is fairly uncommon, space shouldn't be
+/// an issue. This doesn't effect the type checker, since it operates
+/// on canonical type's (which are always unique).
+QualType ASTContext::getDecltypeType(Expr *e) {
+ QualType T = getDecltypeForExpr(e, *this);
+ DecltypeType *dt = new (*this, 8) DecltypeType(e, getCanonicalType(T));
+ Types.push_back(dt);
+ return QualType(dt, 0);
+}
+
/// getTagDeclType - Return the unique reference to the type for the
/// specified TagDecl (struct/union/class/enum) decl.
QualType ASTContext::getTagDeclType(TagDecl *Decl) {
diff --git a/lib/AST/CFG.cpp b/lib/AST/CFG.cpp
index 9f2f2079a094..d7a830726fa4 100644
--- a/lib/AST/CFG.cpp
+++ b/lib/AST/CFG.cpp
@@ -22,9 +22,6 @@
#include "llvm/Support/Compiler.h"
#include <llvm/Support/Allocator.h>
#include <llvm/Support/Format.h>
-#include <iomanip>
-#include <algorithm>
-#include <sstream>
using namespace clang;
@@ -1887,7 +1884,8 @@ void CFG::viewCFG() const {
namespace llvm {
template<>
struct DOTGraphTraits<const CFG*> : public DefaultDOTGraphTraits {
- static std::string getNodeLabel(const CFGBlock* Node, const CFG* Graph) {
+ static std::string getNodeLabel(const CFGBlock* Node, const CFG* Graph,
+ bool ShortNames) {
#ifndef NDEBUG
std::string OutSStr;
diff --git a/lib/AST/Decl.cpp b/lib/AST/Decl.cpp
index 71e88a9efc49..5382ab52ab5b 100644
--- a/lib/AST/Decl.cpp
+++ b/lib/AST/Decl.cpp
@@ -269,6 +269,14 @@ bool NamedDecl::declarationReplaces(NamedDecl *OldD) const {
// For function declarations, we keep track of redeclarations.
return FD->getPreviousDeclaration() == OldD;
+ // For function templates, the underlying function declarations are linked.
+ if (const FunctionTemplateDecl *FunctionTemplate
+ = dyn_cast<FunctionTemplateDecl>(this))
+ if (const FunctionTemplateDecl *OldFunctionTemplate
+ = dyn_cast<FunctionTemplateDecl>(OldD))
+ return FunctionTemplate->getTemplatedDecl()
+ ->declarationReplaces(OldFunctionTemplate->getTemplatedDecl());
+
// For method declarations, we keep track of redeclarations.
if (isa<ObjCMethodDecl>(this))
return false;
@@ -289,6 +297,19 @@ bool NamedDecl::hasLinkage() const {
return false;
}
+NamedDecl *NamedDecl::getUnderlyingDecl() {
+ NamedDecl *ND = this;
+ while (true) {
+ if (UsingDecl *UD = dyn_cast<UsingDecl>(ND))
+ ND = UD->getTargetDecl();
+ else if (ObjCCompatibleAliasDecl *AD
+ = dyn_cast<ObjCCompatibleAliasDecl>(ND))
+ return AD->getClassInterface();
+ else
+ return ND;
+ }
+}
+
//===----------------------------------------------------------------------===//
// VarDecl Implementation
//===----------------------------------------------------------------------===//
@@ -351,6 +372,10 @@ void FunctionDecl::Destroy(ASTContext& C) {
C.Deallocate(ParamInfo);
+ if (TemplateSpecializationInfo *Info
+ = TemplateOrSpecialization.dyn_cast<TemplateSpecializationInfo*>())
+ C.Deallocate(Info);
+
Decl::Destroy(C);
}
@@ -547,6 +572,20 @@ OverloadedOperatorKind FunctionDecl::getOverloadedOperator() const {
return OO_None;
}
+void
+FunctionDecl::setFunctionTemplateSpecialization(ASTContext &Context,
+ FunctionTemplateDecl *Template,
+ const TemplateArgumentList *TemplateArgs) {
+ TemplateSpecializationInfo *Info
+ = TemplateOrSpecialization.dyn_cast<TemplateSpecializationInfo*>();
+ if (!Info)
+ Info = new (Context) TemplateSpecializationInfo;
+
+ Info->Template = Template;
+ Info->TemplateArguments = TemplateArgs;
+ TemplateOrSpecialization = Info;
+}
+
//===----------------------------------------------------------------------===//
// TagDecl Implementation
//===----------------------------------------------------------------------===//
diff --git a/lib/AST/DeclBase.cpp b/lib/AST/DeclBase.cpp
index 02e71d7a8681..5815d820aef6 100644
--- a/lib/AST/DeclBase.cpp
+++ b/lib/AST/DeclBase.cpp
@@ -96,6 +96,13 @@ bool Decl::isTemplateParameterPack() const {
return false;
}
+bool Decl::isFunctionOrFunctionTemplate() const {
+ if (const UsingDecl *UD = dyn_cast<UsingDecl>(this))
+ return UD->getTargetDecl()->isFunctionOrFunctionTemplate();
+
+ return isa<FunctionDecl>(this) || isa<FunctionTemplateDecl>(this);
+}
+
//===----------------------------------------------------------------------===//
// PrettyStackTraceDecl Implementation
//===----------------------------------------------------------------------===//
diff --git a/lib/AST/DeclCXX.cpp b/lib/AST/DeclCXX.cpp
index 25e4d1961778..752218db042a 100644
--- a/lib/AST/DeclCXX.cpp
+++ b/lib/AST/DeclCXX.cpp
@@ -420,6 +420,15 @@ OverloadedFunctionDecl::Create(ASTContext &C, DeclContext *DC,
return new (C) OverloadedFunctionDecl(DC, N);
}
+void OverloadedFunctionDecl::addOverload(FunctionTemplateDecl *FTD) {
+ Functions.push_back(FTD);
+
+ // An overloaded function declaration always has the location of
+ // the most-recently-added function declaration.
+ if (FTD->getLocation().isValid())
+ this->setLocation(FTD->getLocation());
+}
+
LinkageSpecDecl *LinkageSpecDecl::Create(ASTContext &C,
DeclContext *DC,
SourceLocation L,
diff --git a/lib/AST/Expr.cpp b/lib/AST/Expr.cpp
index 4a3ad2641ef4..fce88cc0da28 100644
--- a/lib/AST/Expr.cpp
+++ b/lib/AST/Expr.cpp
@@ -1496,7 +1496,7 @@ bool ExtVectorElementExpr::containsDuplicateElements() const {
return false;
// Advance past s-char prefix on hex swizzles.
- if (*compStr == 's') {
+ if (*compStr == 's' || *compStr == 'S') {
compStr++;
length--;
}
@@ -1514,7 +1514,7 @@ bool ExtVectorElementExpr::containsDuplicateElements() const {
void ExtVectorElementExpr::getEncodedElementAccess(
llvm::SmallVectorImpl<unsigned> &Elts) const {
const char *compStr = Accessor->getName();
- if (*compStr == 's')
+ if (*compStr == 's' || *compStr == 'S')
compStr++;
bool isHi = !strcmp(compStr, "hi");
diff --git a/lib/AST/ExprConstant.cpp b/lib/AST/ExprConstant.cpp
index 4815ae5c3b94..9d765924e02a 100644
--- a/lib/AST/ExprConstant.cpp
+++ b/lib/AST/ExprConstant.cpp
@@ -486,12 +486,28 @@ static bool EvaluateVector(const Expr* E, APValue& Result, EvalInfo &Info) {
APValue VectorExprEvaluator::VisitCastExpr(const CastExpr* E) {
const Expr* SE = E->getSubExpr();
+ QualType SETy = SE->getType();
+ APValue Result = APValue();
- // Check for vector->vector bitcast.
- if (SE->getType()->isVectorType())
+ // Check for vector->vector bitcast and scalar->vector splat.
+ if (SETy->isVectorType()) {
return this->Visit(const_cast<Expr*>(SE));
+ } else if (SETy->isIntegerType()) {
+ APSInt IntResult;
+ if (EvaluateInteger(SE, IntResult, Info))
+ Result = APValue(IntResult);
+ } else if (SETy->isRealFloatingType()) {
+ APFloat F(0.0);
+ if (EvaluateFloat(SE, F, Info))
+ Result = APValue(F);
+ }
- return APValue();
+ if (Result.isInt() || Result.isFloat()) {
+ unsigned NumElts = E->getType()->getAsVectorType()->getNumElements();
+ llvm::SmallVector<APValue, 4> Elts(NumElts, Result);
+ Result = APValue(&Elts[0], Elts.size());
+ }
+ return Result;
}
APValue
diff --git a/lib/AST/StmtViz.cpp b/lib/AST/StmtViz.cpp
index 1316d3551d91..96b5218ba2f0 100644
--- a/lib/AST/StmtViz.cpp
+++ b/lib/AST/StmtViz.cpp
@@ -31,7 +31,8 @@ void Stmt::viewAST() const {
namespace llvm {
template<>
struct DOTGraphTraits<const Stmt*> : public DefaultDOTGraphTraits {
- static std::string getNodeLabel(const Stmt* Node, const Stmt* Graph) {
+ static std::string getNodeLabel(const Stmt* Node, const Stmt* Graph,
+ bool ShortNames) {
#ifndef NDEBUG
std::string OutSStr;
diff --git a/lib/AST/Type.cpp b/lib/AST/Type.cpp
index 7b45b21e5d0c..41536612fec8 100644
--- a/lib/AST/Type.cpp
+++ b/lib/AST/Type.cpp
@@ -112,6 +112,8 @@ QualType Type::getDesugaredType(bool ForDisplay) const {
return TOE->getUnderlyingExpr()->getType().getDesugaredType();
if (const TypeOfType *TOT = dyn_cast<TypeOfType>(this))
return TOT->getUnderlyingType().getDesugaredType();
+ if (const DecltypeType *DTT = dyn_cast<DecltypeType>(this))
+ return DTT->getUnderlyingExpr()->getType().getDesugaredType();
if (const TemplateSpecializationType *Spec
= dyn_cast<TemplateSpecializationType>(this)) {
if (ForDisplay)
@@ -962,6 +964,7 @@ const char *BuiltinType::getName(bool CPlusPlus) const {
case NullPtr: return "nullptr_t";
case Overload: return "<overloaded function type>";
case Dependent: return "<dependent type>";
+ case UndeducedAuto: return "<undeduced auto type>";
}
}
@@ -1052,6 +1055,13 @@ TypeOfExprType::TypeOfExprType(Expr *E, QualType can)
assert(!isa<TypedefType>(can) && "Invalid canonical type");
}
+DecltypeType::DecltypeType(Expr *E, QualType can)
+ : Type(Decltype, can, E->isTypeDependent()), E(E) {
+ assert(can->isDependentType() == E->isTypeDependent() &&
+ "type dependency mismatch!");
+ assert(!isa<TypedefType>(can) && "Invalid canonical type");
+}
+
TagType::TagType(TypeClass TC, TagDecl *D, QualType can)
: Type(TC, can, D->isDependentType()), decl(D, 0) {}
@@ -1421,6 +1431,16 @@ void TypeOfType::getAsStringInternal(std::string &InnerString, const PrintingPol
InnerString = "typeof(" + Tmp + ")" + InnerString;
}
+void DecltypeType::getAsStringInternal(std::string &InnerString,
+ const PrintingPolicy &Policy) const {
+ if (!InnerString.empty()) // Prefix the basic type, e.g. 'decltype(t) X'.
+ InnerString = ' ' + InnerString;
+ std::string Str;
+ llvm::raw_string_ostream s(Str);
+ getUnderlyingExpr()->printPretty(s, 0, Policy);
+ InnerString = "decltype(" + s.str() + ")" + InnerString;
+}
+
void FunctionNoProtoType::getAsStringInternal(std::string &S, const PrintingPolicy &Policy) const {
// If needed for precedence reasons, wrap the inner part in grouping parens.
if (!S.empty())
diff --git a/lib/Analysis/BasicConstraintManager.cpp b/lib/Analysis/BasicConstraintManager.cpp
index ffa8a8625bdf..cb89d3065107 100644
--- a/lib/Analysis/BasicConstraintManager.cpp
+++ b/lib/Analysis/BasicConstraintManager.cpp
@@ -83,7 +83,7 @@ public:
const GRState* RemoveDeadBindings(const GRState* state, SymbolReaper& SymReaper);
- void print(const GRState* state, std::ostream& Out,
+ void print(const GRState* state, llvm::raw_ostream& Out,
const char* nl, const char *sep);
};
@@ -280,7 +280,7 @@ BasicConstraintManager::RemoveDeadBindings(const GRState* state,
return state->set<ConstNotEq>(CNE);
}
-void BasicConstraintManager::print(const GRState* state, std::ostream& Out,
+void BasicConstraintManager::print(const GRState* state, llvm::raw_ostream& Out,
const char* nl, const char *sep) {
// Print equality constraints.
@@ -288,12 +288,8 @@ void BasicConstraintManager::print(const GRState* state, std::ostream& Out,
if (!CE.isEmpty()) {
Out << nl << sep << "'==' constraints:";
-
- for (ConstEqTy::iterator I = CE.begin(), E = CE.end(); I!=E; ++I) {
- Out << nl << " $" << I.getKey();
- llvm::raw_os_ostream OS(Out);
- OS << " : " << *I.getData();
- }
+ for (ConstEqTy::iterator I = CE.begin(), E = CE.end(); I!=E; ++I)
+ Out << nl << " $" << I.getKey() << " : " << *I.getData();
}
// Print != constraints.
diff --git a/lib/Analysis/BasicStore.cpp b/lib/Analysis/BasicStore.cpp
index 6b346cd52557..8fbce528fa9a 100644
--- a/lib/Analysis/BasicStore.cpp
+++ b/lib/Analysis/BasicStore.cpp
@@ -112,7 +112,8 @@ public:
return BindingsTy(static_cast<const BindingsTy::TreeTy*>(store));
}
- void print(Store store, std::ostream& Out, const char* nl, const char *sep);
+ void print(Store store, llvm::raw_ostream& Out, const char* nl,
+ const char *sep);
private:
ASTContext& getContext() { return StateMgr.getContext(); }
@@ -535,7 +536,7 @@ Store BasicStoreManager::getInitialStore() {
// Initialize globals and parameters to symbolic values.
// Initialize local variables to undefined.
- const MemRegion *R = StateMgr.getRegion(VD);
+ const MemRegion *R = ValMgr.getRegionManager().getVarRegion(VD);
SVal X = (VD->hasGlobalStorage() || isa<ParmVarDecl>(VD) ||
isa<ImplicitParamDecl>(VD))
? ValMgr.getRegionValueSymbolVal(R)
@@ -602,18 +603,19 @@ Store BasicStoreManager::BindDeclInternal(Store store, const VarDecl* VD,
return store;
}
-void BasicStoreManager::print(Store store, std::ostream& O,
+void BasicStoreManager::print(Store store, llvm::raw_ostream& Out,
const char* nl, const char *sep) {
- llvm::raw_os_ostream Out(O);
BindingsTy B = GetBindings(store);
Out << "Variables:" << nl;
bool isFirst = true;
for (BindingsTy::iterator I=B.begin(), E=B.end(); I != E; ++I) {
- if (isFirst) isFirst = false;
- else Out << nl;
+ if (isFirst)
+ isFirst = false;
+ else
+ Out << nl;
Out << ' ' << I.getKey() << " : ";
I.getData().print(Out);
diff --git a/lib/Analysis/BugReporter.cpp b/lib/Analysis/BugReporter.cpp
index 9c9029cfff34..38ea458a6599 100644
--- a/lib/Analysis/BugReporter.cpp
+++ b/lib/Analysis/BugReporter.cpp
@@ -8,7 +8,7 @@
//===----------------------------------------------------------------------===//
//
// This file defines BugReporter, a utility class for generating
-// PathDiagnostics for analyses based on GRSimpleVals.
+// PathDiagnostics.
//
//===----------------------------------------------------------------------===//
diff --git a/lib/Analysis/CFRefCount.cpp b/lib/Analysis/CFRefCount.cpp
index 46333a74f27d..f4a28e0c19fd 100644
--- a/lib/Analysis/CFRefCount.cpp
+++ b/lib/Analysis/CFRefCount.cpp
@@ -12,7 +12,6 @@
//
//===----------------------------------------------------------------------===//
-#include "GRSimpleVals.h"
#include "clang/Basic/LangOptions.h"
#include "clang/Basic/SourceManager.h"
#include "clang/Analysis/PathSensitive/GRExprEngineBuilders.h"
@@ -22,6 +21,7 @@
#include "clang/Analysis/PathDiagnostic.h"
#include "clang/Analysis/PathSensitive/BugReporter.h"
#include "clang/Analysis/PathSensitive/SymbolManager.h"
+#include "clang/Analysis/PathSensitive/GRTransferFuncs.h"
#include "clang/AST/DeclObjC.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/FoldingSet.h"
@@ -30,7 +30,6 @@
#include "llvm/ADT/StringExtras.h"
#include "llvm/Support/Compiler.h"
#include "llvm/ADT/STLExtras.h"
-#include <ostream>
#include <stdarg.h>
using namespace clang;
@@ -1674,10 +1673,10 @@ public:
ID.Add(T);
}
- void print(std::ostream& Out) const;
+ void print(llvm::raw_ostream& Out) const;
};
-void RefVal::print(std::ostream& Out) const {
+void RefVal::print(llvm::raw_ostream& Out) const {
if (!T.isNull())
Out << "Tracked Type:" << T.getAsString() << '\n';
@@ -1827,11 +1826,11 @@ static const GRState * SendAutorelease(const GRState *state,
namespace {
-class VISIBILITY_HIDDEN CFRefCount : public GRSimpleVals {
+class VISIBILITY_HIDDEN CFRefCount : public GRTransferFuncs {
public:
class BindingsPrinter : public GRState::Printer {
public:
- virtual void Print(std::ostream& Out, const GRState* state,
+ virtual void Print(llvm::raw_ostream& Out, const GRState* state,
const char* nl, const char* sep);
};
@@ -1959,7 +1958,8 @@ public:
} // end anonymous namespace
-static void PrintPool(std::ostream &Out, SymbolRef Sym, const GRState *state) {
+static void PrintPool(llvm::raw_ostream &Out, SymbolRef Sym,
+ const GRState *state) {
Out << ' ';
if (Sym)
Out << Sym->getSymbolID();
@@ -1975,10 +1975,9 @@ static void PrintPool(std::ostream &Out, SymbolRef Sym, const GRState *state) {
Out << '}';
}
-void CFRefCount::BindingsPrinter::Print(std::ostream& Out, const GRState* state,
+void CFRefCount::BindingsPrinter::Print(llvm::raw_ostream& Out,
+ const GRState* state,
const char* nl, const char* sep) {
-
-
RefBindings B = state->get<RefBindings>();
@@ -2790,10 +2789,7 @@ void CFRefCount::EvalSummary(ExplodedNodeSet<GRState>& Dst,
if (Summ.getArg(idx) == DoNothingByRef)
continue;
- // Invalidate the value of the variable passed by reference.
-
- // FIXME: Either this logic should also be replicated in GRSimpleVals
- // or should be pulled into a separate "constraint engine."
+ // Invalidate the value of the variable passed by reference.
// FIXME: We can have collisions on the conjured symbol if the
// expression *I also creates conjured symbols. We probably want
@@ -2942,11 +2938,10 @@ void CFRefCount::EvalSummary(ExplodedNodeSet<GRState>& Dst,
default:
assert (false && "Unhandled RetEffect."); break;
- case RetEffect::NoRet: {
-
+ case RetEffect::NoRet: {
// Make up a symbol for the return value (not reference counted).
- // FIXME: This is basically copy-and-paste from GRSimpleVals. We
- // should compose behavior, not copy it.
+ // FIXME: Most of this logic is not specific to the retain/release
+ // checker.
// FIXME: We eventually should handle structs and other compound types
// that are returned by value.
@@ -3091,7 +3086,7 @@ void CFRefCount::EvalObjCMessageExpr(ExplodedNodeSet<GRState>& Dst,
if (Expr* Receiver = ME->getReceiver()) {
SVal X = St->getSValAsScalarOrLoc(Receiver);
if (loc::MemRegionVal* L = dyn_cast<loc::MemRegionVal>(&X))
- if (L->getRegion() == Eng.getStateManager().getSelfRegion(St)) {
+ if (L->getRegion() == St->getSelfRegion()) {
// Update the summary to make the default argument effect
// 'StopTracking'.
Summ = Summaries.copySummary(Summ);
diff --git a/lib/Analysis/CMakeLists.txt b/lib/Analysis/CMakeLists.txt
index e064e3c71a83..7d6a619736e0 100644
--- a/lib/Analysis/CMakeLists.txt
+++ b/lib/Analysis/CMakeLists.txt
@@ -18,15 +18,14 @@ add_clang_library(clangAnalysis
GRCoreEngine.cpp
GRExprEngine.cpp
GRExprEngineInternalChecks.cpp
- GRSimpleVals.cpp
GRState.cpp
- GRTransferFuncs.cpp
LiveVariables.cpp
MemRegion.cpp
PathDiagnostic.cpp
RangeConstraintManager.cpp
RegionStore.cpp
SimpleConstraintManager.cpp
+ SimpleSValuator.cpp
Store.cpp
SVals.cpp
SymbolManager.cpp
diff --git a/lib/Analysis/CheckObjCUnusedIVars.cpp b/lib/Analysis/CheckObjCUnusedIVars.cpp
index 92c50e2a9185..21dc658dfa1a 100644
--- a/lib/Analysis/CheckObjCUnusedIVars.cpp
+++ b/lib/Analysis/CheckObjCUnusedIVars.cpp
@@ -20,7 +20,6 @@
#include "clang/AST/Expr.h"
#include "clang/AST/DeclObjC.h"
#include "clang/Basic/LangOptions.h"
-#include <sstream>
using namespace clang;
@@ -97,8 +96,8 @@ void clang::CheckObjCUnusedIvar(ObjCImplementationDecl* D, BugReporter& BR) {
// Find ivars that are unused.
for (IvarUsageMap::iterator I = M.begin(), E = M.end(); I!=E; ++I)
if (I->second == Unused) {
-
- std::ostringstream os;
+ std::string sbuf;
+ llvm::raw_string_ostream os(sbuf);
os << "Instance variable '" << I->first->getNameAsString()
<< "' in class '" << ID->getNameAsString()
<< "' is never used by the methods in its @implementation "
diff --git a/lib/Analysis/GRExprEngine.cpp b/lib/Analysis/GRExprEngine.cpp
index 7d56d108debe..8b4f5c8f11c1 100644
--- a/lib/Analysis/GRExprEngine.cpp
+++ b/lib/Analysis/GRExprEngine.cpp
@@ -15,7 +15,6 @@
#include "clang/Analysis/PathSensitive/GRExprEngine.h"
#include "clang/Analysis/PathSensitive/GRExprEngineBuilders.h"
-#include "clang/Analysis/PathSensitive/BugReporter.h"
#include "clang/AST/ParentMap.h"
#include "clang/AST/StmtObjC.h"
#include "clang/Basic/Builtins.h"
@@ -29,7 +28,6 @@
#ifndef NDEBUG
#include "llvm/Support/GraphWriter.h"
-#include <sstream>
#endif
using namespace clang;
@@ -126,6 +124,7 @@ GRExprEngine::GRExprEngine(CFG& cfg, Decl& CD, ASTContext& Ctx,
StateMgr(G.getContext(), SMC, CMC, G.getAllocator(), cfg, CD, L),
SymMgr(StateMgr.getSymbolManager()),
ValMgr(StateMgr.getValueManager()),
+ SVator(clang::CreateSimpleSValuator(ValMgr)), // FIXME: Generalize later.
CurrentStmt(NULL),
NSExceptionII(NULL), NSExceptionInstanceRaiseSelectors(NULL),
RaiseSel(GetNullarySelector("raise", G.getContext())),
@@ -176,7 +175,7 @@ const GRState* GRExprEngine::getInitialState() {
const ParmVarDecl *PD = FD->getParamDecl(0);
QualType T = PD->getType();
if (T->isIntegerType())
- if (const MemRegion *R = StateMgr.getRegion(PD)) {
+ if (const MemRegion *R = state->getRegion(PD)) {
SVal V = state->getSVal(loc::MemRegionVal(R));
SVal Constraint = EvalBinOp(state, BinaryOperator::GT, V,
ValMgr.makeZeroVal(T),
@@ -1046,7 +1045,7 @@ void GRExprEngine::EvalBind(NodeSet& Dst, Expr* Ex, NodeTy* Pred,
else {
// We are binding to a value other than 'unknown'. Perform the binding
// using the StoreManager.
- newState = StateMgr.BindLoc(state, cast<Loc>(location), Val);
+ newState = state->bindLoc(cast<Loc>(location), Val);
}
// The next thing to do is check if the GRTransferFuncs object wants to
@@ -1296,9 +1295,8 @@ static bool EvalOSAtomicCompareAndSwap(ExplodedNodeSet<GRState>& Dst,
SVal oldValueVal = stateLoad->getSVal(oldValueExpr);
// Perform the comparison.
- SVal Cmp = Engine.EvalBinOp(stateLoad,
- BinaryOperator::EQ, theValueVal, oldValueVal,
- Engine.getContext().IntTy);
+ SVal Cmp = Engine.EvalBinOp(stateLoad, BinaryOperator::EQ, theValueVal,
+ oldValueVal, Engine.getContext().IntTy);
const GRState *stateEqual = stateLoad->assume(Cmp, true);
@@ -2247,17 +2245,17 @@ void GRExprEngine::VisitDeclStmt(DeclStmt* DS, NodeTy* Pred, NodeSet& Dst) {
InitVal = ValMgr.getConjuredSymbolVal(InitEx, Count);
}
- state = StateMgr.BindDecl(state, VD, InitVal);
+ state = state->bindDecl(VD, InitVal);
// The next thing to do is check if the GRTransferFuncs object wants to
// update the state based on the new binding. If the GRTransferFunc
// object doesn't do anything, just auto-propagate the current state.
GRStmtNodeBuilderRef BuilderRef(Dst, *Builder, *this, *I, state, DS,true);
- getTF().EvalBind(BuilderRef, loc::MemRegionVal(StateMgr.getRegion(VD)),
+ getTF().EvalBind(BuilderRef, loc::MemRegionVal(state->getRegion(VD)),
InitVal);
}
else {
- state = StateMgr.BindDeclWithNoInit(state, VD);
+ state = state->bindDeclWithNoInit(VD);
MakeNode(Dst, DS, *I, state);
}
}
@@ -2562,7 +2560,7 @@ void GRExprEngine::VisitUnaryOperator(UnaryOperator* U, NodeTy* Pred,
case UnaryOperator::Minus:
// FIXME: Do we need to handle promotions?
- state = state->bindExpr(U, EvalMinus(U, cast<NonLoc>(V)));
+ state = state->bindExpr(U, EvalMinus(cast<NonLoc>(V)));
break;
case UnaryOperator::LNot:
@@ -2571,25 +2569,21 @@ void GRExprEngine::VisitUnaryOperator(UnaryOperator* U, NodeTy* Pred,
//
// Note: technically we do "E == 0", but this is the same in the
// transfer functions as "0 == E".
+ SVal Result;
if (isa<Loc>(V)) {
Loc X = ValMgr.makeNull();
- SVal Result = EvalBinOp(state,BinaryOperator::EQ, cast<Loc>(V), X,
- U->getType());
- state = state->bindExpr(U, Result);
+ Result = EvalBinOp(state, BinaryOperator::EQ, cast<Loc>(V), X,
+ U->getType());
}
else {
nonloc::ConcreteInt X(getBasicVals().getValue(0, Ex->getType()));
-#if 0
- SVal Result = EvalBinOp(BinaryOperator::EQ, cast<NonLoc>(V), X);
- state = SetSVal(state, U, Result);
-#else
- EvalBinOp(Dst, U, BinaryOperator::EQ, cast<NonLoc>(V), X, *I,
- U->getType());
- continue;
-#endif
+ Result = EvalBinOp(BinaryOperator::EQ, cast<NonLoc>(V), X,
+ U->getType());
}
+ state = state->bindExpr(U, Result);
+
break;
}
@@ -2640,8 +2634,8 @@ void GRExprEngine::VisitUnaryOperator(UnaryOperator* U, NodeTy* Pred,
Builder->getCurrentBlockCount());
// If the value is a location, ++/-- should always preserve
- // non-nullness. Check if the original value was non-null, and if so propagate
- // that constraint.
+ // non-nullness. Check if the original value was non-null, and if so
+ // propagate that constraint.
if (Loc::IsLocType(U->getType())) {
SVal Constraint = EvalBinOp(state, BinaryOperator::EQ, V2,
ValMgr.makeZeroVal(U->getType()),
@@ -2907,9 +2901,8 @@ void GRExprEngine::VisitBinaryOperator(BinaryOperator* B,
if (B->isAssignmentOp())
break;
- // Process non-assignements except commas or short-circuited
- // logical expressions (LAnd and LOr).
-
+ // Process non-assignments except commas or short-circuited
+ // logical expressions (LAnd and LOr).
SVal Result = EvalBinOp(state, Op, LeftV, RightV, B->getType());
if (Result.isUnknown()) {
@@ -3024,7 +3017,7 @@ void GRExprEngine::VisitBinaryOperator(BinaryOperator* B,
}
// Compute the result of the operation.
- SVal Result = EvalCast(EvalBinOp(state, Op, V, RightV, CTy),
+ SVal Result = EvalCast(EvalBinOp(state, Op, V, RightV, CTy),
B->getType());
if (Result.isUndef()) {
@@ -3073,26 +3066,6 @@ void GRExprEngine::VisitBinaryOperator(BinaryOperator* B,
// Transfer-function Helpers.
//===----------------------------------------------------------------------===//
-void GRExprEngine::EvalBinOp(ExplodedNodeSet<GRState>& Dst, Expr* Ex,
- BinaryOperator::Opcode Op,
- NonLoc L, NonLoc R,
- ExplodedNode<GRState>* Pred, QualType T) {
-
- GRStateSet OStates;
- EvalBinOp(OStates, GetState(Pred), Ex, Op, L, R, T);
-
- for (GRStateSet::iterator I=OStates.begin(), E=OStates.end(); I!=E; ++I)
- MakeNode(Dst, Ex, Pred, *I);
-}
-
-void GRExprEngine::EvalBinOp(GRStateSet& OStates, const GRState* state,
- Expr* Ex, BinaryOperator::Opcode Op,
- NonLoc L, NonLoc R, QualType T) {
-
- GRStateSet::AutoPopulate AP(OStates, state);
- if (R.isValid()) getTF().EvalBinOpNN(OStates, *this, state, Ex, Op, L, R, T);
-}
-
SVal GRExprEngine::EvalBinOp(const GRState* state, BinaryOperator::Opcode Op,
SVal L, SVal R, QualType T) {
@@ -3104,9 +3077,9 @@ SVal GRExprEngine::EvalBinOp(const GRState* state, BinaryOperator::Opcode Op,
if (isa<Loc>(L)) {
if (isa<Loc>(R))
- return getTF().EvalBinOp(*this, Op, cast<Loc>(L), cast<Loc>(R));
+ return SVator->EvalBinOpLL(Op, cast<Loc>(L), cast<Loc>(R), T);
else
- return getTF().EvalBinOp(*this, state, Op, cast<Loc>(L), cast<NonLoc>(R));
+ return SVator->EvalBinOpLN(state, Op, cast<Loc>(L), cast<NonLoc>(R), T);
}
if (isa<Loc>(R)) {
@@ -3116,11 +3089,10 @@ SVal GRExprEngine::EvalBinOp(const GRState* state, BinaryOperator::Opcode Op,
assert (Op == BinaryOperator::Add || Op == BinaryOperator::Sub);
// Commute the operands.
- return getTF().EvalBinOp(*this, state, Op, cast<Loc>(R), cast<NonLoc>(L));
+ return SVator->EvalBinOpLN(state, Op, cast<Loc>(R), cast<NonLoc>(L), T);
}
else
- return getTF().DetermEvalBinOpNN(*this, Op, cast<NonLoc>(L),
- cast<NonLoc>(R), T);
+ return SVator->EvalBinOpNN(Op, cast<NonLoc>(L), cast<NonLoc>(R), T);
}
//===----------------------------------------------------------------------===//
@@ -3156,8 +3128,11 @@ struct VISIBILITY_HIDDEN DOTGraphTraits<GRExprEngine::NodeTy*> :
return "";
}
- static std::string getNodeLabel(const GRExprEngine::NodeTy* N, void*) {
- std::ostringstream Out;
+ static std::string getNodeLabel(const GRExprEngine::NodeTy* N, void*,
+ bool ShortNames) {
+
+ std::string sbuf;
+ llvm::raw_string_ostream Out(sbuf);
// Program Location.
ProgramPoint Loc = N->getLocation();
@@ -3179,9 +3154,7 @@ struct VISIBILITY_HIDDEN DOTGraphTraits<GRExprEngine::NodeTy*> :
SourceLocation SLoc = S->getLocStart();
Out << S->getStmtClassName() << ' ' << (void*) S << ' ';
- llvm::raw_os_ostream OutS(Out);
- S->printPretty(OutS);
- OutS.flush();
+ S->printPretty(Out);
if (SLoc.isFileID()) {
Out << "\\lline="
@@ -3235,10 +3208,7 @@ struct VISIBILITY_HIDDEN DOTGraphTraits<GRExprEngine::NodeTy*> :
SourceLocation SLoc = T->getLocStart();
Out << "\\|Terminator: ";
-
- llvm::raw_os_ostream OutS(Out);
- E.getSrc()->printTerminator(OutS);
- OutS.flush();
+ E.getSrc()->printTerminator(Out);
if (SLoc.isFileID()) {
Out << "\\lline="
@@ -3253,14 +3223,11 @@ struct VISIBILITY_HIDDEN DOTGraphTraits<GRExprEngine::NodeTy*> :
if (Label) {
if (CaseStmt* C = dyn_cast<CaseStmt>(Label)) {
Out << "\\lcase ";
- llvm::raw_os_ostream OutS(Out);
- C->getLHS()->printPretty(OutS);
- OutS.flush();
+ C->getLHS()->printPretty(Out);
if (Stmt* RHS = C->getRHS()) {
Out << " .. ";
- RHS->printPretty(OutS);
- OutS.flush();
+ RHS->printPretty(Out);
}
Out << ":";
diff --git a/lib/Analysis/GRExprEngineInternalChecks.cpp b/lib/Analysis/GRExprEngineInternalChecks.cpp
index 13df89ebbfdc..76d26dd9f02a 100644
--- a/lib/Analysis/GRExprEngineInternalChecks.cpp
+++ b/lib/Analysis/GRExprEngineInternalChecks.cpp
@@ -672,7 +672,6 @@ public:
return NULL;
if (!StoreSite) {
- GRStateManager &StateMgr = BRC.getStateManager();
const ExplodedNode<GRState> *Node = N, *Last = NULL;
for ( ; Node ; Last = Node, Node = Node->getFirstPred()) {
@@ -686,7 +685,7 @@ public:
}
}
- if (StateMgr.GetSVal(Node->getState(), R) != V)
+ if (Node->getState()->getSVal(R) != V)
break;
}
diff --git a/lib/Analysis/GRSimpleVals.cpp b/lib/Analysis/GRSimpleVals.cpp
deleted file mode 100644
index 480612113d10..000000000000
--- a/lib/Analysis/GRSimpleVals.cpp
+++ /dev/null
@@ -1,415 +0,0 @@
-// GRSimpleVals.cpp - Transfer functions for tracking simple values -*- C++ -*--
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines GRSimpleVals, a sub-class of GRTransferFuncs that
-// provides transfer functions for performing simple value tracking with
-// limited support for symbolics.
-//
-//===----------------------------------------------------------------------===//
-
-#include "GRSimpleVals.h"
-#include "BasicObjCFoundationChecks.h"
-#include "clang/Basic/SourceManager.h"
-#include "clang/Analysis/PathDiagnostic.h"
-#include "clang/Analysis/PathSensitive/GRState.h"
-#include "clang/Analysis/PathSensitive/BugReporter.h"
-#include "clang/Analysis/LocalCheckers.h"
-#include "clang/Analysis/PathSensitive/GRExprEngine.h"
-#include "llvm/Support/Compiler.h"
-#include <sstream>
-
-using namespace clang;
-
-//===----------------------------------------------------------------------===//
-// Transfer Function creation for External clients.
-//===----------------------------------------------------------------------===//
-
-GRTransferFuncs* clang::MakeGRSimpleValsTF() { return new GRSimpleVals(); }
-
-//===----------------------------------------------------------------------===//
-// Transfer function for Casts.
-//===----------------------------------------------------------------------===//
-
-SVal GRSimpleVals::EvalCast(GRExprEngine& Eng, NonLoc X, QualType T) {
-
- if (!isa<nonloc::ConcreteInt>(X))
- return UnknownVal();
-
- bool isLocType = Loc::IsLocType(T);
-
- // Only handle casts from integers to integers.
- if (!isLocType && !T->isIntegerType())
- return UnknownVal();
-
- BasicValueFactory& BasicVals = Eng.getBasicVals();
-
- llvm::APSInt V = cast<nonloc::ConcreteInt>(X).getValue();
- V.setIsUnsigned(T->isUnsignedIntegerType() || Loc::IsLocType(T));
- V.extOrTrunc(Eng.getContext().getTypeSize(T));
-
- if (isLocType)
- return loc::ConcreteInt(BasicVals.getValue(V));
- else
- return nonloc::ConcreteInt(BasicVals.getValue(V));
-}
-
-// Casts.
-
-SVal GRSimpleVals::EvalCast(GRExprEngine& Eng, Loc X, QualType T) {
-
- // Casts from pointers -> pointers, just return the lval.
- //
- // Casts from pointers -> references, just return the lval. These
- // can be introduced by the frontend for corner cases, e.g
- // casting from va_list* to __builtin_va_list&.
- //
- assert (!X.isUnknownOrUndef());
-
- if (Loc::IsLocType(T) || T->isReferenceType())
- return X;
-
- // FIXME: Handle transparent unions where a value can be "transparently"
- // lifted into a union type.
- if (T->isUnionType())
- return UnknownVal();
-
- assert (T->isIntegerType());
- BasicValueFactory& BasicVals = Eng.getBasicVals();
- unsigned BitWidth = Eng.getContext().getTypeSize(T);
-
- if (!isa<loc::ConcreteInt>(X))
- return Eng.getValueManager().makeLocAsInteger(X, BitWidth);
-
- llvm::APSInt V = cast<loc::ConcreteInt>(X).getValue();
- V.setIsUnsigned(T->isUnsignedIntegerType() || Loc::IsLocType(T));
- V.extOrTrunc(BitWidth);
- return nonloc::ConcreteInt(BasicVals.getValue(V));
-}
-
-// Unary operators.
-
-SVal GRSimpleVals::EvalMinus(GRExprEngine& Eng, UnaryOperator* U, NonLoc X){
-
- switch (X.getSubKind()) {
-
- case nonloc::ConcreteIntKind:
- return cast<nonloc::ConcreteInt>(X).EvalMinus(Eng.getBasicVals(), U);
-
- default:
- return UnknownVal();
- }
-}
-
-SVal GRSimpleVals::EvalComplement(GRExprEngine& Eng, NonLoc X) {
-
- switch (X.getSubKind()) {
-
- case nonloc::ConcreteIntKind:
- return cast<nonloc::ConcreteInt>(X).EvalComplement(Eng.getBasicVals());
-
- default:
- return UnknownVal();
- }
-}
-
-// Binary operators.
-
-static unsigned char LNotOpMap[] = {
- (unsigned char) BinaryOperator::GE, /* LT => GE */
- (unsigned char) BinaryOperator::LE, /* GT => LE */
- (unsigned char) BinaryOperator::GT, /* LE => GT */
- (unsigned char) BinaryOperator::LT, /* GE => LT */
- (unsigned char) BinaryOperator::NE, /* EQ => NE */
- (unsigned char) BinaryOperator::EQ /* NE => EQ */
-};
-
-SVal GRSimpleVals::DetermEvalBinOpNN(GRExprEngine& Eng,
- BinaryOperator::Opcode Op,
- NonLoc L, NonLoc R,
- QualType T) {
- BasicValueFactory& BasicVals = Eng.getBasicVals();
- ValueManager& ValMgr = Eng.getValueManager();
- unsigned subkind = L.getSubKind();
-
- while (1) {
-
- switch (subkind) {
- default:
- return UnknownVal();
-
- case nonloc::LocAsIntegerKind: {
- Loc LL = cast<nonloc::LocAsInteger>(L).getLoc();
-
- switch (R.getSubKind()) {
- case nonloc::LocAsIntegerKind:
- return EvalBinOp(Eng, Op, LL,
- cast<nonloc::LocAsInteger>(R).getLoc());
-
- case nonloc::ConcreteIntKind: {
- // Transform the integer into a location and compare.
- ASTContext& Ctx = Eng.getContext();
- llvm::APSInt V = cast<nonloc::ConcreteInt>(R).getValue();
- V.setIsUnsigned(true);
- V.extOrTrunc(Ctx.getTypeSize(Ctx.VoidPtrTy));
- return EvalBinOp(Eng, Op, LL, ValMgr.makeLoc(V));
- }
-
- default:
- switch (Op) {
- case BinaryOperator::EQ:
- return ValMgr.makeTruthVal(false);
- case BinaryOperator::NE:
- return ValMgr.makeTruthVal(true);
- default:
- // This case also handles pointer arithmetic.
- return UnknownVal();
- }
- }
- }
-
- case nonloc::SymExprValKind: {
- // Logical not?
- if (!(Op == BinaryOperator::EQ && R.isZeroConstant()))
- return UnknownVal();
-
- const SymExpr &SE=*cast<nonloc::SymExprVal>(L).getSymbolicExpression();
-
- // Only handle ($sym op constant) for now.
- if (const SymIntExpr *E = dyn_cast<SymIntExpr>(&SE)) {
- BinaryOperator::Opcode Opc = E->getOpcode();
-
- if (Opc < BinaryOperator::LT || Opc > BinaryOperator::NE)
- return UnknownVal();
-
- // For comparison operators, translate the constraint by
- // changing the opcode.
- int idx = (unsigned) Opc - (unsigned) BinaryOperator::LT;
-
- assert (idx >= 0 &&
- (unsigned) idx < sizeof(LNotOpMap)/sizeof(unsigned char));
-
- Opc = (BinaryOperator::Opcode) LNotOpMap[idx];
- assert(E->getType(Eng.getContext()) == T);
- E = Eng.getSymbolManager().getSymIntExpr(E->getLHS(), Opc,
- E->getRHS(), T);
- return nonloc::SymExprVal(E);
- }
-
- return UnknownVal();
- }
-
- case nonloc::ConcreteIntKind:
-
- if (isa<nonloc::ConcreteInt>(R)) {
- const nonloc::ConcreteInt& L_CI = cast<nonloc::ConcreteInt>(L);
- const nonloc::ConcreteInt& R_CI = cast<nonloc::ConcreteInt>(R);
- return L_CI.EvalBinOp(BasicVals, Op, R_CI);
- }
- else {
- subkind = R.getSubKind();
- NonLoc tmp = R;
- R = L;
- L = tmp;
-
- // Swap the operators.
- switch (Op) {
- case BinaryOperator::LT: Op = BinaryOperator::GT; break;
- case BinaryOperator::GT: Op = BinaryOperator::LT; break;
- case BinaryOperator::LE: Op = BinaryOperator::GE; break;
- case BinaryOperator::GE: Op = BinaryOperator::LE; break;
- default: break;
- }
-
- continue;
- }
-
- case nonloc::SymbolValKind:
- if (isa<nonloc::ConcreteInt>(R)) {
- ValueManager &ValMgr = Eng.getValueManager();
- return ValMgr.makeNonLoc(cast<nonloc::SymbolVal>(L).getSymbol(), Op,
- cast<nonloc::ConcreteInt>(R).getValue(), T);
- }
- else
- return UnknownVal();
- }
- }
-}
-
-
-// Binary Operators (except assignments and comma).
-
-SVal GRSimpleVals::EvalBinOp(GRExprEngine& Eng, BinaryOperator::Opcode Op,
- Loc L, Loc R) {
-
- switch (Op) {
- default:
- return UnknownVal();
- case BinaryOperator::EQ:
- case BinaryOperator::NE:
- return EvalEquality(Eng, L, R, Op == BinaryOperator::EQ);
- }
-}
-
-SVal GRSimpleVals::EvalBinOp(GRExprEngine& Eng, const GRState *state,
- BinaryOperator::Opcode Op, Loc L, NonLoc R) {
-
- // Special case: 'R' is an integer that has the same width as a pointer and
- // we are using the integer location in a comparison. Normally this cannot be
- // triggered, but transfer functions like those for OSCommpareAndSwapBarrier32
- // can generate comparisons that trigger this code.
- // FIXME: Are all locations guaranteed to have pointer width?
- if (BinaryOperator::isEqualityOp(Op)) {
- if (nonloc::ConcreteInt *RInt = dyn_cast<nonloc::ConcreteInt>(&R)) {
- const llvm::APSInt *X = &RInt->getValue();
- ASTContext &C = Eng.getContext();
- if (C.getTypeSize(C.VoidPtrTy) == X->getBitWidth()) {
- // Convert the signedness of the integer (if necessary).
- if (X->isSigned())
- X = &Eng.getBasicVals().getValue(*X, true);
-
- return EvalBinOp(Eng, Op, L, loc::ConcreteInt(*X));
- }
- }
- }
-
- // Delegate pointer arithmetic to store manager.
- return Eng.getStoreManager().EvalBinOp(state, Op, L, R);
-}
-
-// Equality operators for Locs.
-// FIXME: All this logic will be revamped when we have MemRegion::getLocation()
-// implemented.
-
-SVal GRSimpleVals::EvalEquality(GRExprEngine& Eng, Loc L, Loc R, bool isEqual) {
-
- ValueManager& ValMgr = Eng.getValueManager();
-
- switch (L.getSubKind()) {
-
- default:
- assert(false && "EQ/NE not implemented for this Loc.");
- return UnknownVal();
-
- case loc::ConcreteIntKind:
-
- if (isa<loc::ConcreteInt>(R)) {
- bool b = cast<loc::ConcreteInt>(L).getValue() ==
- cast<loc::ConcreteInt>(R).getValue();
-
- // Are we computing '!='? Flip the result.
- if (!isEqual)
- b = !b;
-
- return ValMgr.makeTruthVal(b);
- }
- else if (SymbolRef Sym = R.getAsSymbol()) {
- const SymIntExpr * SE =
- Eng.getSymbolManager().getSymIntExpr(Sym,
- isEqual ? BinaryOperator::EQ
- : BinaryOperator::NE,
- cast<loc::ConcreteInt>(L).getValue(),
- Eng.getContext().IntTy);
- return nonloc::SymExprVal(SE);
- }
-
- break;
-
- case loc::MemRegionKind: {
- if (SymbolRef LSym = L.getAsLocSymbol()) {
- if (isa<loc::ConcreteInt>(R)) {
- const SymIntExpr *SE =
- Eng.getSymbolManager().getSymIntExpr(LSym,
- isEqual ? BinaryOperator::EQ
- : BinaryOperator::NE,
- cast<loc::ConcreteInt>(R).getValue(),
- Eng.getContext().IntTy);
-
- return nonloc::SymExprVal(SE);
- }
- }
- }
-
- // Fall-through.
-
- case loc::GotoLabelKind:
- return ValMgr.makeTruthVal(isEqual ? L == R : L != R);
- }
-
- return ValMgr.makeTruthVal(isEqual ? false : true);
-}
-
-//===----------------------------------------------------------------------===//
-// Transfer function for function calls.
-//===----------------------------------------------------------------------===//
-
-void GRSimpleVals::EvalCall(ExplodedNodeSet<GRState>& Dst,
- GRExprEngine& Eng,
- GRStmtNodeBuilder<GRState>& Builder,
- CallExpr* CE, SVal L,
- ExplodedNode<GRState>* Pred) {
-
- GRStateManager& StateMgr = Eng.getStateManager();
- const GRState* St = Builder.GetState(Pred);
-
- // Invalidate all arguments passed in by reference (Locs).
-
- for (CallExpr::arg_iterator I = CE->arg_begin(), E = CE->arg_end();
- I != E; ++I) {
-
- SVal V = St->getSVal(*I);
-
- if (isa<loc::MemRegionVal>(V)) {
- const MemRegion *R = cast<loc::MemRegionVal>(V).getRegion();
- if (R->isBoundable())
- St = StateMgr.BindLoc(St, cast<Loc>(V), UnknownVal());
- } else if (isa<nonloc::LocAsInteger>(V))
- St = StateMgr.BindLoc(St, cast<nonloc::LocAsInteger>(V).getLoc(),
- UnknownVal());
-
- }
-
- // Make up a symbol for the return value of this function.
- // FIXME: We eventually should handle structs and other compound types
- // that are returned by value.
- QualType T = CE->getType();
- if (Loc::IsLocType(T) || (T->isIntegerType() && T->isScalarType())) {
- unsigned Count = Builder.getCurrentBlockCount();
- SVal X = Eng.getValueManager().getConjuredSymbolVal(CE, Count);
- St = St->bindExpr(CE, X, Eng.getCFG().isBlkExpr(CE), false);
- }
-
- Builder.MakeNode(Dst, CE, Pred, St);
-}
-
-//===----------------------------------------------------------------------===//
-// Transfer function for Objective-C message expressions.
-//===----------------------------------------------------------------------===//
-
-void GRSimpleVals::EvalObjCMessageExpr(ExplodedNodeSet<GRState>& Dst,
- GRExprEngine& Eng,
- GRStmtNodeBuilder<GRState>& Builder,
- ObjCMessageExpr* ME,
- ExplodedNode<GRState>* Pred) {
-
-
- // The basic transfer function logic for message expressions does nothing.
- // We just invalidate all arguments passed in by references.
- const GRState *St = Builder.GetState(Pred);
-
- for (ObjCMessageExpr::arg_iterator I = ME->arg_begin(), E = ME->arg_end();
- I != E; ++I) {
-
- SVal V = St->getSVal(*I);
-
- if (isa<Loc>(V))
- St = St->bindLoc(cast<Loc>(V), UnknownVal());
- }
-
- Builder.MakeNode(Dst, ME, Pred, St);
-}
diff --git a/lib/Analysis/GRSimpleVals.h b/lib/Analysis/GRSimpleVals.h
deleted file mode 100644
index 6ef49dcdd22e..000000000000
--- a/lib/Analysis/GRSimpleVals.h
+++ /dev/null
@@ -1,86 +0,0 @@
-// GRSimpleVals.h - Transfer functions for tracking simple values -*- C++ -*--//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines GRSimpleVals, a sub-class of GRTransferFuncs that
-// provides transfer functions for performing simple value tracking with
-// limited support for symbolics.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_CLANG_ANALYSIS_GRSIMPLEVALS
-#define LLVM_CLANG_ANALYSIS_GRSIMPLEVALS
-
-#include "clang/Analysis/PathSensitive/GRTransferFuncs.h"
-#include "clang/Analysis/PathSensitive/GRExprEngine.h"
-
-namespace clang {
-
-class PathDiagnostic;
-class ASTContext;
-
-class GRSimpleVals : public GRTransferFuncs {
-protected:
-
- virtual SVal DetermEvalBinOpNN(GRExprEngine& Eng,
- BinaryOperator::Opcode Op,
- NonLoc L, NonLoc R, QualType T);
-
-public:
- GRSimpleVals() {}
- virtual ~GRSimpleVals() {}
-
- // Casts.
-
- virtual SVal EvalCast(GRExprEngine& Engine, NonLoc V, QualType CastT);
- virtual SVal EvalCast(GRExprEngine& Engine, Loc V, QualType CastT);
-
- // Unary Operators.
-
- virtual SVal EvalMinus(GRExprEngine& Engine, UnaryOperator* U, NonLoc X);
-
- virtual SVal EvalComplement(GRExprEngine& Engine, NonLoc X);
-
- // Binary Operators.
-
- virtual SVal EvalBinOp(GRExprEngine& Engine, BinaryOperator::Opcode Op,
- Loc L, Loc R);
-
- // Pointer arithmetic.
-
- virtual SVal EvalBinOp(GRExprEngine& Engine, const GRState *state,
- BinaryOperator::Opcode Op, Loc L, NonLoc R);
-
- // Calls.
-
- virtual void EvalCall(ExplodedNodeSet<GRState>& Dst,
- GRExprEngine& Engine,
- GRStmtNodeBuilder<GRState>& Builder,
- CallExpr* CE, SVal L,
- ExplodedNode<GRState>* Pred);
-
- virtual void EvalObjCMessageExpr(ExplodedNodeSet<GRState>& Dst,
- GRExprEngine& Engine,
- GRStmtNodeBuilder<GRState>& Builder,
- ObjCMessageExpr* ME,
- ExplodedNode<GRState>* Pred);
-
-
-
- static void GeneratePathDiagnostic(PathDiagnostic& PD, ASTContext& Ctx,
- ExplodedNode<GRState>* N);
-
-protected:
-
- // Equality (==, !=) operators for Locs.
- SVal EvalEquality(GRExprEngine& Engine, Loc L, Loc R, bool isEqual);
-};
-
-} // end clang namespace
-
-#endif
diff --git a/lib/Analysis/GRState.cpp b/lib/Analysis/GRState.cpp
index a64b2d7f5f49..493edc37bacb 100644
--- a/lib/Analysis/GRState.cpp
+++ b/lib/Analysis/GRState.cpp
@@ -1,4 +1,4 @@
-//= GRState*cpp - Path-Sens. "State" for tracking valuues -----*- C++ -*--=//
+//= GRState.cpp - Path-Sensitive "State" for tracking values -----*- C++ -*--=//
//
// The LLVM Compiler Infrastructure
//
@@ -7,7 +7,7 @@
//
//===----------------------------------------------------------------------===//
//
-// This file defines SymbolRef, ExprBindKey, and GRState*
+// This file implements GRState and GRStateManager.
//
//===----------------------------------------------------------------------===//
@@ -20,6 +20,7 @@
using namespace clang;
// Give the vtable for ConstraintManager somewhere to live.
+// FIXME: Move this elsewhere.
ConstraintManager::~ConstraintManager() {}
GRStateManager::~GRStateManager() {
@@ -56,16 +57,63 @@ GRStateManager::RemoveDeadBindings(const GRState* state, Stmt* Loc,
SymReaper);
}
-const GRState* GRStateManager::Unbind(const GRState* St, Loc LV) {
- Store OldStore = St->getStore();
- Store NewStore = StoreMgr->Remove(OldStore, LV);
+const GRState *GRState::unbindLoc(Loc LV) const {
+ Store OldStore = getStore();
+ Store NewStore = Mgr->StoreMgr->Remove(OldStore, LV);
if (NewStore == OldStore)
- return St;
+ return this;
- GRState NewSt = *St;
+ GRState NewSt = *this;
NewSt.St = NewStore;
- return getPersistentState(NewSt);
+ return Mgr->getPersistentState(NewSt);
+}
+
+SVal GRState::getSValAsScalarOrLoc(const MemRegion *R) const {
+ // We only want to do fetches from regions that we can actually bind
+ // values. For example, SymbolicRegions of type 'id<...>' cannot
+ // have direct bindings (but their can be bindings on their subregions).
+ if (!R->isBoundable())
+ return UnknownVal();
+
+ if (const TypedRegion *TR = dyn_cast<TypedRegion>(R)) {
+ QualType T = TR->getValueType(Mgr->getContext());
+ if (Loc::IsLocType(T) || T->isIntegerType())
+ return getSVal(R);
+ }
+
+ return UnknownVal();
+}
+
+
+const GRState *GRState::bindExpr(const Stmt* Ex, SVal V, bool isBlkExpr,
+ bool Invalidate) const {
+
+ Environment NewEnv = Mgr->EnvMgr.BindExpr(Env, Ex, V, isBlkExpr, Invalidate);
+
+ if (NewEnv == Env)
+ return this;
+
+ GRState NewSt = *this;
+ NewSt.Env = NewEnv;
+ return Mgr->getPersistentState(NewSt);
+}
+
+const GRState *GRState::bindExpr(const Stmt* Ex, SVal V,
+ bool Invalidate) const {
+
+ bool isBlkExpr = false;
+
+ if (Ex == Mgr->CurrentStmt) {
+ // FIXME: Should this just be an assertion? When would we want to set
+ // the value of a block-level expression if it wasn't CurrentStmt?
+ isBlkExpr = Mgr->cfg.isBlkExpr(Ex);
+
+ if (!isBlkExpr)
+ return this;
+ }
+
+ return bindExpr(Ex, V, isBlkExpr, Invalidate);
}
const GRState* GRStateManager::getInitialState() {
@@ -101,7 +149,8 @@ const GRState* GRState::makeWithStore(Store store) const {
// State pretty-printing.
//===----------------------------------------------------------------------===//
-void GRState::print(std::ostream& Out, const char* nl, const char* sep) const {
+void GRState::print(llvm::raw_ostream& Out, const char* nl,
+ const char* sep) const {
// Print the store.
Mgr->getStoreManager().print(getStore(), Out, nl, sep);
@@ -117,9 +166,7 @@ void GRState::print(std::ostream& Out, const char* nl, const char* sep) const {
else { Out << nl; }
Out << " (" << (void*) I.getKey() << ") ";
- llvm::raw_os_ostream OutS(Out);
- I.getKey()->printPretty(OutS);
- OutS.flush();
+ I.getKey()->printPretty(Out);
Out << " : ";
I.getData().print(Out);
}
@@ -136,9 +183,7 @@ void GRState::print(std::ostream& Out, const char* nl, const char* sep) const {
else { Out << nl; }
Out << " (" << (void*) I.getKey() << ") ";
- llvm::raw_os_ostream OutS(Out);
- I.getKey()->printPretty(OutS);
- OutS.flush();
+ I.getKey()->printPretty(Out);
Out << " : ";
I.getData().print(Out);
}
@@ -152,12 +197,12 @@ void GRState::print(std::ostream& Out, const char* nl, const char* sep) const {
}
}
-void GRState::printDOT(std::ostream& Out) const {
+void GRState::printDOT(llvm::raw_ostream& Out) const {
print(Out, "\\l", "\\|");
}
void GRState::printStdErr() const {
- print(*llvm::cerr);
+ print(llvm::errs());
}
//===----------------------------------------------------------------------===//
diff --git a/lib/Analysis/GRTransferFuncs.cpp b/lib/Analysis/GRTransferFuncs.cpp
deleted file mode 100644
index 3c14ee9ab5c2..000000000000
--- a/lib/Analysis/GRTransferFuncs.cpp
+++ /dev/null
@@ -1,27 +0,0 @@
-//== GRTransferFuncs.cpp - Path-Sens. Transfer Functions Interface -*- C++ -*--=
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines GRTransferFuncs, which provides a base-class that
-// defines an interface for transfer functions used by GRExprEngine.
-//
-//===----------------------------------------------------------------------===//
-
-#include "clang/Analysis/PathSensitive/GRTransferFuncs.h"
-#include "clang/Analysis/PathSensitive/GRExprEngine.h"
-
-using namespace clang;
-
-void GRTransferFuncs::EvalBinOpNN(GRStateSet& OStates,
- GRExprEngine& Eng,
- const GRState *St, Expr* Ex,
- BinaryOperator::Opcode Op,
- NonLoc L, NonLoc R, QualType T) {
-
- OStates.Add(St->bindExpr(Ex, DetermEvalBinOpNN(Eng, Op, L, R, T)));
-}
diff --git a/lib/Analysis/PathDiagnostic.cpp b/lib/Analysis/PathDiagnostic.cpp
index ec96329852d4..a608ce0d5884 100644
--- a/lib/Analysis/PathDiagnostic.cpp
+++ b/lib/Analysis/PathDiagnostic.cpp
@@ -18,7 +18,7 @@
#include "clang/AST/StmtCXX.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/Support/Casting.h"
-#include <sstream>
+
using namespace clang;
using llvm::dyn_cast;
using llvm::isa;
diff --git a/lib/Analysis/RangeConstraintManager.cpp b/lib/Analysis/RangeConstraintManager.cpp
index 73c68bcaea03..079462e8d19f 100644
--- a/lib/Analysis/RangeConstraintManager.cpp
+++ b/lib/Analysis/RangeConstraintManager.cpp
@@ -200,7 +200,7 @@ public:
return newRanges;
}
- void Print(std::ostream &os) const {
+ void print(llvm::raw_ostream &os) const {
bool isFirst = true;
os << "{ ";
for (iterator i = begin(), e = end(); i != e; ++i) {
@@ -265,7 +265,7 @@ public:
const GRState* RemoveDeadBindings(const GRState* St, SymbolReaper& SymReaper);
- void print(const GRState* St, std::ostream& Out,
+ void print(const GRState* St, llvm::raw_ostream& Out,
const char* nl, const char *sep);
private:
@@ -341,7 +341,7 @@ AssumeX(GE)
// Pretty-printing.
//===------------------------------------------------------------------------===/
-void RangeConstraintManager::print(const GRState* St, std::ostream& Out,
+void RangeConstraintManager::print(const GRState* St, llvm::raw_ostream& Out,
const char* nl, const char *sep) {
ConstraintRangeTy Ranges = St->get<ConstraintRange>();
@@ -353,6 +353,6 @@ void RangeConstraintManager::print(const GRState* St, std::ostream& Out,
for (ConstraintRangeTy::iterator I=Ranges.begin(), E=Ranges.end(); I!=E; ++I){
Out << nl << ' ' << I.getKey() << " : ";
- I.getData().Print(Out);
+ I.getData().print(Out);
}
}
diff --git a/lib/Analysis/RegionStore.cpp b/lib/Analysis/RegionStore.cpp
index 77f5b7cb39bb..d45048de1a42 100644
--- a/lib/Analysis/RegionStore.cpp
+++ b/lib/Analysis/RegionStore.cpp
@@ -103,25 +103,6 @@ namespace clang {
}
//===----------------------------------------------------------------------===//
-// Region "killsets".
-//===----------------------------------------------------------------------===//
-//
-// RegionStore lazily adds value bindings to regions when the analyzer handles
-// assignment statements. Killsets track which default values have been
-// killed, thus distinguishing between "unknown" values and default
-// values. Regions are added to killset only when they are assigned "unknown"
-// directly, otherwise we should have their value in the region bindings.
-//
-namespace { class VISIBILITY_HIDDEN RegionKills {}; }
-static int RegionKillsIndex = 0;
-namespace clang {
- template<> struct GRStateTrait<RegionKills>
- : public GRStatePartialTrait< llvm::ImmutableSet<const MemRegion*> > {
- static void* GDMIndex() { return &RegionKillsIndex; }
- };
-}
-
-//===----------------------------------------------------------------------===//
// Regions with default values.
//===----------------------------------------------------------------------===//
//
@@ -238,10 +219,8 @@ public:
CastResult CastRegion(const GRState *state, const MemRegion* R,
QualType CastToTy);
- SVal EvalBinOp(const GRState *state, BinaryOperator::Opcode Op,Loc L,NonLoc R);
-
-
-
+ SVal EvalBinOp(const GRState *state, BinaryOperator::Opcode Op,Loc L,
+ NonLoc R, QualType resultTy);
Store getInitialStore() { return RBFactory.GetEmptyMap().getRoot(); }
@@ -260,8 +239,6 @@ public:
return SelfRegion;
}
-
-
//===-------------------------------------------------------------------===//
// Binding values to regions.
@@ -306,7 +283,11 @@ public:
/// else
/// return symbolic
SVal Retrieve(const GRState *state, Loc L, QualType T = QualType());
-
+
+ SVal RetrieveElement(const GRState* state, const ElementRegion* R);
+
+ SVal RetrieveField(const GRState* state, const FieldRegion* R);
+
/// Retrieve the values in a struct and return a CompoundVal, used when doing
/// struct copy:
/// struct s x, y;
@@ -352,7 +333,8 @@ public:
return RegionBindingsTy(static_cast<const RegionBindingsTy::TreeTy*>(store));
}
- void print(Store store, std::ostream& Out, const char* nl, const char *sep);
+ void print(Store store, llvm::raw_ostream& Out, const char* nl,
+ const char *sep);
void iterBindings(Store store, BindingsHandler& f) {
// FIXME: Implement.
@@ -740,7 +722,8 @@ RegionStoreManager::CastRegion(const GRState *state, const MemRegion* R,
//===----------------------------------------------------------------------===//
SVal RegionStoreManager::EvalBinOp(const GRState *state,
- BinaryOperator::Opcode Op, Loc L, NonLoc R) {
+ BinaryOperator::Opcode Op, Loc L, NonLoc R,
+ QualType resultTy) {
// Assume the base location is MemRegionVal.
if (!isa<loc::MemRegionVal>(L))
return UnknownVal();
@@ -798,7 +781,7 @@ SVal RegionStoreManager::EvalBinOp(const GRState *state,
//
nonloc::ConcreteInt OffConverted(getBasicVals().Convert(Base->getValue(),
Offset->getValue()));
- SVal NewIdx = Base->EvalBinOp(getBasicVals(), Op, OffConverted);
+ SVal NewIdx = Base->evalBinOp(ValMgr, Op, OffConverted);
const MemRegion* NewER =
MRMgr.getElementRegion(ER->getElementType(), NewIdx,ER->getSuperRegion(),
getContext());
@@ -839,6 +822,12 @@ SVal RegionStoreManager::Retrieve(const GRState *state, Loc L, QualType T) {
const TypedRegion *R = cast<TypedRegion>(MR);
assert(R && "bad region");
+ if (const FieldRegion* FR = dyn_cast<FieldRegion>(R))
+ return RetrieveField(state, FR);
+
+ if (const ElementRegion* ER = dyn_cast<ElementRegion>(R))
+ return RetrieveElement(state, ER);
+
// FIXME: We should eventually handle funny addressing. e.g.:
//
// int x = ...;
@@ -867,42 +856,6 @@ SVal RegionStoreManager::Retrieve(const GRState *state, Loc L, QualType T) {
if (V)
return *V;
- // Check if the region is in killset.
- if (state->contains<RegionKills>(R))
- return UnknownVal();
-
- // Check if the region is an element region of a string literal.
- if (const ElementRegion *ER = dyn_cast<ElementRegion>(R)) {
- if (const StringRegion *StrR=dyn_cast<StringRegion>(ER->getSuperRegion())) {
- const StringLiteral *Str = StrR->getStringLiteral();
- SVal Idx = ER->getIndex();
- if (nonloc::ConcreteInt *CI = dyn_cast<nonloc::ConcreteInt>(&Idx)) {
- int64_t i = CI->getValue().getSExtValue();
- char c;
- if (i == Str->getByteLength())
- c = '\0';
- else
- c = Str->getStrData()[i];
- const llvm::APSInt &V = getBasicVals().getValue(c, getContext().CharTy);
- return nonloc::ConcreteInt(V);
- }
- }
- }
-
- // If the region is an element or field, it may have a default value.
- if (isa<ElementRegion>(R) || isa<FieldRegion>(R)) {
- const MemRegion* SuperR = cast<SubRegion>(R)->getSuperRegion();
- GRStateTrait<RegionDefaultValue>::lookup_type D =
- state->get<RegionDefaultValue>(SuperR);
- if (D) {
- // If the default value is symbolic, we need to create a new symbol.
- if (D->hasConjuredSymbol())
- return ValMgr.getRegionValueSymbolVal(R);
- else
- return *D;
- }
- }
-
if (const ObjCIvarRegion *IVR = dyn_cast<ObjCIvarRegion>(R)) {
const MemRegion *SR = IVR->getSuperRegion();
@@ -961,6 +914,97 @@ SVal RegionStoreManager::Retrieve(const GRState *state, Loc L, QualType T) {
return UnknownVal();
}
+SVal RegionStoreManager::RetrieveElement(const GRState* state,
+ const ElementRegion* R) {
+ // Check if the region has a binding.
+ RegionBindingsTy B = GetRegionBindings(state->getStore());
+ const SVal* V = B.lookup(R);
+ if (V)
+ return *V;
+
+ // Check if the region is an element region of a string literal.
+ if (const StringRegion *StrR=dyn_cast<StringRegion>(R->getSuperRegion())) {
+ const StringLiteral *Str = StrR->getStringLiteral();
+ SVal Idx = R->getIndex();
+ if (nonloc::ConcreteInt *CI = dyn_cast<nonloc::ConcreteInt>(&Idx)) {
+ int64_t i = CI->getValue().getSExtValue();
+ char c;
+ if (i == Str->getByteLength())
+ c = '\0';
+ else
+ c = Str->getStrData()[i];
+ return ValMgr.makeIntVal(c, getContext().CharTy);
+ }
+ }
+
+ const MemRegion* SuperR = R->getSuperRegion();
+ const SVal* D = state->get<RegionDefaultValue>(SuperR);
+
+ if (D) {
+ if (D->hasConjuredSymbol())
+ return ValMgr.getRegionValueSymbolVal(R);
+ else
+ return *D;
+ }
+
+ if (R->hasHeapOrStackStorage())
+ return UndefinedVal();
+
+ QualType Ty = R->getValueType(getContext());
+
+ // If the region is already cast to another type, use that type to create the
+ // symbol value.
+ if (const QualType *p = state->get<RegionCasts>(R))
+ Ty = (*p)->getAsPointerType()->getPointeeType();
+
+ if (Loc::IsLocType(Ty) || Ty->isIntegerType())
+ return ValMgr.getRegionValueSymbolVal(R, Ty);
+ else
+ return UnknownVal();
+}
+
+SVal RegionStoreManager::RetrieveField(const GRState* state,
+ const FieldRegion* R) {
+ QualType Ty = R->getValueType(getContext());
+
+ // Check if the region has a binding.
+ RegionBindingsTy B = GetRegionBindings(state->getStore());
+ const SVal* V = B.lookup(R);
+ if (V)
+ return *V;
+
+ const MemRegion* SuperR = R->getSuperRegion();
+ const SVal* D = state->get<RegionDefaultValue>(SuperR);
+ if (D) {
+ if (D->hasConjuredSymbol())
+ return ValMgr.getRegionValueSymbolVal(R);
+
+ if (D->isZeroConstant())
+ return ValMgr.makeZeroVal(Ty);
+
+ if (D->isUnknown())
+ return *D;
+
+ assert(0 && "Unknown default value");
+ }
+
+ if (R->hasHeapOrStackStorage())
+ return UndefinedVal();
+
+ // If the region is already cast to another type, use that type to create the
+ // symbol value.
+ if (const QualType *p = state->get<RegionCasts>(R)) {
+ QualType tmp = *p;
+ Ty = tmp->getAsPointerType()->getPointeeType();
+ }
+
+ // All other integer values are symbolic.
+ if (Loc::IsLocType(Ty) || Ty->isIntegerType())
+ return ValMgr.getRegionValueSymbolVal(R, Ty);
+ else
+ return UnknownVal();
+}
+
SVal RegionStoreManager::RetrieveStruct(const GRState *state,
const TypedRegion* R){
QualType T = R->getValueType(getContext());
@@ -1040,12 +1084,7 @@ const GRState *RegionStoreManager::Bind(const GRState *state, Loc L, SVal V) {
RegionBindingsTy B = GetRegionBindings(state->getStore());
- if (V.isUnknown()) {
- B = RBFactory.Remove(B, R); // Remove the binding.
- state = state->add<RegionKills>(R); // Add the region to the killset.
- }
- else
- B = RBFactory.Add(B, R, V);
+ B = RBFactory.Add(B, R, V);
return state->makeWithStore(B.getRoot());
}
@@ -1127,15 +1166,12 @@ const GRState *RegionStoreManager::BindArray(const GRState *state,
state = Bind(state, ValMgr.makeLoc(ER), *VI);
}
- // If the init list is shorter than the array length, bind the rest elements
- // to 0.
- if (ElementTy->isIntegerType()) {
- while (i < Size) {
- SVal Idx = ValMgr.makeIntVal(i);
- ElementRegion* ER = MRMgr.getElementRegion(ElementTy, Idx,R,getContext());
+ // If the init list is shorter than the array length, set the array default
+ // value.
+ if (i < Size) {
+ if (ElementTy->isIntegerType()) {
SVal V = ValMgr.makeZeroVal(ElementTy);
- state = Bind(state, ValMgr.makeLoc(ER), V);
- ++i;
+ state = setDefaultValue(state, R, V);
}
}
@@ -1186,15 +1222,8 @@ RegionStoreManager::BindStruct(const GRState *state, const TypedRegion* R,
}
// There may be fewer values in the initialize list than the fields of struct.
- while (FI != FE) {
- QualType FTy = (*FI)->getType();
- if (FTy->isIntegerType()) {
- FieldRegion* FR = MRMgr.getFieldRegion(*FI, R);
- state = Bind(state, ValMgr.makeLoc(FR), ValMgr.makeZeroVal(FTy));
- }
-
- ++FI;
- }
+ if (FI != FE)
+ state = setDefaultValue(state, R, ValMgr.makeIntVal(0, false));
return state;
}
@@ -1202,20 +1231,17 @@ RegionStoreManager::BindStruct(const GRState *state, const TypedRegion* R,
const GRState *RegionStoreManager::KillStruct(const GRState *state,
const TypedRegion* R){
- // (1) Kill the struct region because it is assigned "unknown".
- // (2) Set the default value of the struct region to "unknown".
- state = state->add<RegionKills>(R)->set<RegionDefaultValue>(R, UnknownVal());
- Store store = state->getStore();
- RegionBindingsTy B = GetRegionBindings(store);
+ // Set the default value of the struct region to "unknown".
+ state = state->set<RegionDefaultValue>(R, UnknownVal());
// Remove all bindings for the subregions of the struct.
+ Store store = state->getStore();
+ RegionBindingsTy B = GetRegionBindings(store);
for (RegionBindingsTy::iterator I = B.begin(), E = B.end(); I != E; ++I) {
const MemRegion* R = I.getKey();
if (const SubRegion* subRegion = dyn_cast<SubRegion>(R))
if (subRegion->isSubRegionOf(R))
store = Remove(store, ValMgr.makeLoc(subRegion));
- // FIXME: Maybe we should also remove the bindings for the "views" of the
- // subregions.
}
return state->makeWithStore(store);
@@ -1427,9 +1453,8 @@ Store RegionStoreManager::RemoveDeadBindings(const GRState *state, Stmt* Loc,
// Utility methods.
//===----------------------------------------------------------------------===//
-void RegionStoreManager::print(Store store, std::ostream& Out,
+void RegionStoreManager::print(Store store, llvm::raw_ostream& OS,
const char* nl, const char *sep) {
- llvm::raw_os_ostream OS(Out);
RegionBindingsTy B = GetRegionBindings(store);
OS << "Store:" << nl;
diff --git a/lib/Analysis/SVals.cpp b/lib/Analysis/SVals.cpp
index dd9490bebb96..7d1850d73095 100644
--- a/lib/Analysis/SVals.cpp
+++ b/lib/Analysis/SVals.cpp
@@ -188,12 +188,11 @@ bool SVal::isZeroConstant() const {
// Transfer function dispatch for Non-Locs.
//===----------------------------------------------------------------------===//
-SVal nonloc::ConcreteInt::EvalBinOp(BasicValueFactory& BasicVals,
- BinaryOperator::Opcode Op,
- const nonloc::ConcreteInt& R) const {
-
+SVal nonloc::ConcreteInt::evalBinOp(ValueManager &ValMgr,
+ BinaryOperator::Opcode Op,
+ const nonloc::ConcreteInt& R) const {
const llvm::APSInt* X =
- BasicVals.EvaluateAPSInt(Op, getValue(), R.getValue());
+ ValMgr.getBasicValueFactory().EvaluateAPSInt(Op, getValue(), R.getValue());
if (X)
return nonloc::ConcreteInt(*X);
@@ -201,20 +200,13 @@ SVal nonloc::ConcreteInt::EvalBinOp(BasicValueFactory& BasicVals,
return UndefinedVal();
}
- // Bitwise-Complement.
-
nonloc::ConcreteInt
-nonloc::ConcreteInt::EvalComplement(BasicValueFactory& BasicVals) const {
- return BasicVals.getValue(~getValue());
+nonloc::ConcreteInt::evalComplement(ValueManager &ValMgr) const {
+ return ValMgr.makeIntVal(~getValue());
}
- // Unary Minus.
-
-nonloc::ConcreteInt
-nonloc::ConcreteInt::EvalMinus(BasicValueFactory& BasicVals, UnaryOperator* U) const {
- assert (U->getType() == U->getSubExpr()->getType());
- assert (U->getType()->isIntegerType());
- return BasicVals.getValue(-getValue());
+nonloc::ConcreteInt nonloc::ConcreteInt::evalMinus(ValueManager &ValMgr) const {
+ return ValMgr.makeIntVal(-getValue());
}
//===----------------------------------------------------------------------===//
@@ -242,11 +234,6 @@ SVal loc::ConcreteInt::EvalBinOp(BasicValueFactory& BasicVals,
void SVal::printStdErr() const { print(llvm::errs()); }
-void SVal::print(std::ostream& Out) const {
- llvm::raw_os_ostream out(Out);
- print(out);
-}
-
void SVal::print(llvm::raw_ostream& Out) const {
switch (getBaseKind()) {
diff --git a/lib/Analysis/SimpleSValuator.cpp b/lib/Analysis/SimpleSValuator.cpp
new file mode 100644
index 000000000000..76a8bc782eb5
--- /dev/null
+++ b/lib/Analysis/SimpleSValuator.cpp
@@ -0,0 +1,346 @@
+// SimpleSValuator.cpp - A basic SValuator ------------------------*- C++ -*--//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file defines SimpleSValuator, a basic implementation of SValuator.
+//
+//===----------------------------------------------------------------------===//
+
+#include "clang/Analysis/PathSensitive/SValuator.h"
+#include "clang/Analysis/PathSensitive/GRState.h"
+#include "llvm/Support/Compiler.h"
+
+using namespace clang;
+
+namespace {
+class VISIBILITY_HIDDEN SimpleSValuator : public SValuator {
+public:
+ SimpleSValuator(ValueManager &valMgr) : SValuator(valMgr) {}
+ virtual ~SimpleSValuator() {}
+
+ virtual SVal EvalCast(NonLoc val, QualType castTy);
+ virtual SVal EvalCast(Loc val, QualType castTy);
+ virtual SVal EvalMinus(NonLoc val);
+ virtual SVal EvalComplement(NonLoc val);
+ virtual SVal EvalBinOpNN(BinaryOperator::Opcode op, NonLoc lhs, NonLoc rhs,
+ QualType resultTy);
+ virtual SVal EvalBinOpLL(BinaryOperator::Opcode op, Loc lhs, Loc rhs,
+ QualType resultTy);
+ virtual SVal EvalBinOpLN(const GRState *state, BinaryOperator::Opcode op,
+ Loc lhs, NonLoc rhs, QualType resultTy);
+};
+} // end anonymous namespace
+
+SValuator *clang::CreateSimpleSValuator(ValueManager &valMgr) {
+ return new SimpleSValuator(valMgr);
+}
+
+//===----------------------------------------------------------------------===//
+// Transfer function for Casts.
+//===----------------------------------------------------------------------===//
+
+SVal SimpleSValuator::EvalCast(NonLoc val, QualType castTy) {
+ if (!isa<nonloc::ConcreteInt>(val))
+ return UnknownVal();
+
+ bool isLocType = Loc::IsLocType(castTy);
+
+ // Only handle casts from integers to integers.
+ if (!isLocType && !castTy->isIntegerType())
+ return UnknownVal();
+
+ llvm::APSInt i = cast<nonloc::ConcreteInt>(val).getValue();
+ i.setIsUnsigned(castTy->isUnsignedIntegerType() || Loc::IsLocType(castTy));
+ i.extOrTrunc(ValMgr.getContext().getTypeSize(castTy));
+
+ if (isLocType)
+ return ValMgr.makeIntLocVal(i);
+ else
+ return ValMgr.makeIntVal(i);
+}
+
+SVal SimpleSValuator::EvalCast(Loc val, QualType castTy) {
+
+ // Casts from pointers -> pointers, just return the lval.
+ //
+ // Casts from pointers -> references, just return the lval. These
+ // can be introduced by the frontend for corner cases, e.g
+ // casting from va_list* to __builtin_va_list&.
+ //
+ assert(!val.isUnknownOrUndef());
+
+ if (Loc::IsLocType(castTy) || castTy->isReferenceType())
+ return val;
+
+ // FIXME: Handle transparent unions where a value can be "transparently"
+ // lifted into a union type.
+ if (castTy->isUnionType())
+ return UnknownVal();
+
+ assert(castTy->isIntegerType());
+ unsigned BitWidth = ValMgr.getContext().getTypeSize(castTy);
+
+ if (!isa<loc::ConcreteInt>(val))
+ return ValMgr.makeLocAsInteger(val, BitWidth);
+
+ llvm::APSInt i = cast<loc::ConcreteInt>(val).getValue();
+ i.setIsUnsigned(castTy->isUnsignedIntegerType() || Loc::IsLocType(castTy));
+ i.extOrTrunc(BitWidth);
+ return ValMgr.makeIntVal(i);
+}
+
+//===----------------------------------------------------------------------===//
+// Transfer function for unary operators.
+//===----------------------------------------------------------------------===//
+
+SVal SimpleSValuator::EvalMinus(NonLoc val) {
+ switch (val.getSubKind()) {
+ case nonloc::ConcreteIntKind:
+ return cast<nonloc::ConcreteInt>(val).evalMinus(ValMgr);
+ default:
+ return UnknownVal();
+ }
+}
+
+SVal SimpleSValuator::EvalComplement(NonLoc X) {
+ switch (X.getSubKind()) {
+ case nonloc::ConcreteIntKind:
+ return cast<nonloc::ConcreteInt>(X).evalComplement(ValMgr);
+ default:
+ return UnknownVal();
+ }
+}
+
+//===----------------------------------------------------------------------===//
+// Transfer function for binary operators.
+//===----------------------------------------------------------------------===//
+
+static BinaryOperator::Opcode NegateComparison(BinaryOperator::Opcode op) {
+ switch (op) {
+ default:
+ assert(false && "Invalid opcode.");
+ case BinaryOperator::LT: return BinaryOperator::GE;
+ case BinaryOperator::GT: return BinaryOperator::LE;
+ case BinaryOperator::LE: return BinaryOperator::GT;
+ case BinaryOperator::GE: return BinaryOperator::LT;
+ case BinaryOperator::EQ: return BinaryOperator::NE;
+ case BinaryOperator::NE: return BinaryOperator::EQ;
+ }
+}
+
+// Equality operators for Locs.
+// FIXME: All this logic will be revamped when we have MemRegion::getLocation()
+// implemented.
+
+static SVal EvalEquality(ValueManager &ValMgr, Loc lhs, Loc rhs, bool isEqual,
+ QualType resultTy) {
+
+ switch (lhs.getSubKind()) {
+ default:
+ assert(false && "EQ/NE not implemented for this Loc.");
+ return UnknownVal();
+
+ case loc::ConcreteIntKind: {
+ if (SymbolRef rSym = rhs.getAsSymbol())
+ return ValMgr.makeNonLoc(rSym,
+ isEqual ? BinaryOperator::EQ
+ : BinaryOperator::NE,
+ cast<loc::ConcreteInt>(lhs).getValue(),
+ resultTy);
+ break;
+ }
+ case loc::MemRegionKind: {
+ if (SymbolRef lSym = lhs.getAsLocSymbol()) {
+ if (isa<loc::ConcreteInt>(rhs)) {
+ return ValMgr.makeNonLoc(lSym,
+ isEqual ? BinaryOperator::EQ
+ : BinaryOperator::NE,
+ cast<loc::ConcreteInt>(rhs).getValue(),
+ resultTy);
+ }
+ }
+ break;
+ }
+
+ case loc::GotoLabelKind:
+ break;
+ }
+
+ return ValMgr.makeTruthVal(isEqual ? lhs == rhs : lhs != rhs, resultTy);
+}
+
+SVal SimpleSValuator::EvalBinOpNN(BinaryOperator::Opcode op,
+ NonLoc lhs, NonLoc rhs,
+ QualType resultTy) {
+ while (1) {
+ switch (lhs.getSubKind()) {
+ default:
+ return UnknownVal();
+ case nonloc::LocAsIntegerKind: {
+ Loc lhsL = cast<nonloc::LocAsInteger>(lhs).getLoc();
+ switch (rhs.getSubKind()) {
+ case nonloc::LocAsIntegerKind:
+ return EvalBinOpLL(op, lhsL, cast<nonloc::LocAsInteger>(rhs).getLoc(),
+ resultTy);
+ case nonloc::ConcreteIntKind: {
+ // Transform the integer into a location and compare.
+ ASTContext& Ctx = ValMgr.getContext();
+ llvm::APSInt i = cast<nonloc::ConcreteInt>(rhs).getValue();
+ i.setIsUnsigned(true);
+ i.extOrTrunc(Ctx.getTypeSize(Ctx.VoidPtrTy));
+ return EvalBinOpLL(op, lhsL, ValMgr.makeLoc(i), resultTy);
+ }
+ default:
+ switch (op) {
+ case BinaryOperator::EQ:
+ return ValMgr.makeTruthVal(false, resultTy);
+ case BinaryOperator::NE:
+ return ValMgr.makeTruthVal(true, resultTy);
+ default:
+ // This case also handles pointer arithmetic.
+ return UnknownVal();
+ }
+ }
+ }
+ case nonloc::SymExprValKind: {
+ // Logical not?
+ if (!(op == BinaryOperator::EQ && rhs.isZeroConstant()))
+ return UnknownVal();
+
+ const SymExpr *symExpr =
+ cast<nonloc::SymExprVal>(lhs).getSymbolicExpression();
+
+ // Only handle ($sym op constant) for now.
+ if (const SymIntExpr *symIntExpr = dyn_cast<SymIntExpr>(symExpr)) {
+ BinaryOperator::Opcode opc = symIntExpr->getOpcode();
+ switch (opc) {
+ case BinaryOperator::LAnd:
+ case BinaryOperator::LOr:
+ assert(false && "Logical operators handled by branching logic.");
+ return UnknownVal();
+ case BinaryOperator::Assign:
+ case BinaryOperator::MulAssign:
+ case BinaryOperator::DivAssign:
+ case BinaryOperator::RemAssign:
+ case BinaryOperator::AddAssign:
+ case BinaryOperator::SubAssign:
+ case BinaryOperator::ShlAssign:
+ case BinaryOperator::ShrAssign:
+ case BinaryOperator::AndAssign:
+ case BinaryOperator::XorAssign:
+ case BinaryOperator::OrAssign:
+ case BinaryOperator::Comma:
+ assert(false && "'=' and ',' operators handled by GRExprEngine.");
+ return UnknownVal();
+ case BinaryOperator::PtrMemD:
+ case BinaryOperator::PtrMemI:
+ assert(false && "Pointer arithmetic not handled here.");
+ return UnknownVal();
+ case BinaryOperator::Mul:
+ case BinaryOperator::Div:
+ case BinaryOperator::Rem:
+ case BinaryOperator::Add:
+ case BinaryOperator::Sub:
+ case BinaryOperator::Shl:
+ case BinaryOperator::Shr:
+ case BinaryOperator::And:
+ case BinaryOperator::Xor:
+ case BinaryOperator::Or:
+ // Not handled yet.
+ return UnknownVal();
+ case BinaryOperator::LT:
+ case BinaryOperator::GT:
+ case BinaryOperator::LE:
+ case BinaryOperator::GE:
+ case BinaryOperator::EQ:
+ case BinaryOperator::NE:
+ opc = NegateComparison(opc);
+ assert(symIntExpr->getType(ValMgr.getContext()) == resultTy);
+ return ValMgr.makeNonLoc(symIntExpr->getLHS(), opc,
+ symIntExpr->getRHS(), resultTy);
+ }
+ }
+ }
+ case nonloc::ConcreteIntKind: {
+ if (isa<nonloc::ConcreteInt>(rhs)) {
+ const nonloc::ConcreteInt& lhsInt = cast<nonloc::ConcreteInt>(lhs);
+ return lhsInt.evalBinOp(ValMgr, op, cast<nonloc::ConcreteInt>(rhs));
+ }
+ else {
+ // Swap the left and right sides and flip the operator if doing so
+ // allows us to better reason about the expression (this is a form
+ // of expression canonicalization).
+ NonLoc tmp = rhs;
+ rhs = lhs;
+ lhs = tmp;
+
+ switch (op) {
+ case BinaryOperator::LT: op = BinaryOperator::GT; continue;
+ case BinaryOperator::GT: op = BinaryOperator::LT; continue;
+ case BinaryOperator::LE: op = BinaryOperator::GE; continue;
+ case BinaryOperator::GE: op = BinaryOperator::LE; continue;
+ case BinaryOperator::EQ:
+ case BinaryOperator::NE:
+ case BinaryOperator::Add:
+ case BinaryOperator::Mul:
+ continue;
+ default:
+ return UnknownVal();
+ }
+ }
+ }
+ case nonloc::SymbolValKind: {
+ if (isa<nonloc::ConcreteInt>(rhs)) {
+ return ValMgr.makeNonLoc(cast<nonloc::SymbolVal>(lhs).getSymbol(), op,
+ cast<nonloc::ConcreteInt>(rhs).getValue(),
+ resultTy);
+ }
+
+ return UnknownVal();
+ }
+ }
+ }
+}
+
+SVal SimpleSValuator::EvalBinOpLL(BinaryOperator::Opcode op, Loc lhs, Loc rhs,
+ QualType resultTy) {
+ switch (op) {
+ default:
+ return UnknownVal();
+ case BinaryOperator::EQ:
+ case BinaryOperator::NE:
+ return EvalEquality(ValMgr, lhs, rhs, op == BinaryOperator::EQ, resultTy);
+ }
+}
+
+SVal SimpleSValuator::EvalBinOpLN(const GRState *state,
+ BinaryOperator::Opcode op,
+ Loc lhs, NonLoc rhs, QualType resultTy) {
+ // Special case: 'rhs' is an integer that has the same width as a pointer and
+ // we are using the integer location in a comparison. Normally this cannot be
+ // triggered, but transfer functions like those for OSCommpareAndSwapBarrier32
+ // can generate comparisons that trigger this code.
+ // FIXME: Are all locations guaranteed to have pointer width?
+ if (BinaryOperator::isEqualityOp(op)) {
+ if (nonloc::ConcreteInt *rhsInt = dyn_cast<nonloc::ConcreteInt>(&rhs)) {
+ const llvm::APSInt *x = &rhsInt->getValue();
+ ASTContext &ctx = ValMgr.getContext();
+ if (ctx.getTypeSize(ctx.VoidPtrTy) == x->getBitWidth()) {
+ // Convert the signedness of the integer (if necessary).
+ if (x->isSigned())
+ x = &ValMgr.getBasicValueFactory().getValue(*x, true);
+
+ return EvalBinOpLL(op, lhs, loc::ConcreteInt(*x), resultTy);
+ }
+ }
+ }
+
+ // Delegate pointer arithmetic to the StoreManager.
+ return state->getStateManager().getStoreManager().EvalBinOp(state, op, lhs,
+ rhs, resultTy);
+}
diff --git a/lib/Analysis/SymbolManager.cpp b/lib/Analysis/SymbolManager.cpp
index 4e38a3492c79..275f30a2963e 100644
--- a/lib/Analysis/SymbolManager.cpp
+++ b/lib/Analysis/SymbolManager.cpp
@@ -85,12 +85,6 @@ llvm::raw_ostream& llvm::operator<<(llvm::raw_ostream& os, const SymExpr *SE) {
return os;
}
-std::ostream& std::operator<<(std::ostream& os, const SymExpr *SE) {
- llvm::raw_os_ostream O(os);
- print(O, SE);
- return os;
-}
-
const SymbolRegionValue*
SymbolManager::getRegionValueSymbol(const MemRegion* R, QualType T) {
llvm::FoldingSetNodeID profile;
diff --git a/lib/Basic/IdentifierTable.cpp b/lib/Basic/IdentifierTable.cpp
index cf78da986926..d13ffa38213e 100644
--- a/lib/Basic/IdentifierTable.cpp
+++ b/lib/Basic/IdentifierTable.cpp
@@ -66,7 +66,8 @@ namespace {
KEYCXX = 4,
KEYCXX0X = 8,
KEYGNU = 16,
- KEYMS = 32
+ KEYMS = 32,
+ BOOLSUPPORT = 64
};
}
@@ -88,6 +89,7 @@ static void AddKeyword(const char *Keyword, unsigned KWLen,
else if (LangOpts.C99 && (Flags & KEYC99)) AddResult = 2;
else if (LangOpts.GNUMode && (Flags & KEYGNU)) AddResult = 1;
else if (LangOpts.Microsoft && (Flags & KEYMS)) AddResult = 1;
+ else if (LangOpts.OpenCL && (Flags & BOOLSUPPORT)) AddResult = 2;
// Don't add this keyword if disabled in this language.
if (AddResult == 0) return;
diff --git a/lib/Basic/SourceManager.cpp b/lib/Basic/SourceManager.cpp
index 23a01c953a46..6640c61ff3b7 100644
--- a/lib/Basic/SourceManager.cpp
+++ b/lib/Basic/SourceManager.cpp
@@ -943,7 +943,7 @@ SourceLocation SourceManager::getLocation(const FileEntry *SourceFile,
return SourceLocation();
unsigned FilePos = Content->SourceLineCache[Line - 1];
- const char *Buf = Content->getBuffer()->getBufferStart();
+ const char *Buf = Content->getBuffer()->getBufferStart() + FilePos;
unsigned BufLength = Content->getBuffer()->getBufferEnd() - Buf;
unsigned i = 0;
@@ -957,6 +957,107 @@ SourceLocation SourceManager::getLocation(const FileEntry *SourceFile,
getFileLocWithOffset(FilePos + Col - 1);
}
+/// \brief Determines the order of 2 source locations in the translation unit.
+///
+/// \returns true if LHS source location comes before RHS, false otherwise.
+bool SourceManager::isBeforeInTranslationUnit(SourceLocation LHS,
+ SourceLocation RHS) const {
+ assert(LHS.isValid() && RHS.isValid() && "Passed invalid source location!");
+ if (LHS == RHS)
+ return false;
+
+ std::pair<FileID, unsigned> LOffs = getDecomposedLoc(LHS);
+ std::pair<FileID, unsigned> ROffs = getDecomposedLoc(RHS);
+
+ // If the source locations are in the same file, just compare offsets.
+ if (LOffs.first == ROffs.first)
+ return LOffs.second < ROffs.second;
+
+ // If we are comparing a source location with multiple locations in the same
+ // file, we get a big win by caching the result.
+
+ if (LastLFIDForBeforeTUCheck == LOffs.first &&
+ LastRFIDForBeforeTUCheck == ROffs.first)
+ return LastResForBeforeTUCheck;
+
+ LastLFIDForBeforeTUCheck = LOffs.first;
+ LastRFIDForBeforeTUCheck = ROffs.first;
+
+ // "Traverse" the include/instantiation stacks of both locations and try to
+ // find a common "ancestor".
+ //
+ // First we traverse the stack of the right location and check each level
+ // against the level of the left location, while collecting all levels in a
+ // "stack map".
+
+ std::map<FileID, unsigned> ROffsMap;
+ ROffsMap[ROffs.first] = ROffs.second;
+
+ while (1) {
+ SourceLocation UpperLoc;
+ const SrcMgr::SLocEntry &Entry = getSLocEntry(ROffs.first);
+ if (Entry.isInstantiation())
+ UpperLoc = Entry.getInstantiation().getInstantiationLocStart();
+ else
+ UpperLoc = Entry.getFile().getIncludeLoc();
+
+ if (UpperLoc.isInvalid())
+ break; // We reached the top.
+
+ ROffs = getDecomposedLoc(UpperLoc);
+
+ if (LOffs.first == ROffs.first)
+ return LastResForBeforeTUCheck = LOffs.second < ROffs.second;
+
+ ROffsMap[ROffs.first] = ROffs.second;
+ }
+
+ // We didn't find a common ancestor. Now traverse the stack of the left
+ // location, checking against the stack map of the right location.
+
+ while (1) {
+ SourceLocation UpperLoc;
+ const SrcMgr::SLocEntry &Entry = getSLocEntry(LOffs.first);
+ if (Entry.isInstantiation())
+ UpperLoc = Entry.getInstantiation().getInstantiationLocStart();
+ else
+ UpperLoc = Entry.getFile().getIncludeLoc();
+
+ if (UpperLoc.isInvalid())
+ break; // We reached the top.
+
+ LOffs = getDecomposedLoc(UpperLoc);
+
+ std::map<FileID, unsigned>::iterator I = ROffsMap.find(LOffs.first);
+ if (I != ROffsMap.end())
+ return LastResForBeforeTUCheck = LOffs.second < I->second;
+ }
+
+ // No common ancestor.
+ // Now we are getting into murky waters. Most probably this is because one
+ // location is in the predefines buffer.
+
+ const FileEntry *LEntry =
+ getSLocEntry(LOffs.first).getFile().getContentCache()->Entry;
+ const FileEntry *REntry =
+ getSLocEntry(ROffs.first).getFile().getContentCache()->Entry;
+
+ // If the locations are in two memory buffers we give up, we can't answer
+ // which one should be considered first.
+ // FIXME: Should there be a way to "include" memory buffers in the translation
+ // unit ?
+ assert((LEntry != 0 || REntry != 0) && "Locations in memory buffers.");
+ (void) REntry;
+
+ // Consider the memory buffer as coming before the file in the translation
+ // unit.
+ if (LEntry == 0)
+ return LastResForBeforeTUCheck = true;
+ else {
+ assert(REntry == 0 && "Locations in not #included files ?");
+ return LastResForBeforeTUCheck = false;
+ }
+}
/// PrintStats - Print statistics to stderr.
///
diff --git a/lib/Basic/Targets.cpp b/lib/Basic/Targets.cpp
index 1d69e4e96efa..9910e28fcda9 100644
--- a/lib/Basic/Targets.cpp
+++ b/lib/Basic/Targets.cpp
@@ -930,7 +930,7 @@ public:
WindowsX86_32TargetInfo(const std::string& triple)
: X86_32TargetInfo(triple) {
TLSSupported = false;
- WCharType = SignedShort;
+ WCharType = UnsignedShort;
WCharWidth = WCharAlign = 16;
DoubleAlign = LongLongAlign = 64;
DescriptionString = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-"
diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp
index a2b8d13e3c99..5e872c290dfa 100644
--- a/lib/CodeGen/CGDebugInfo.cpp
+++ b/lib/CodeGen/CGDebugInfo.cpp
@@ -50,24 +50,6 @@ void CGDebugInfo::setLocation(SourceLocation Loc) {
/// getOrCreateCompileUnit - Get the compile unit from the cache or create a new
/// one if necessary. This returns null for invalid source locations.
llvm::DICompileUnit CGDebugInfo::getOrCreateCompileUnit(SourceLocation Loc) {
-
- // Each input file is encoded as a separate compile unit in LLVM
- // debugging information output. However, many target specific tool chains
- // prefer to encode only one compile unit in an object file. In this
- // situation, the LLVM code generator will include debugging information
- // entities in the compile unit that is marked as main compile unit. The
- // code generator accepts maximum one main compile unit per module. If a
- // module does not contain any main compile unit then the code generator
- // will emit multiple compile units in the output object file. Create main
- // compile unit if there is not one available.
- const LangOptions &LO = M->getLangOptions();
- if (isMainCompileUnitCreated == false) {
- if (LO.getMainFileName()) {
- createCompileUnit(LO.getMainFileName(), true /* isMain */);
- isMainCompileUnitCreated = true;
- }
- }
-
// Get source file information.
const char *FileName = "<unknown>";
SourceManager &SM = M->getContext().getSourceManager();
@@ -90,26 +72,25 @@ llvm::DICompileUnit CGDebugInfo::getOrCreateCompileUnit(SourceLocation Loc) {
AbsFileName = tmp;
}
- // There is only one main source file at a time whose compile unit
- // is already created.
- Unit = createCompileUnit(FileName, false /* isMain */);
- return Unit;
-}
-
-/// createCompileUnit - Create a new unit for the given file.
-llvm::DICompileUnit CGDebugInfo::createCompileUnit(const char *FileName,
- bool isMain) {
-
- // Get absolute path name.
- llvm::sys::Path AbsFileName(FileName);
- if (!AbsFileName.isAbsolute()) {
- llvm::sys::Path tmp = llvm::sys::Path::GetCurrentDirectory();
- tmp.appendComponent(FileName);
- AbsFileName = tmp;
+ // See if thie compile unit is representing main source file. Each source
+ // file has corresponding compile unit. There is only one main source
+ // file at a time.
+ bool isMain = false;
+ const LangOptions &LO = M->getLangOptions();
+ const char *MainFileName = LO.getMainFileName();
+ if (isMainCompileUnitCreated == false) {
+ if (MainFileName) {
+ if (!strcmp(AbsFileName.getLast().c_str(), MainFileName))
+ isMain = true;
+ } else {
+ if (Loc.isValid() && SM.isFromMainFile(Loc))
+ isMain = true;
+ }
+ if (isMain)
+ isMainCompileUnitCreated = true;
}
unsigned LangTag;
- const LangOptions &LO = M->getLangOptions();
if (LO.CPlusPlus) {
if (LO.ObjC1)
LangTag = llvm::dwarf::DW_LANG_ObjC_plus_plus;
@@ -133,13 +114,12 @@ llvm::DICompileUnit CGDebugInfo::createCompileUnit(const char *FileName,
RuntimeVers = LO.ObjCNonFragileABI ? 2 : 1;
// Create new compile unit.
- return DebugFactory.CreateCompileUnit(LangTag, AbsFileName.getLast(),
- AbsFileName.getDirname(),
- Producer, isMain, isOptimized,
- Flags, RuntimeVers);
+ return Unit = DebugFactory.CreateCompileUnit(LangTag, AbsFileName.getLast(),
+ AbsFileName.getDirname(),
+ Producer, isMain, isOptimized,
+ Flags, RuntimeVers);
}
-
/// CreateType - Get the Basic type from the cache or create a new
/// one if necessary.
llvm::DIType CGDebugInfo::CreateType(const BuiltinType *BT,
@@ -810,6 +790,9 @@ llvm::DIType CGDebugInfo::getOrCreateType(QualType Ty,
case Type::TypeOf:
return Slot = getOrCreateType(cast<TypeOfType>(Ty)->getUnderlyingType(),
Unit);
+ case Type::Decltype:
+ return Slot = getOrCreateType(cast<DecltypeType>(Ty)->getUnderlyingExpr()
+ ->getType(), Unit);
}
return Slot;
diff --git a/lib/CodeGen/CGDebugInfo.h b/lib/CodeGen/CGDebugInfo.h
index 8f3368e4ebfc..de655800fa08 100644
--- a/lib/CodeGen/CGDebugInfo.h
+++ b/lib/CodeGen/CGDebugInfo.h
@@ -111,9 +111,7 @@ private:
void EmitDeclare(const VarDecl *decl, unsigned Tag, llvm::Value *AI,
CGBuilderTy &Builder);
- /// createCompileUnit - Create a new unit for the given file.
- llvm::DICompileUnit createCompileUnit(const char *FileName, bool isMain);
-
+
/// getOrCreateCompileUnit - Get the compile unit from the cache or create a
/// new one if necessary.
llvm::DICompileUnit getOrCreateCompileUnit(SourceLocation Loc);
diff --git a/lib/CodeGen/CGDecl.cpp b/lib/CodeGen/CGDecl.cpp
index 4e603c34b404..f97c62f9d142 100644
--- a/lib/CodeGen/CGDecl.cpp
+++ b/lib/CodeGen/CGDecl.cpp
@@ -234,7 +234,7 @@ const llvm::Type *CodeGenFunction::BuildByRefType(QualType Ty,
}
// FIXME: Align this on at least an Align boundary, assert if we can't.
assert((Align <= unsigned(Target.getPointerAlign(0))/8)
- && "Can't align more thqn pointer yet");
+ && "Can't align more than pointer yet");
Types[needsCopyDispose*2 + 4] = LTy;
return llvm::StructType::get(Types, false);
}
diff --git a/lib/CodeGen/CGExpr.cpp b/lib/CodeGen/CGExpr.cpp
index 51c5b3d7dde1..a21140765c20 100644
--- a/lib/CodeGen/CGExpr.cpp
+++ b/lib/CodeGen/CGExpr.cpp
@@ -606,11 +606,12 @@ void CodeGenFunction::EmitStoreThroughExtVectorComponentLValue(RValue Src,
cast<llvm::VectorType>(Vec->getType())->getNumElements();
if (NumDstElts == NumSrcElts) {
// Use shuffle vector is the src and destination are the same number
- // of elements
- llvm::SmallVector<llvm::Constant*, 4> Mask;
+ // of elements and restore the vector mask since it is on the side
+ // it will be stored.
+ llvm::SmallVector<llvm::Constant*, 4> Mask(NumDstElts);
for (unsigned i = 0; i != NumSrcElts; ++i) {
unsigned InIdx = getAccessedFieldNo(i, Elts);
- Mask.push_back(llvm::ConstantInt::get(llvm::Type::Int32Ty, InIdx));
+ Mask[InIdx] = llvm::ConstantInt::get(llvm::Type::Int32Ty, i);
}
llvm::Value *MaskV = llvm::ConstantVector::get(&Mask[0], Mask.size());
diff --git a/lib/CodeGen/CGObjCGNU.cpp b/lib/CodeGen/CGObjCGNU.cpp
index 912479f0b0ed..4f96b8baec06 100644
--- a/lib/CodeGen/CGObjCGNU.cpp
+++ b/lib/CodeGen/CGObjCGNU.cpp
@@ -139,6 +139,7 @@ public:
const ObjCProtocolDecl *PD);
virtual void GenerateProtocol(const ObjCProtocolDecl *PD);
virtual llvm::Function *ModuleInitFunction();
+ virtual void MergeMetadataGlobals(std::vector<llvm::Constant*> &UsedArray);
virtual llvm::Function *GetPropertyGetFunction();
virtual llvm::Function *GetPropertySetFunction();
virtual llvm::Function *EnumerationMutationFunction();
@@ -998,6 +999,10 @@ void CGObjCGNU::GenerateClass(const ObjCImplementationDecl *OID) {
Classes.push_back(ClassStruct);
}
+void CGObjCGNU::MergeMetadataGlobals(
+ std::vector<llvm::Constant*> &UsedArray) {
+}
+
llvm::Function *CGObjCGNU::ModuleInitFunction() {
// Only emit an ObjC load function if no Objective-C stuff has been called
if (Classes.empty() && Categories.empty() && ConstantStrings.empty() &&
diff --git a/lib/CodeGen/CGObjCMac.cpp b/lib/CodeGen/CGObjCMac.cpp
index 6ffca8134afa..865e8c240be2 100644
--- a/lib/CodeGen/CGObjCMac.cpp
+++ b/lib/CodeGen/CGObjCMac.cpp
@@ -911,6 +911,8 @@ protected:
const CallArgList &CallArgs,
const ObjCCommonTypesHelper &ObjCTypes);
+ virtual void MergeMetadataGlobals(std::vector<llvm::Constant*> &UsedArray);
+
public:
CGObjCCommonMac(CodeGen::CodeGenModule &cgm) : CGM(cgm)
{ }
@@ -3426,6 +3428,16 @@ void CGObjCCommonMac::GetNameForMethod(const ObjCMethodDecl *D,
NameOut += ']';
}
+void CGObjCCommonMac::MergeMetadataGlobals(
+ std::vector<llvm::Constant*> &UsedArray) {
+ llvm::Type *i8PTy = llvm::PointerType::getUnqual(llvm::Type::Int8Ty);
+ for (std::vector<llvm::GlobalVariable*>::iterator i = UsedGlobals.begin(),
+ e = UsedGlobals.end(); i != e; ++i) {
+ UsedArray.push_back(llvm::ConstantExpr::getBitCast(cast<llvm::Constant>(*i),
+ i8PTy));
+ }
+}
+
void CGObjCMac::FinishModule() {
EmitModuleInfo();
@@ -3447,22 +3459,6 @@ void CGObjCMac::FinishModule() {
Values));
}
- std::vector<llvm::Constant*> Used;
- for (std::vector<llvm::GlobalVariable*>::iterator i = UsedGlobals.begin(),
- e = UsedGlobals.end(); i != e; ++i) {
- Used.push_back(llvm::ConstantExpr::getBitCast(*i, ObjCTypes.Int8PtrTy));
- }
-
- llvm::ArrayType *AT = llvm::ArrayType::get(ObjCTypes.Int8PtrTy, Used.size());
- llvm::GlobalValue *GV =
- new llvm::GlobalVariable(AT, false,
- llvm::GlobalValue::AppendingLinkage,
- llvm::ConstantArray::get(AT, Used),
- "llvm.used",
- &CGM.getModule());
-
- GV->setSection("llvm.metadata");
-
// Add assembler directives to add lazy undefined symbol references
// for classes which are referenced but not defined. This is
// important for correct linker interaction.
@@ -4111,24 +4107,6 @@ void CGObjCNonFragileABIMac::FinishNonFragileABIModule() {
IMGV->setSection("__DATA, __objc_imageinfo, regular, no_dead_strip");
IMGV->setConstant(true);
UsedGlobals.push_back(IMGV);
-
- std::vector<llvm::Constant*> Used;
-
- for (std::vector<llvm::GlobalVariable*>::iterator i = UsedGlobals.begin(),
- e = UsedGlobals.end(); i != e; ++i) {
- Used.push_back(llvm::ConstantExpr::getBitCast(*i, ObjCTypes.Int8PtrTy));
- }
-
- llvm::ArrayType *AT = llvm::ArrayType::get(ObjCTypes.Int8PtrTy, Used.size());
- llvm::GlobalValue *GV =
- new llvm::GlobalVariable(AT, false,
- llvm::GlobalValue::AppendingLinkage,
- llvm::ConstantArray::get(AT, Used),
- "llvm.used",
- &CGM.getModule());
-
- GV->setSection("llvm.metadata");
-
}
/// LegacyDispatchedSelector - Returns true if SEL is not in the list of
@@ -5036,16 +5014,13 @@ CodeGen::RValue CGObjCNonFragileABIMac::EmitMessageSend(
}
}
else if (!IsSuper && ResultType->isFloatingType()) {
- if (const BuiltinType *BT = ResultType->getAsBuiltinType()) {
- BuiltinType::Kind k = BT->getKind();
- if (k == BuiltinType::LongDouble) {
- Fn = ObjCTypes.getMessageSendFpretFixupFn();
- Name += "objc_msgSend_fpret_fixup";
- }
- else {
- Fn = ObjCTypes.getMessageSendFixupFn();
- Name += "objc_msgSend_fixup";
- }
+ if (ResultType->isSpecificBuiltinType(BuiltinType::LongDouble)) {
+ Fn = ObjCTypes.getMessageSendFpretFixupFn();
+ Name += "objc_msgSend_fpret_fixup";
+ }
+ else {
+ Fn = ObjCTypes.getMessageSendFixupFn();
+ Name += "objc_msgSend_fixup";
}
}
else {
diff --git a/lib/CodeGen/CGObjCRuntime.h b/lib/CodeGen/CGObjCRuntime.h
index b8cf026b35a9..0f9cf0606d36 100644
--- a/lib/CodeGen/CGObjCRuntime.h
+++ b/lib/CodeGen/CGObjCRuntime.h
@@ -95,6 +95,9 @@ public:
/// this compilation unit with the runtime library.
virtual llvm::Function *ModuleInitFunction() = 0;
+ /// Add metadata globals to the 'used' globals for final output.
+ virtual void MergeMetadataGlobals(std::vector<llvm::Constant*> &UsedArray) = 0;
+
/// Get a selector for the specified name and type values. The
/// return value should have the LLVM type for pointer-to
/// ASTContext::getObjCSelType().
diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp
index f926c05a9983..0a531e9b21a6 100644
--- a/lib/CodeGen/CodeGenModule.cpp
+++ b/lib/CodeGen/CodeGenModule.cpp
@@ -406,11 +406,12 @@ void CodeGenModule::AddUsedGlobal(llvm::GlobalValue *GV) {
void CodeGenModule::EmitLLVMUsed() {
// Don't create llvm.used if there is no need.
- if (LLVMUsed.empty())
+ // FIXME. Runtime indicates that there might be more 'used' symbols; but not
+ // necessariy. So, this test is not accurate for emptiness.
+ if (LLVMUsed.empty() && !Runtime)
return;
llvm::Type *i8PTy = llvm::PointerType::getUnqual(llvm::Type::Int8Ty);
- llvm::ArrayType *ATy = llvm::ArrayType::get(i8PTy, LLVMUsed.size());
// Convert LLVMUsed to what ConstantArray needs.
std::vector<llvm::Constant*> UsedArray;
@@ -420,6 +421,12 @@ void CodeGenModule::EmitLLVMUsed() {
llvm::ConstantExpr::getBitCast(cast<llvm::Constant>(&*LLVMUsed[i]), i8PTy);
}
+ if (Runtime)
+ Runtime->MergeMetadataGlobals(UsedArray);
+ if (UsedArray.empty())
+ return;
+ llvm::ArrayType *ATy = llvm::ArrayType::get(i8PTy, UsedArray.size());
+
llvm::GlobalVariable *GV =
new llvm::GlobalVariable(ATy, false,
llvm::GlobalValue::AppendingLinkage,
diff --git a/lib/CodeGen/Mangle.cpp b/lib/CodeGen/Mangle.cpp
index 24e441a29635..b5ad5acc0162 100644
--- a/lib/CodeGen/Mangle.cpp
+++ b/lib/CodeGen/Mangle.cpp
@@ -539,6 +539,9 @@ void CXXNameMangler::mangleType(const BuiltinType *T) {
assert(false &&
"Overloaded and dependent types shouldn't get to name mangling");
break;
+ case BuiltinType::UndeducedAuto:
+ assert(0 && "Should not see undeduced auto here");
+ break;
}
}
diff --git a/lib/Frontend/ASTUnit.cpp b/lib/Frontend/ASTUnit.cpp
index a7fbcda8fc2b..8143263ca2f9 100644
--- a/lib/Frontend/ASTUnit.cpp
+++ b/lib/Frontend/ASTUnit.cpp
@@ -113,14 +113,10 @@ ASTUnit *ASTUnit::LoadFromPCHFile(const std::string &Filename,
break;
case PCHReader::Failure:
- // Unrecoverable failure: don't even try to process the input
- // file.
+ case PCHReader::IgnorePCH:
if (ErrMsg)
*ErrMsg = "Could not load PCH file";
return NULL;
-
- case PCHReader::IgnorePCH:
- assert(0 && "Is there a validation that should not have happened ?");
}
// PCH loaded successfully. Now create the preprocessor.
diff --git a/lib/Frontend/AnalysisConsumer.cpp b/lib/Frontend/AnalysisConsumer.cpp
index ae90594a4099..d8fa141d8cb6 100644
--- a/lib/Frontend/AnalysisConsumer.cpp
+++ b/lib/Frontend/AnalysisConsumer.cpp
@@ -469,10 +469,6 @@ static void ActionCheckerCFRef(AnalysisManager& mgr) {
}
}
-static void ActionCheckerSimple(AnalysisManager& mgr) {
- ActionGRExprEngine(mgr, MakeGRSimpleValsTF());
-}
-
static void ActionDisplayLiveVariables(AnalysisManager& mgr) {
if (LiveVariables* L = mgr.getLiveVariables()) {
mgr.DisplayFunction();
diff --git a/lib/Frontend/CMakeLists.txt b/lib/Frontend/CMakeLists.txt
index 4ba39c959424..f8d09dbee89e 100644
--- a/lib/Frontend/CMakeLists.txt
+++ b/lib/Frontend/CMakeLists.txt
@@ -3,6 +3,7 @@ set(LLVM_NO_RTTI 1)
add_clang_library(clangFrontend
AnalysisConsumer.cpp
ASTConsumers.cpp
+ ASTUnit.cpp
Backend.cpp
CacheTokens.cpp
DeclXML.cpp
@@ -25,6 +26,7 @@ add_clang_library(clangFrontend
PlistDiagnostics.cpp
PrintParserCallbacks.cpp
PrintPreprocessedOutput.cpp
+ ResolveLocation.cpp
RewriteBlocks.cpp
RewriteMacros.cpp
RewriteObjC.cpp
@@ -36,4 +38,7 @@ add_clang_library(clangFrontend
Warnings.cpp
)
-add_dependencies(clangFrontend ClangDiagnosticFrontend)
+add_dependencies(clangFrontend
+ ClangDiagnosticFrontend
+ ClangDiagnosticLex
+ ClangDiagnosticSema)
diff --git a/lib/Frontend/PCHReader.cpp b/lib/Frontend/PCHReader.cpp
index 96f21f112867..765655b01dd0 100644
--- a/lib/Frontend/PCHReader.cpp
+++ b/lib/Frontend/PCHReader.cpp
@@ -71,6 +71,7 @@ PCHValidator::ReadLanguageOptions(const LangOptions &LangOpts) {
PARSE_LANGOPT_BENIGN(WritableStrings);
PARSE_LANGOPT_IMPORTANT(LaxVectorConversions,
diag::warn_pch_lax_vector_conversions);
+ PARSE_LANGOPT_IMPORTANT(AltiVec, diag::warn_pch_altivec);
PARSE_LANGOPT_IMPORTANT(Exceptions, diag::warn_pch_exceptions);
PARSE_LANGOPT_IMPORTANT(NeXTRuntime, diag::warn_pch_objc_runtime);
PARSE_LANGOPT_IMPORTANT(Freestanding, diag::warn_pch_freestanding);
@@ -105,6 +106,7 @@ PCHValidator::ReadLanguageOptions(const LangOptions &LangOpts) {
}
PARSE_LANGOPT_BENIGN(getVisibilityMode());
PARSE_LANGOPT_BENIGN(InstantiationDepth);
+ PARSE_LANGOPT_IMPORTANT(OpenCL, diag::warn_pch_opencl);
#undef PARSE_LANGOPT_IRRELEVANT
#undef PARSE_LANGOPT_BENIGN
@@ -1629,6 +1631,7 @@ bool PCHReader::ParseLanguageOptions(
PARSE_LANGOPT(PascalStrings);
PARSE_LANGOPT(WritableStrings);
PARSE_LANGOPT(LaxVectorConversions);
+ PARSE_LANGOPT(AltiVec);
PARSE_LANGOPT(Exceptions);
PARSE_LANGOPT(NeXTRuntime);
PARSE_LANGOPT(Freestanding);
@@ -1652,6 +1655,7 @@ bool PCHReader::ParseLanguageOptions(
LangOpts.setVisibilityMode((LangOptions::VisibilityMode)Record[Idx]);
++Idx;
PARSE_LANGOPT(InstantiationDepth);
+ PARSE_LANGOPT(OpenCL);
#undef PARSE_LANGOPT
return Listener->ReadLanguageOptions(LangOpts);
@@ -1822,7 +1826,10 @@ QualType PCHReader::ReadTypeRecord(uint64_t Offset) {
QualType UnderlyingType = GetType(Record[0]);
return Context->getTypeOfType(UnderlyingType);
}
-
+
+ case pch::TYPE_DECLTYPE:
+ return Context->getDecltypeType(ReadTypeExpr());
+
case pch::TYPE_RECORD:
assert(Record.size() == 1 && "incorrect encoding of record type");
return Context->getTypeDeclType(cast<RecordDecl>(GetDecl(Record[0])));
diff --git a/lib/Frontend/PCHReaderDecl.cpp b/lib/Frontend/PCHReaderDecl.cpp
index 3dd84c7b08ad..3f6ae354dc3f 100644
--- a/lib/Frontend/PCHReaderDecl.cpp
+++ b/lib/Frontend/PCHReaderDecl.cpp
@@ -489,6 +489,14 @@ Attr *PCHReader::ReadAttributes() {
New = ::new (*Context) NonNullAttr(ArgNums.data(), Size);
break;
}
+
+ case Attr::ReqdWorkGroupSize: {
+ unsigned X = Record[Idx++];
+ unsigned Y = Record[Idx++];
+ unsigned Z = Record[Idx++];
+ New = ::new (*Context) ReqdWorkGroupSizeAttr(X, Y, Z);
+ break;
+ }
SIMPLE_ATTR(ObjCException);
SIMPLE_ATTR(ObjCNSObject);
diff --git a/lib/Frontend/PCHWriter.cpp b/lib/Frontend/PCHWriter.cpp
index 3b1eb080f229..e93219e01d5c 100644
--- a/lib/Frontend/PCHWriter.cpp
+++ b/lib/Frontend/PCHWriter.cpp
@@ -185,6 +185,11 @@ void PCHTypeWriter::VisitTypeOfType(const TypeOfType *T) {
Code = pch::TYPE_TYPEOF;
}
+void PCHTypeWriter::VisitDecltypeType(const DecltypeType *T) {
+ Writer.AddStmt(T->getUnderlyingExpr());
+ Code = pch::TYPE_DECLTYPE;
+}
+
void PCHTypeWriter::VisitTagType(const TagType *T) {
Writer.AddDeclRef(T->getDecl(), Record);
assert(!T->isBeingDefined() &&
@@ -526,6 +531,7 @@ void PCHWriter::WriteLanguageOptions(const LangOptions &LangOpts) {
Record.push_back(LangOpts.PascalStrings); // Allow Pascal strings
Record.push_back(LangOpts.WritableStrings); // Allow writable strings
Record.push_back(LangOpts.LaxVectorConversions);
+ Record.push_back(LangOpts.AltiVec);
Record.push_back(LangOpts.Exceptions); // Support exception handling.
Record.push_back(LangOpts.NeXTRuntime); // Use NeXT runtime.
@@ -563,6 +569,7 @@ void PCHWriter::WriteLanguageOptions(const LangOptions &LangOpts) {
Record.push_back(LangOpts.getGCMode());
Record.push_back(LangOpts.getVisibilityMode());
Record.push_back(LangOpts.InstantiationDepth);
+ Record.push_back(LangOpts.OpenCL);
Stream.EmitRecord(pch::LANGUAGE_OPTIONS, Record);
}
@@ -1615,6 +1622,12 @@ void PCHWriter::WriteAttributeRecord(const Attr *Attr) {
case Attr::Regparm:
Record.push_back(cast<RegparmAttr>(Attr)->getNumParams());
break;
+
+ case Attr::ReqdWorkGroupSize:
+ Record.push_back(cast<ReqdWorkGroupSizeAttr>(Attr)->getXDim());
+ Record.push_back(cast<ReqdWorkGroupSizeAttr>(Attr)->getYDim());
+ Record.push_back(cast<ReqdWorkGroupSizeAttr>(Attr)->getZDim());
+ break;
case Attr::Section:
AddString(cast<SectionAttr>(Attr)->getName(), Record);
@@ -1896,6 +1909,9 @@ void PCHWriter::AddTypeRef(QualType T, RecordData &Record) {
case BuiltinType::NullPtr: ID = pch::PREDEF_TYPE_NULLPTR_ID; break;
case BuiltinType::Overload: ID = pch::PREDEF_TYPE_OVERLOAD_ID; break;
case BuiltinType::Dependent: ID = pch::PREDEF_TYPE_DEPENDENT_ID; break;
+ case BuiltinType::UndeducedAuto:
+ assert(0 && "Should not see undeduced auto here");
+ break;
}
Record.push_back((ID << 3) | T.getCVRQualifiers());
diff --git a/lib/Frontend/ResolveLocation.cpp b/lib/Frontend/ResolveLocation.cpp
new file mode 100644
index 000000000000..a5f0d1f16365
--- /dev/null
+++ b/lib/Frontend/ResolveLocation.cpp
@@ -0,0 +1,322 @@
+//===--- ResolveLocation.cpp - Source location resolver ---------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This defines the ResolveLocationInAST function, which resolves a
+// source location into a <Decl *, Stmt *> pair.
+//
+//===----------------------------------------------------------------------===//
+
+#include "clang/Frontend/Utils.h"
+#include "clang/AST/DeclVisitor.h"
+#include "clang/AST/StmtVisitor.h"
+#include "clang/Lex/Lexer.h"
+#include "clang/Basic/SourceManager.h"
+#include "llvm/Support/Compiler.h"
+using namespace clang;
+
+namespace {
+
+/// \brief Base for the LocResolver classes. Mostly does source range checking.
+class VISIBILITY_HIDDEN LocResolverBase {
+protected:
+ ASTContext &Ctx;
+ SourceLocation Loc;
+
+ Decl *Dcl;
+ Stmt *Stm;
+ bool PassedLoc;
+
+ /// \brief Checks whether Loc is in the source range of 'D'.
+ ///
+ /// If it is, updates Dcl. If Loc is passed the source range, it sets
+ /// PassedLoc, otherwise it does nothing.
+ void CheckRange(Decl *D);
+
+ /// \brief Checks whether Loc is in the source range of 'Node'.
+ ///
+ /// If it is, updates Stm. If Loc is passed the source range, it sets
+ /// PassedLoc, otherwise it does nothing.
+ void CheckRange(Stmt *Node);
+
+ /// \brief Updates the end source range to cover the full length of the token
+ /// positioned at the end of the source range.
+ ///
+ /// e.g.,
+ /// @code
+ /// int foo
+ /// ^ ^
+ /// @endcode
+ /// will be updated to
+ /// @code
+ /// int foo
+ /// ^ ^
+ /// @endcode
+ void FixRange(SourceRange &Range);
+
+public:
+ LocResolverBase(ASTContext &ctx, SourceLocation loc)
+ : Ctx(ctx), Loc(loc), Dcl(0), Stm(0), PassedLoc(0) {}
+
+ /// \brief We found a AST node that corresponds to the source location.
+ bool FoundIt() const { return Dcl != 0 || Stm != 0; }
+
+ /// \brief We either found a AST node or we passed the source location while
+ /// searching.
+ bool Finished() const { return FoundIt() || PassedLoc; }
+
+ Decl *getDecl() const { return Dcl; }
+ Stmt *getStmt() const { return Stm; }
+
+ std::pair<Decl *, Stmt *> getResult() const {
+ return std::make_pair(getDecl(), getStmt());
+ }
+
+ /// \brief Debugging output.
+ void print(Decl *D);
+ /// \brief Debugging output.
+ void print(Stmt *Node);
+};
+
+/// \brief Searches a statement for the AST node that corresponds to a source
+/// location.
+class VISIBILITY_HIDDEN StmtLocResolver : public LocResolverBase,
+ public StmtVisitor<StmtLocResolver> {
+public:
+ StmtLocResolver(ASTContext &ctx, SourceLocation loc)
+ : LocResolverBase(ctx, loc) {}
+
+ void VisitDeclStmt(DeclStmt *Node);
+ void VisitStmt(Stmt *Node);
+};
+
+/// \brief Searches a declaration for the AST node that corresponds to a source
+/// location.
+class VISIBILITY_HIDDEN DeclLocResolver : public LocResolverBase,
+ public DeclVisitor<DeclLocResolver> {
+public:
+ DeclLocResolver(ASTContext &ctx, SourceLocation loc)
+ : LocResolverBase(ctx, loc) {}
+
+ void VisitDeclContext(DeclContext *DC);
+ void VisitTranslationUnitDecl(TranslationUnitDecl *TU);
+ void VisitVarDecl(VarDecl *D);
+ void VisitFunctionDecl(FunctionDecl *D);
+ void VisitDecl(Decl *D);
+};
+
+} // anonymous namespace
+
+void StmtLocResolver::VisitDeclStmt(DeclStmt *Node) {
+ CheckRange(Node);
+ if (!FoundIt())
+ return;
+ assert(Stm == Node && "Result not updated ?");
+
+ // Search all declarations of this DeclStmt. If we found the one corresponding
+ // to the source location, update this StmtLocResolver's result.
+ DeclLocResolver DLR(Ctx, Loc);
+ for (DeclStmt::decl_iterator
+ I = Node->decl_begin(), E = Node->decl_end(); I != E; ++I) {
+ DLR.Visit(*I);
+ if (DLR.Finished()) {
+ if (DLR.FoundIt())
+ llvm::tie(Dcl, Stm) = DLR.getResult();
+ return;
+ }
+ }
+}
+
+void StmtLocResolver::VisitStmt(Stmt *Node) {
+ CheckRange(Node);
+ if (!FoundIt())
+ return;
+ assert(Stm == Node && "Result not updated ?");
+
+ // Search the child statements.
+ StmtLocResolver SLR(Ctx, Loc);
+ for (Stmt::child_iterator
+ I = Node->child_begin(), E = Node->child_end(); I != E; ++I) {
+ SLR.Visit(*I);
+ if (!SLR.Finished())
+ continue;
+
+ // We either found it or we passed the source location.
+
+ if (SLR.FoundIt()) {
+ // Only update Dcl if we found another more immediate 'parent' Decl for
+ // the statement.
+ if (SLR.getDecl())
+ Dcl = SLR.getDecl();
+ Stm = SLR.getStmt();
+ }
+
+ return;
+ }
+}
+
+void DeclLocResolver::VisitDeclContext(DeclContext *DC) {
+ DeclLocResolver DLR(Ctx, Loc);
+ for (DeclContext::decl_iterator
+ I = DC->decls_begin(Ctx), E = DC->decls_end(Ctx); I != E; ++I) {
+ DLR.Visit(*I);
+ if (DLR.Finished()) {
+ if (DLR.FoundIt())
+ llvm::tie(Dcl, Stm) = DLR.getResult();
+ return;
+ }
+ }
+}
+
+void DeclLocResolver::VisitTranslationUnitDecl(TranslationUnitDecl *TU) {
+ VisitDeclContext(TU);
+}
+
+void DeclLocResolver::VisitFunctionDecl(FunctionDecl *D) {
+ CheckRange(D);
+ if (!FoundIt())
+ return;
+ assert(Dcl == D && "Result not updated ?");
+
+ // First, search through the parameters of the function.
+ DeclLocResolver ParmRes(Ctx, Loc);
+ for (FunctionDecl::param_iterator
+ I = D->param_begin(), E = D->param_end(); I != E; ++I) {
+ ParmRes.Visit(*I);
+ if (ParmRes.Finished()) {
+ if (ParmRes.FoundIt())
+ llvm::tie(Dcl, Stm) = ParmRes.getResult();
+ return;
+ }
+ }
+
+ // We didn't found the location in the parameters and we didn't get passed it.
+
+ // Second, search through the declarations that are part of the function.
+ // If we find he location there, we won't have to search through its body.
+ DeclLocResolver DLR(Ctx, Loc);
+ DLR.VisitDeclContext(D);
+ if (DLR.FoundIt()) {
+ llvm::tie(Dcl, Stm) = DLR.getResult();
+ return;
+ }
+
+ // We didn't find a declaration that corresponds to the source location.
+
+ // Finally, search through the body of the function.
+ if (D->isThisDeclarationADefinition()) {
+ StmtLocResolver SLR(Ctx, Loc);
+ SLR.Visit(D->getBody(Ctx));
+ if (SLR.FoundIt()) {
+ llvm::tie(Dcl, Stm) = SLR.getResult();
+ // If we didn't find a more immediate 'parent' declaration for the
+ // statement, set the function as the parent.
+ if (Dcl == 0)
+ Dcl = D;
+ }
+ }
+}
+
+void DeclLocResolver::VisitVarDecl(VarDecl *D) {
+ CheckRange(D);
+ if (!FoundIt())
+ return;
+ assert(Dcl == D && "Result not updated ?");
+
+ // Check whether the location points to the init expression.
+ if (D->getInit()) {
+ StmtLocResolver SLR(Ctx, Loc);
+ SLR.Visit(D->getInit());
+ Stm = SLR.getStmt();
+ }
+}
+
+void DeclLocResolver::VisitDecl(Decl *D) {
+ CheckRange(D);
+}
+
+void LocResolverBase::CheckRange(Decl *D) {
+ SourceRange Range = D->getSourceRange();
+ if (!Range.isValid())
+ return;
+
+ FixRange(Range);
+
+ SourceManager &SourceMgr = Ctx.getSourceManager();
+ if (SourceMgr.isBeforeInTranslationUnit(Range.getEnd(), Loc))
+ return;
+
+ if (SourceMgr.isBeforeInTranslationUnit(Loc, Range.getBegin()))
+ PassedLoc = true;
+ else
+ Dcl = D;
+}
+
+void LocResolverBase::CheckRange(Stmt *Node) {
+ SourceRange Range = Node->getSourceRange();
+ if (!Range.isValid())
+ return;
+
+ FixRange(Range);
+
+ SourceManager &SourceMgr = Ctx.getSourceManager();
+ if (SourceMgr.isBeforeInTranslationUnit(Range.getEnd(), Loc))
+ return;
+
+ if (SourceMgr.isBeforeInTranslationUnit(Loc, Range.getBegin()))
+ PassedLoc = true;
+ else
+ Stm = Node;
+}
+
+void LocResolverBase::FixRange(SourceRange &Range) {
+ if (!Range.isValid())
+ return;
+
+ unsigned TokSize = Lexer::MeasureTokenLength(Range.getEnd(),
+ Ctx.getSourceManager(),
+ Ctx.getLangOptions());
+ Range.setEnd(Range.getEnd().getFileLocWithOffset(TokSize-1));
+}
+
+void LocResolverBase::print(Decl *D) {
+ llvm::raw_ostream &OS = llvm::outs();
+ OS << "#### DECL ####\n";
+ D->print(OS, Ctx);
+ OS << " <";
+ D->getLocStart().print(OS, Ctx.getSourceManager());
+ OS << " > - <";
+ D->getLocEnd().print(OS, Ctx.getSourceManager());
+ OS << ">\n\n";
+ OS.flush();
+}
+
+void LocResolverBase::print(Stmt *Node) {
+ llvm::raw_ostream &OS = llvm::outs();
+ OS << "#### STMT ####\n";
+ Node->printPretty(OS, Ctx);
+ OS << " <";
+ Node->getLocStart().print(OS, Ctx.getSourceManager());
+ OS << " > - <";
+ Node->getLocEnd().print(OS, Ctx.getSourceManager());
+ OS << ">\n\n";
+ OS.flush();
+}
+
+
+/// \brief Returns the AST node that a source location points to.
+///
+std::pair<Decl *, Stmt *>
+clang::ResolveLocationInAST(ASTContext &Ctx, SourceLocation Loc) {
+ if (Loc.isInvalid())
+ return std::make_pair((Decl*)0, (Stmt*)0);
+
+ DeclLocResolver DLR(Ctx, Loc);
+ DLR.Visit(Ctx.getTranslationUnitDecl());
+ return DLR.getResult();
+}
diff --git a/lib/Headers/CMakeLists.txt b/lib/Headers/CMakeLists.txt
index 318685a89949..57d7ee5cdd8a 100644
--- a/lib/Headers/CMakeLists.txt
+++ b/lib/Headers/CMakeLists.txt
@@ -31,7 +31,7 @@ foreach( f ${files} )
COMMENT "Copying clang's ${f}...")
endforeach( f )
-add_custom_target(clang_headers ALL
+add_custom_target(clang-headers ALL
DEPENDS ${files})
install(FILES ${files}
diff --git a/lib/Parse/AttributeList.cpp b/lib/Parse/AttributeList.cpp
index 3fb6f950efc4..5ee668a31723 100644
--- a/lib/Parse/AttributeList.cpp
+++ b/lib/Parse/AttributeList.cpp
@@ -118,6 +118,7 @@ AttributeList::Kind AttributeList::getKind(const IdentifierInfo *Name) {
case 13:
if (!memcmp(Str, "address_space", 13)) return AT_address_space;
if (!memcmp(Str, "always_inline", 13)) return AT_always_inline;
+ if (!memcmp(Str, "vec_type_hint", 13)) return IgnoredAttribute;
break;
case 14:
if (!memcmp(Str, "objc_exception", 14)) return AT_objc_exception;
@@ -136,6 +137,8 @@ AttributeList::Kind AttributeList::getKind(const IdentifierInfo *Name) {
if (!memcmp(Str, "ns_returns_retained", 19)) return AT_ns_returns_retained;
if (!memcmp(Str, "cf_returns_retained", 19)) return AT_cf_returns_retained;
break;
+ case 20:
+ if (!memcmp(Str, "reqd_work_group_size", 20)) return AT_reqd_wg_size;
case 22:
if (!memcmp(Str, "no_instrument_function", 22))
return AT_no_instrument_function;
diff --git a/lib/Parse/DeclSpec.cpp b/lib/Parse/DeclSpec.cpp
index d8c6986f9ea6..8b3b2851c1e0 100644
--- a/lib/Parse/DeclSpec.cpp
+++ b/lib/Parse/DeclSpec.cpp
@@ -173,6 +173,7 @@ const char *DeclSpec::getSpecifierName(DeclSpec::TST T) {
case DeclSpec::TST_typename: return "type-name";
case DeclSpec::TST_typeofType:
case DeclSpec::TST_typeofExpr: return "typeof";
+ case DeclSpec::TST_auto: return "auto";
}
}
diff --git a/lib/Parse/MinimalAction.cpp b/lib/Parse/MinimalAction.cpp
index 9ded366b29f9..648e2da54bfe 100644
--- a/lib/Parse/MinimalAction.cpp
+++ b/lib/Parse/MinimalAction.cpp
@@ -48,6 +48,7 @@ Action::DeclPtrTy Action::ActOnUsingDeclaration(Scope *CurScope,
const CXXScopeSpec &SS,
SourceLocation IdentLoc,
IdentifierInfo *TargetName,
+ OverloadedOperatorKind Op,
AttributeList *AttrList,
bool IsTypeName) {
diff --git a/lib/Parse/ParseDecl.cpp b/lib/Parse/ParseDecl.cpp
index 426f56f4380e..ff602e8ba79b 100644
--- a/lib/Parse/ParseDecl.cpp
+++ b/lib/Parse/ParseDecl.cpp
@@ -149,13 +149,35 @@ AttributeList *Parser::ParseAttributes(SourceLocation *EndLoc) {
}
}
} else { // not an identifier
+ switch (Tok.getKind()) {
+ case tok::r_paren:
// parse a possibly empty comma separated list of expressions
- if (Tok.is(tok::r_paren)) {
// __attribute__(( nonnull() ))
ConsumeParen(); // ignore the right paren loc for now
CurrAttr = new AttributeList(AttrName, AttrNameLoc,
0, SourceLocation(), 0, 0, CurrAttr);
- } else {
+ break;
+ case tok::kw_char:
+ case tok::kw_wchar_t:
+ case tok::kw_bool:
+ case tok::kw_short:
+ case tok::kw_int:
+ case tok::kw_long:
+ case tok::kw_signed:
+ case tok::kw_unsigned:
+ case tok::kw_float:
+ case tok::kw_double:
+ case tok::kw_void:
+ case tok::kw_typeof:
+ // If it's a builtin type name, eat it and expect a rparen
+ // __attribute__(( vec_type_hint(char) ))
+ ConsumeToken();
+ CurrAttr = new AttributeList(AttrName, AttrNameLoc,
+ 0, SourceLocation(), 0, 0, CurrAttr);
+ if (Tok.is(tok::r_paren))
+ ConsumeParen();
+ break;
+ default:
// __attribute__(( aligned(16) ))
ExprVector ArgExprs(Actions);
bool ArgExprsOk = true;
@@ -181,6 +203,7 @@ AttributeList *Parser::ParseAttributes(SourceLocation *EndLoc) {
SourceLocation(), ArgExprs.take(), ArgExprs.size(),
CurrAttr);
}
+ break;
}
}
} else {
@@ -371,7 +394,8 @@ Parser::DeclGroupPtrTy Parser::ParseSimpleDeclaration(unsigned Context,
/// According to the standard grammar, =default and =delete are function
/// definitions, but that definitely doesn't fit with the parser here.
///
-Parser::DeclPtrTy Parser::ParseDeclarationAfterDeclarator(Declarator &D) {
+Parser::DeclPtrTy Parser::ParseDeclarationAfterDeclarator(Declarator &D,
+ const ParsedTemplateInfo &TemplateInfo) {
// If a simple-asm-expr is present, parse it.
if (Tok.is(tok::kw_asm)) {
SourceLocation Loc;
@@ -393,7 +417,13 @@ Parser::DeclPtrTy Parser::ParseDeclarationAfterDeclarator(Declarator &D) {
}
// Inform the current actions module that we just parsed this declarator.
- DeclPtrTy ThisDecl = Actions.ActOnDeclarator(CurScope, D);
+ DeclPtrTy ThisDecl = TemplateInfo.TemplateParams?
+ Actions.ActOnTemplateDeclarator(CurScope,
+ Action::MultiTemplateParamsArg(Actions,
+ TemplateInfo.TemplateParams->data(),
+ TemplateInfo.TemplateParams->size()),
+ D)
+ : Actions.ActOnDeclarator(CurScope, D);
// Parse declarator '=' initializer.
if (Tok.is(tok::equal)) {
@@ -896,7 +926,10 @@ void Parser::ParseDeclarationSpecifiers(DeclSpec &DS,
isInvalid = DS.SetStorageClassSpec(DeclSpec::SCS_static, Loc, PrevSpec);
break;
case tok::kw_auto:
- isInvalid = DS.SetStorageClassSpec(DeclSpec::SCS_auto, Loc, PrevSpec);
+ if (getLang().CPlusPlus0x)
+ isInvalid = DS.SetTypeSpecType(DeclSpec::TST_auto, Loc, PrevSpec);
+ else
+ isInvalid = DS.SetStorageClassSpec(DeclSpec::SCS_auto, Loc, PrevSpec);
break;
case tok::kw_register:
isInvalid = DS.SetStorageClassSpec(DeclSpec::SCS_register, Loc, PrevSpec);
@@ -1018,6 +1051,10 @@ void Parser::ParseDeclarationSpecifiers(DeclSpec &DS,
ParseTypeofSpecifier(DS);
continue;
+ case tok::kw_decltype:
+ ParseDecltypeSpecifier(DS);
+ continue;
+
case tok::less:
// GCC ObjC supports types like "<SomeProtocol>" as a synonym for
// "id<SomeProtocol>". This is hopelessly old fashioned and dangerous,
@@ -1095,6 +1132,7 @@ void Parser::ParseDeclarationSpecifiers(DeclSpec &DS,
/// [GNU] typeof-specifier
/// [OBJC] class-name objc-protocol-refs[opt] [TODO]
/// [OBJC] typedef-name objc-protocol-refs[opt] [TODO]
+/// [C++0x] 'decltype' ( expression )
bool Parser::ParseOptionalTypeSpecifier(DeclSpec &DS, int& isInvalid,
const char *&PrevSpec,
const ParsedTemplateInfo &TemplateInfo) {
@@ -1235,6 +1273,18 @@ bool Parser::ParseOptionalTypeSpecifier(DeclSpec &DS, int& isInvalid,
ParseTypeofSpecifier(DS);
return true;
+ // C++0x decltype support.
+ case tok::kw_decltype:
+ ParseDecltypeSpecifier(DS);
+ return true;
+
+ // C++0x auto support.
+ case tok::kw_auto:
+ if (!getLang().CPlusPlus0x)
+ return false;
+
+ isInvalid = DS.SetTypeSpecType(DeclSpec::TST_auto, Loc, PrevSpec);
+ break;
case tok::kw___ptr64:
case tok::kw___w64:
case tok::kw___cdecl:
diff --git a/lib/Parse/ParseDeclCXX.cpp b/lib/Parse/ParseDeclCXX.cpp
index 44f231a66786..225f9261ef8f 100644
--- a/lib/Parse/ParseDeclCXX.cpp
+++ b/lib/Parse/ParseDeclCXX.cpp
@@ -11,6 +11,7 @@
//
//===----------------------------------------------------------------------===//
+#include "clang/Basic/OperatorKinds.h"
#include "clang/Parse/Parser.h"
#include "clang/Parse/ParseDiagnostic.h"
#include "clang/Parse/DeclSpec.h"
@@ -274,8 +275,6 @@ Parser::DeclPtrTy Parser::ParseUsingDeclaration(unsigned Context,
ParseOptionalCXXScopeSpecifier(SS);
AttributeList *AttrList = 0;
- IdentifierInfo *TargetName = 0;
- SourceLocation IdentLoc = SourceLocation();
// Check nested-name specifier.
if (SS.isInvalid()) {
@@ -287,17 +286,33 @@ Parser::DeclPtrTy Parser::ParseUsingDeclaration(unsigned Context,
SkipUntil(tok::semi);
return DeclPtrTy();
}
- if (Tok.isNot(tok::identifier)) {
+
+ IdentifierInfo *TargetName = 0;
+ OverloadedOperatorKind Op = OO_None;
+ SourceLocation IdentLoc;
+
+ if (Tok.is(tok::kw_operator)) {
+ IdentLoc = Tok.getLocation();
+
+ Op = TryParseOperatorFunctionId();
+ if (!Op) {
+ // If there was an invalid operator, skip to end of decl, and eat ';'.
+ SkipUntil(tok::semi);
+ return DeclPtrTy();
+ }
+ } else if (Tok.is(tok::identifier)) {
+ // Parse identifier.
+ TargetName = Tok.getIdentifierInfo();
+ IdentLoc = ConsumeToken();
+ } else {
+ // FIXME: Use a better diagnostic here.
Diag(Tok, diag::err_expected_ident_in_using);
+
// If there was invalid identifier, skip to end of decl, and eat ';'.
SkipUntil(tok::semi);
return DeclPtrTy();
}
- // Parse identifier.
- TargetName = Tok.getIdentifierInfo();
- IdentLoc = ConsumeToken();
-
// Parse (optional) attributes (most likely GNU strong-using extension).
if (Tok.is(tok::kw___attribute))
AttrList = ParseAttributes();
@@ -308,7 +323,8 @@ Parser::DeclPtrTy Parser::ParseUsingDeclaration(unsigned Context,
AttrList ? "attributes list" : "namespace name", tok::semi);
return Actions.ActOnUsingDeclaration(CurScope, UsingLoc, SS,
- IdentLoc, TargetName, AttrList, IsTypeName);
+ IdentLoc, TargetName, Op,
+ AttrList, IsTypeName);
}
/// ParseStaticAssertDeclaration - Parse C++0x static_assert-declaratoion.
@@ -355,6 +371,51 @@ Parser::DeclPtrTy Parser::ParseStaticAssertDeclaration(SourceLocation &DeclEnd){
move(AssertMessage));
}
+/// ParseDecltypeSpecifier - Parse a C++0x decltype specifier.
+///
+/// 'decltype' ( expression )
+///
+void Parser::ParseDecltypeSpecifier(DeclSpec &DS) {
+ assert(Tok.is(tok::kw_decltype) && "Not a decltype specifier");
+
+ SourceLocation StartLoc = ConsumeToken();
+ SourceLocation LParenLoc = Tok.getLocation();
+
+ if (ExpectAndConsume(tok::l_paren, diag::err_expected_lparen_after,
+ "decltype")) {
+ SkipUntil(tok::r_paren);
+ return;
+ }
+
+ // Parse the expression
+
+ // C++0x [dcl.type.simple]p4:
+ // The operand of the decltype specifier is an unevaluated operand.
+ EnterExpressionEvaluationContext Unevaluated(Actions,
+ Action::Unevaluated);
+ OwningExprResult Result = ParseExpression();
+ if (Result.isInvalid()) {
+ SkipUntil(tok::r_paren);
+ return;
+ }
+
+ // Match the ')'
+ SourceLocation RParenLoc;
+ if (Tok.is(tok::r_paren))
+ RParenLoc = ConsumeParen();
+ else
+ MatchRHSPunctuation(tok::r_paren, LParenLoc);
+
+ if (RParenLoc.isInvalid())
+ return;
+
+ const char *PrevSpec = 0;
+ // Check for duplicate type specifiers (e.g. "int decltype(a)").
+ if (DS.SetTypeSpecType(DeclSpec::TST_decltype, StartLoc, PrevSpec,
+ Result.release()))
+ Diag(StartLoc, diag::err_invalid_decl_spec_combination) << PrevSpec;
+}
+
/// ParseClassName - Parse a C++ class-name, which names a class. Note
/// that we only check that the result names a type; semantic analysis
/// will need to verify that the type names a class. The result is
diff --git a/lib/Parse/ParseExprCXX.cpp b/lib/Parse/ParseExprCXX.cpp
index 2be44a4e77a0..d89f1e172ffb 100644
--- a/lib/Parse/ParseExprCXX.cpp
+++ b/lib/Parse/ParseExprCXX.cpp
@@ -59,81 +59,39 @@ bool Parser::ParseOptionalCXXScopeSpecifier(CXXScopeSpec &SS) {
while (true) {
// nested-name-specifier:
- // type-name '::'
- // namespace-name '::'
- // nested-name-specifier identifier '::'
- if (Tok.is(tok::identifier) && NextToken().is(tok::coloncolon)) {
- // We have an identifier followed by a '::'. Lookup this name
- // as the name in a nested-name-specifier.
- IdentifierInfo *II = Tok.getIdentifierInfo();
- SourceLocation IdLoc = ConsumeToken();
- assert(Tok.is(tok::coloncolon) && "NextToken() not working properly!");
- SourceLocation CCLoc = ConsumeToken();
+ // nested-name-specifier 'template'[opt] simple-template-id '::'
+
+ // Parse the optional 'template' keyword, then make sure we have
+ // 'identifier <' after it.
+ if (Tok.is(tok::kw_template)) {
+ SourceLocation TemplateKWLoc = ConsumeToken();
- if (!HasScopeSpecifier) {
- SS.setBeginLoc(IdLoc);
- HasScopeSpecifier = true;
+ if (Tok.isNot(tok::identifier)) {
+ Diag(Tok.getLocation(),
+ diag::err_id_after_template_in_nested_name_spec)
+ << SourceRange(TemplateKWLoc);
+ break;
}
- if (SS.isInvalid())
- continue;
+ if (NextToken().isNot(tok::less)) {
+ Diag(NextToken().getLocation(),
+ diag::err_less_after_template_name_in_nested_name_spec)
+ << Tok.getIdentifierInfo()->getName()
+ << SourceRange(TemplateKWLoc, Tok.getLocation());
+ break;
+ }
+
+ TemplateTy Template
+ = Actions.ActOnDependentTemplateName(TemplateKWLoc,
+ *Tok.getIdentifierInfo(),
+ Tok.getLocation(), SS);
+ if (AnnotateTemplateIdToken(Template, TNK_Dependent_template_name,
+ &SS, TemplateKWLoc, false))
+ break;
- SS.setScopeRep(
- Actions.ActOnCXXNestedNameSpecifier(CurScope, SS, IdLoc, CCLoc, *II));
- SS.setEndLoc(CCLoc);
continue;
}
-
- // nested-name-specifier:
- // type-name '::'
- // nested-name-specifier 'template'[opt] simple-template-id '::'
- if ((Tok.is(tok::identifier) && NextToken().is(tok::less)) ||
- Tok.is(tok::kw_template)) {
- // Parse the optional 'template' keyword, then make sure we have
- // 'identifier <' after it.
- if (Tok.is(tok::kw_template)) {
- SourceLocation TemplateKWLoc = ConsumeToken();
-
- if (Tok.isNot(tok::identifier)) {
- Diag(Tok.getLocation(),
- diag::err_id_after_template_in_nested_name_spec)
- << SourceRange(TemplateKWLoc);
- break;
- }
-
- if (NextToken().isNot(tok::less)) {
- Diag(NextToken().getLocation(),
- diag::err_less_after_template_name_in_nested_name_spec)
- << Tok.getIdentifierInfo()->getName()
- << SourceRange(TemplateKWLoc, Tok.getLocation());
- break;
- }
-
- TemplateTy Template
- = Actions.ActOnDependentTemplateName(TemplateKWLoc,
- *Tok.getIdentifierInfo(),
- Tok.getLocation(),
- SS);
- AnnotateTemplateIdToken(Template, TNK_Dependent_template_name,
- &SS, TemplateKWLoc, false);
- continue;
- }
-
- TemplateTy Template;
- TemplateNameKind TNK = Actions.isTemplateName(*Tok.getIdentifierInfo(),
- CurScope, Template, &SS);
- if (TNK) {
- // We have found a template name, so annotate this this token
- // with a template-id annotation. We do not permit the
- // template-id to be translated into a type annotation,
- // because some clients (e.g., the parsing of class template
- // specializations) still want to see the original template-id
- // token.
- AnnotateTemplateIdToken(Template, TNK, &SS, SourceLocation(), false);
- continue;
- }
- }
-
+
if (Tok.is(tok::annot_template_id) && NextToken().is(tok::coloncolon)) {
// We have
//
@@ -172,8 +130,62 @@ bool Parser::ParseOptionalCXXScopeSpecifier(CXXScopeSpec &SS) {
SS.setScopeRep(0);
SS.setEndLoc(CCLoc);
continue;
- } else
- assert(false && "FIXME: Only type template names supported here");
+ }
+
+ assert(false && "FIXME: Only type template names supported here");
+ }
+
+
+ // The rest of the nested-name-specifier possibilities start with
+ // tok::identifier.
+ if (Tok.isNot(tok::identifier))
+ break;
+
+ IdentifierInfo &II = *Tok.getIdentifierInfo();
+
+ // nested-name-specifier:
+ // type-name '::'
+ // namespace-name '::'
+ // nested-name-specifier identifier '::'
+ Token Next = NextToken();
+ if (Next.is(tok::coloncolon)) {
+ // We have an identifier followed by a '::'. Lookup this name
+ // as the name in a nested-name-specifier.
+ SourceLocation IdLoc = ConsumeToken();
+ assert(Tok.is(tok::coloncolon) && "NextToken() not working properly!");
+ SourceLocation CCLoc = ConsumeToken();
+
+ if (!HasScopeSpecifier) {
+ SS.setBeginLoc(IdLoc);
+ HasScopeSpecifier = true;
+ }
+
+ if (SS.isInvalid())
+ continue;
+
+ SS.setScopeRep(
+ Actions.ActOnCXXNestedNameSpecifier(CurScope, SS, IdLoc, CCLoc, II));
+ SS.setEndLoc(CCLoc);
+ continue;
+ }
+
+ // nested-name-specifier:
+ // type-name '<'
+ if (Next.is(tok::less)) {
+ TemplateTy Template;
+ if (TemplateNameKind TNK = Actions.isTemplateName(II, CurScope,
+ Template, &SS)) {
+ // We have found a template name, so annotate this this token
+ // with a template-id annotation. We do not permit the
+ // template-id to be translated into a type annotation,
+ // because some clients (e.g., the parsing of class template
+ // specializations) still want to see the original template-id
+ // token.
+ if (AnnotateTemplateIdToken(Template, TNK, &SS, SourceLocation(),
+ false))
+ break;
+ continue;
+ }
}
// We don't have any tokens that form the beginning of a
diff --git a/lib/Parse/ParseObjc.cpp b/lib/Parse/ParseObjc.cpp
index cb7fe58807af..013e26b891e1 100644
--- a/lib/Parse/ParseObjc.cpp
+++ b/lib/Parse/ParseObjc.cpp
@@ -771,10 +771,12 @@ Parser::DeclPtrTy Parser::ParseObjCMethodDecl(SourceLocation mLoc,
if (getLang().ObjC2 && Tok.is(tok::kw___attribute))
MethodAttrs = ParseAttributes();
+ if (KeyIdents.size() == 0)
+ return DeclPtrTy();
Selector Sel = PP.getSelectorTable().getSelector(KeyIdents.size(),
&KeyIdents[0]);
return Actions.ActOnMethodDeclaration(mLoc, Tok.getLocation(),
- mType, IDecl, DSRet, ReturnType, Sel,
+ mType, IDecl, DSRet, ReturnType, Sel,
&ArgInfos[0], CargNames, MethodAttrs,
MethodImplKind, isVariadic);
}
diff --git a/lib/Parse/ParseTemplate.cpp b/lib/Parse/ParseTemplate.cpp
index eabe10f1450e..57a09fbc737f 100644
--- a/lib/Parse/ParseTemplate.cpp
+++ b/lib/Parse/ParseTemplate.cpp
@@ -170,7 +170,8 @@ Parser::ParseSingleDeclarationAfterTemplate(
// If we have a declaration or declarator list, handle it.
if (isDeclarationAfterDeclarator()) {
// Parse this declaration.
- DeclPtrTy ThisDecl = ParseDeclarationAfterDeclarator(DeclaratorInfo);
+ DeclPtrTy ThisDecl = ParseDeclarationAfterDeclarator(DeclaratorInfo,
+ TemplateInfo);
if (Tok.is(tok::comma)) {
Diag(Tok, diag::err_multiple_template_declarators)
@@ -200,7 +201,7 @@ Parser::ParseSingleDeclarationAfterTemplate(
}
return DeclPtrTy();
}
- return ParseFunctionDefinition(DeclaratorInfo);
+ return ParseFunctionDefinition(DeclaratorInfo, TemplateInfo);
}
if (DeclaratorInfo.isFunctionDeclarator())
@@ -620,7 +621,11 @@ Parser::ParseTemplateIdAfterTemplateName(TemplateTy Template,
/// replaced with a type annotation token. Otherwise, the
/// simple-template-id is always replaced with a template-id
/// annotation token.
-void Parser::AnnotateTemplateIdToken(TemplateTy Template, TemplateNameKind TNK,
+///
+/// If an unrecoverable parse error occurs and no annotation token can be
+/// formed, this function returns true.
+///
+bool Parser::AnnotateTemplateIdToken(TemplateTy Template, TemplateNameKind TNK,
const CXXScopeSpec *SS,
SourceLocation TemplateKWLoc,
bool AllowTypeAnnotation) {
@@ -643,14 +648,19 @@ void Parser::AnnotateTemplateIdToken(TemplateTy Template, TemplateNameKind TNK,
TemplateArgIsType,
TemplateArgLocations,
RAngleLoc);
+
+ if (Invalid) {
+ // If we failed to parse the template ID but skipped ahead to a >, we're not
+ // going to be able to form a token annotation. Eat the '>' if present.
+ if (Tok.is(tok::greater))
+ ConsumeToken();
+ return true;
+ }
ASTTemplateArgsPtr TemplateArgsPtr(Actions, TemplateArgs.data(),
TemplateArgIsType.data(),
TemplateArgs.size());
- if (Invalid) // FIXME: How to recover from a broken template-id?
- return;
-
// Build the annotation token.
if (TNK == TNK_Type_template && AllowTypeAnnotation) {
Action::TypeResult Type
@@ -658,8 +668,13 @@ void Parser::AnnotateTemplateIdToken(TemplateTy Template, TemplateNameKind TNK,
LAngleLoc, TemplateArgsPtr,
&TemplateArgLocations[0],
RAngleLoc);
- if (Type.isInvalid()) // FIXME: better recovery?
- return;
+ if (Type.isInvalid()) {
+ // If we failed to parse the template ID but skipped ahead to a >, we're not
+ // going to be able to form a token annotation. Eat the '>' if present.
+ if (Tok.is(tok::greater))
+ ConsumeToken();
+ return true;
+ }
Tok.setKind(tok::annot_typename);
Tok.setAnnotationValue(Type.get());
@@ -704,6 +719,7 @@ void Parser::AnnotateTemplateIdToken(TemplateTy Template, TemplateNameKind TNK,
// In case the tokens were cached, have Preprocessor replace them with the
// annotation token.
PP.AnnotateCachedTokens(Tok);
+ return false;
}
/// \brief Replaces a template-id annotation token with a type
diff --git a/lib/Parse/ParseTentative.cpp b/lib/Parse/ParseTentative.cpp
index f31855b751fc..02687a216c7d 100644
--- a/lib/Parse/ParseTentative.cpp
+++ b/lib/Parse/ParseTentative.cpp
@@ -543,6 +543,7 @@ Parser::TPResult Parser::TryParseDeclarator(bool mayBeAbstract,
/// [GNU] typeof-specifier
/// [GNU] '_Complex'
/// [C++0x] 'auto' [TODO]
+/// [C++0x] 'decltype' ( expression )
///
/// type-name:
/// class-name
@@ -695,7 +696,7 @@ Parser::TPResult Parser::isCXXDeclarationSpecifier() {
return TPResult::True();
- // GNU typeof support.
+ // GNU typeof support.
case tok::kw_typeof: {
if (NextToken().isNot(tok::l_paren))
return TPResult::True();
@@ -716,6 +717,10 @@ Parser::TPResult Parser::isCXXDeclarationSpecifier() {
return TPResult::True();
}
+ // C++0x decltype support.
+ case tok::kw_decltype:
+ return TPResult::True();
+
default:
return TPResult::False();
}
diff --git a/lib/Parse/Parser.cpp b/lib/Parse/Parser.cpp
index a2a66f9255de..29d1d8792e1a 100644
--- a/lib/Parse/Parser.cpp
+++ b/lib/Parse/Parser.cpp
@@ -590,7 +590,8 @@ Parser::ParseDeclarationOrFunctionDefinition(AccessSpecifier AS) {
/// [C++] function-definition: [C++ 8.4]
/// decl-specifier-seq[opt] declarator function-try-block
///
-Parser::DeclPtrTy Parser::ParseFunctionDefinition(Declarator &D) {
+Parser::DeclPtrTy Parser::ParseFunctionDefinition(Declarator &D,
+ const ParsedTemplateInfo &TemplateInfo) {
const DeclaratorChunk &FnTypeInfo = D.getTypeObject(0);
assert(FnTypeInfo.Kind == DeclaratorChunk::Function &&
"This isn't a function declarator!");
@@ -632,7 +633,13 @@ Parser::DeclPtrTy Parser::ParseFunctionDefinition(Declarator &D) {
// Tell the actions module that we have entered a function definition with the
// specified Declarator for the function.
- DeclPtrTy Res = Actions.ActOnStartOfFunctionDef(CurScope, D);
+ DeclPtrTy Res = TemplateInfo.TemplateParams?
+ Actions.ActOnStartOfFunctionTemplateDef(CurScope,
+ Action::MultiTemplateParamsArg(Actions,
+ TemplateInfo.TemplateParams->data(),
+ TemplateInfo.TemplateParams->size()),
+ D)
+ : Actions.ActOnStartOfFunctionDef(CurScope, D);
if (Tok.is(tok::kw_try))
return ParseFunctionTryBlock(Res);
@@ -832,7 +839,8 @@ Parser::OwningExprResult Parser::ParseSimpleAsm(SourceLocation *EndLoc) {
/// specifier, and another one to get the actual type inside
/// ParseDeclarationSpecifiers).
///
-/// This returns true if the token was annotated.
+/// This returns true if the token was annotated or an unrecoverable error
+/// occurs.
///
/// Note that this routine emits an error if you call it with ::new or ::delete
/// as the current tokens, so only call it in contexts where these are invalid.
@@ -927,7 +935,12 @@ bool Parser::TryAnnotateTypeOrScopeToken() {
if (TemplateNameKind TNK
= Actions.isTemplateName(*Tok.getIdentifierInfo(),
CurScope, Template, &SS))
- AnnotateTemplateIdToken(Template, TNK, &SS);
+ if (AnnotateTemplateIdToken(Template, TNK, &SS)) {
+ // If an unrecoverable error occurred, we need to return true here,
+ // because the token stream is in a damaged state. We may not return
+ // a valid identifier.
+ return Tok.isNot(tok::identifier);
+ }
}
// The current token, which is either an identifier or a
@@ -950,7 +963,7 @@ bool Parser::TryAnnotateTypeOrScopeToken() {
}
if (SS.isEmpty())
- return false;
+ return Tok.isNot(tok::identifier) && Tok.isNot(tok::coloncolon);
// A C++ scope specifier that isn't followed by a typename.
// Push the current token back into the token stream (or revert it if it is
@@ -971,7 +984,8 @@ bool Parser::TryAnnotateTypeOrScopeToken() {
/// TryAnnotateScopeToken - Like TryAnnotateTypeOrScopeToken but only
/// annotates C++ scope specifiers and template-ids. This returns
-/// true if the token was annotated.
+/// true if the token was annotated or there was an error that could not be
+/// recovered from.
///
/// Note that this routine emits an error if you call it with ::new or ::delete
/// as the current tokens, so only call it in contexts where these are invalid.
diff --git a/lib/Sema/Sema.h b/lib/Sema/Sema.h
index 8604fe56a278..2d27ccc77839 100644
--- a/lib/Sema/Sema.h
+++ b/lib/Sema/Sema.h
@@ -421,9 +421,12 @@ public:
virtual DeclSpec::TST isTagName(IdentifierInfo &II, Scope *S);
virtual DeclPtrTy ActOnDeclarator(Scope *S, Declarator &D) {
- return ActOnDeclarator(S, D, false);
+ return HandleDeclarator(S, D, MultiTemplateParamsArg(*this), false);
}
- DeclPtrTy ActOnDeclarator(Scope *S, Declarator &D, bool IsFunctionDefinition);
+
+ DeclPtrTy HandleDeclarator(Scope *S, Declarator &D,
+ MultiTemplateParamsArg TemplateParameterLists,
+ bool IsFunctionDefinition);
void RegisterLocallyScopedExternCDecl(NamedDecl *ND, NamedDecl *PrevDecl,
Scope *S);
void DiagnoseFunctionSpecifiers(Declarator& D);
@@ -437,6 +440,7 @@ public:
bool &Redeclaration);
NamedDecl* ActOnFunctionDeclarator(Scope* S, Declarator& D, DeclContext* DC,
QualType R, NamedDecl* PrevDecl,
+ MultiTemplateParamsArg TemplateParamLists,
bool IsFunctionDefinition,
bool &Redeclaration);
void CheckFunctionDeclaration(FunctionDecl *NewFD, NamedDecl *&PrevDecl,
@@ -693,6 +697,11 @@ public:
OverloadCandidateSet& CandidateSet,
bool SuppressUserConversions = false,
bool ForceRValue = false);
+ void AddTemplateOverloadCandidate(FunctionTemplateDecl *FunctionTemplate,
+ Expr **Args, unsigned NumArgs,
+ OverloadCandidateSet& CandidateSet,
+ bool SuppressUserConversions = false,
+ bool ForceRValue = false);
void AddConversionCandidate(CXXConversionDecl *Conversion,
Expr *From, QualType ToType,
OverloadCandidateSet& CandidateSet);
@@ -1137,7 +1146,8 @@ public:
void FindAssociatedClassesAndNamespaces(Expr **Args, unsigned NumArgs,
AssociatedNamespaceSet &AssociatedNamespaces,
- AssociatedClassSet &AssociatedClasses);
+ AssociatedClassSet &AssociatedClasses,
+ bool &GlobalScope);
bool DiagnoseAmbiguousLookup(LookupResult &Result, DeclarationName Name,
SourceLocation NameLoc,
@@ -1372,9 +1382,10 @@ public:
bool HasTrailingLParen,
const CXXScopeSpec &SS,
bool isAddressOfOperand);
- DeclRefExpr *BuildDeclRefExpr(NamedDecl *D, QualType Ty, SourceLocation Loc,
- bool TypeDependent, bool ValueDependent,
- const CXXScopeSpec *SS = 0);
+ OwningExprResult BuildDeclRefExpr(NamedDecl *D, QualType Ty,
+ SourceLocation Loc, bool TypeDependent,
+ bool ValueDependent,
+ const CXXScopeSpec *SS = 0);
VarDecl *BuildAnonymousStructUnionMemberPath(FieldDecl *Field,
llvm::SmallVectorImpl<FieldDecl *> &Path);
OwningExprResult
@@ -1563,6 +1574,7 @@ public:
const CXXScopeSpec &SS,
SourceLocation IdentLoc,
IdentifierInfo *TargetName,
+ OverloadedOperatorKind Op,
AttributeList *AttrList,
bool IsTypeName);
@@ -1581,17 +1593,36 @@ public:
CXXConstructorDecl *Constructor,
QualType DeclInitType,
Expr **Exprs, unsigned NumExprs);
+
+ /// MarcDestructorReferenced - Prepare for calling destructor on the
+ /// constructed decl.
+ void MarcDestructorReferenced(SourceLocation Loc, QualType DeclInitType);
/// DefineImplicitDefaultConstructor - Checks for feasibility of
/// defining this constructor as the default constructor.
void DefineImplicitDefaultConstructor(SourceLocation CurrentLocation,
CXXConstructorDecl *Constructor);
+ /// DefineImplicitDestructor - Checks for feasibility of
+ /// defining this destructor as the default destructor.
+ void DefineImplicitDestructor(SourceLocation CurrentLocation,
+ CXXDestructorDecl *Destructor);
+
/// DefineImplicitCopyConstructor - Checks for feasibility of
/// defining this constructor as the copy constructor.
void DefineImplicitCopyConstructor(SourceLocation CurrentLocation,
CXXConstructorDecl *Constructor,
unsigned TypeQuals);
+
+ /// DefineImplicitOverloadedAssign - Checks for feasibility of
+ /// defining implicit this overloaded assignment operator.
+ void DefineImplicitOverloadedAssign(SourceLocation CurrentLocation,
+ CXXMethodDecl *MethodDecl);
+
+ /// getAssignOperatorMethod - Returns the default copy assignmment operator
+ /// for the class.
+ CXXMethodDecl *getAssignOperatorMethod(ParmVarDecl *Decl,
+ CXXRecordDecl *ClassDecl);
/// MaybeBindToTemporary - If the passed in expression has a record type with
/// a non-trivial destructor, this will return CXXBindTemporaryExpr. Otherwise
@@ -2067,6 +2098,14 @@ public:
AttributeList *Attr,
MultiTemplateParamsArg TemplateParameterLists);
+ virtual DeclPtrTy ActOnTemplateDeclarator(Scope *S,
+ MultiTemplateParamsArg TemplateParameterLists,
+ Declarator &D);
+
+ virtual DeclPtrTy ActOnStartOfFunctionTemplateDef(Scope *FnBodyScope,
+ MultiTemplateParamsArg TemplateParameterLists,
+ Declarator &D);
+
virtual DeclResult
ActOnExplicitInstantiation(Scope *S, SourceLocation TemplateLoc,
unsigned TagSpec,
@@ -2180,7 +2219,13 @@ public:
/// into a non-deduced context produced a type or value that
/// produces a type that does not match the original template
/// arguments provided.
- TDK_NonDeducedMismatch
+ TDK_NonDeducedMismatch,
+ /// \brief When performing template argument deduction for a function
+ /// template, there were too many call arguments.
+ TDK_TooManyArguments,
+ /// \brief When performing template argument deduction for a class
+ /// template, there were too few call arguments.
+ TDK_TooFewArguments
};
/// \brief Provides information about an attempted template argument
@@ -2260,6 +2305,12 @@ public:
const TemplateArgumentList &TemplateArgs,
TemplateDeductionInfo &Info);
+ TemplateDeductionResult
+ DeduceTemplateArguments(FunctionTemplateDecl *FunctionTemplate,
+ Expr **Args, unsigned NumArgs,
+ FunctionDecl *&Specialization,
+ TemplateDeductionInfo &Info);
+
void MarkDeducedTemplateParameters(const TemplateArgumentList &TemplateArgs,
llvm::SmallVectorImpl<bool> &Deduced);
@@ -3022,6 +3073,13 @@ public:
// returns true if the cast is invalid
bool CheckVectorCast(SourceRange R, QualType VectorTy, QualType Ty);
+ // CheckExtVectorCast - check type constraints for extended vectors.
+ // Since vectors are an extension, there are no C standard reference for this.
+ // We allow casting between vectors and integer datatypes of the same size,
+ // or vectors and the element type of that vector.
+ // returns true if the cast is invalid
+ bool CheckExtVectorCast(SourceRange R, QualType VectorTy, QualType Ty);
+
/// CheckMessageArgumentTypes - Check types in an Obj-C message send.
/// \param Method - May be null.
/// \param [out] ReturnType - The return type of the send.
diff --git a/lib/Sema/SemaChecking.cpp b/lib/Sema/SemaChecking.cpp
index a2ceafad3037..f6d6623f9a20 100644
--- a/lib/Sema/SemaChecking.cpp
+++ b/lib/Sema/SemaChecking.cpp
@@ -717,6 +717,8 @@ bool Sema::SemaCheckStringLiteral(const Expr *E, const CallExpr *TheCall,
if (E->isTypeDependent() || E->isValueDependent())
return false;
+ E = E->IgnoreParenCasts();
+
switch (E->getStmtClass()) {
case Stmt::ConditionalOperatorClass: {
const ConditionalOperator *C = cast<ConditionalOperator>(E);
@@ -766,6 +768,25 @@ bool Sema::SemaCheckStringLiteral(const Expr *E, const CallExpr *TheCall,
return false;
}
+ case Stmt::CallExprClass: {
+ const CallExpr *CE = cast<CallExpr>(E);
+ if (const ImplicitCastExpr *ICE
+ = dyn_cast<ImplicitCastExpr>(CE->getCallee())) {
+ if (const DeclRefExpr *DRE = dyn_cast<DeclRefExpr>(ICE->getSubExpr())) {
+ if (const FunctionDecl *FD = dyn_cast<FunctionDecl>(DRE->getDecl())) {
+ if (const FormatArgAttr *FA = FD->getAttr<FormatArgAttr>(Context)) {
+ unsigned ArgIndex = FA->getFormatIdx();
+ const Expr *Arg = CE->getArg(ArgIndex - 1);
+
+ return SemaCheckStringLiteral(Arg, TheCall, HasVAListArg,
+ format_idx, firstDataArg);
+ }
+ }
+ }
+ }
+
+ return false;
+ }
case Stmt::ObjCStringLiteralClass:
case Stmt::StringLiteralClass: {
const StringLiteral *StrE = NULL;
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index eba1d58d6024..13162d8e8ea9 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -319,16 +319,16 @@ void Sema::PushOnScopeChains(NamedDecl *D, Scope *S) {
return;
}
}
- } else if (isa<FunctionDecl>(D) &&
- AllowOverloadingOfFunction(D, Context)) {
- // We are pushing the name of a function, which might be an
- // overloaded name.
- FunctionDecl *FD = cast<FunctionDecl>(D);
+ } else if ((isa<FunctionDecl>(D) &&
+ AllowOverloadingOfFunction(D, Context)) ||
+ isa<FunctionTemplateDecl>(D)) {
+ // We are pushing the name of a function or function template,
+ // which might be an overloaded name.
IdentifierResolver::iterator Redecl
- = std::find_if(IdResolver.begin(FD->getDeclName()),
+ = std::find_if(IdResolver.begin(D->getDeclName()),
IdResolver.end(),
std::bind1st(std::mem_fun(&NamedDecl::declarationReplaces),
- FD));
+ D));
if (Redecl != IdResolver.end() &&
S->isDeclScope(DeclPtrTy::make(*Redecl))) {
// There is already a declaration of a function on our
@@ -655,7 +655,12 @@ bool Sema::MergeFunctionDecl(FunctionDecl *New, Decl *OldD) {
"Cannot merge with an overloaded function declaration");
// Verify the old decl was also a function.
- FunctionDecl *Old = dyn_cast<FunctionDecl>(OldD);
+ FunctionDecl *Old = 0;
+ if (FunctionTemplateDecl *OldFunctionTemplate
+ = dyn_cast<FunctionTemplateDecl>(OldD))
+ Old = OldFunctionTemplate->getTemplatedDecl();
+ else
+ Old = dyn_cast<FunctionDecl>(OldD);
if (!Old) {
Diag(New->getLocation(), diag::err_redefinition_different_kind)
<< New->getDeclName();
@@ -1385,7 +1390,9 @@ static bool isNearlyMatchingFunction(ASTContext &Context,
}
Sema::DeclPtrTy
-Sema::ActOnDeclarator(Scope *S, Declarator &D, bool IsFunctionDefinition) {
+Sema::HandleDeclarator(Scope *S, Declarator &D,
+ MultiTemplateParamsArg TemplateParamLists,
+ bool IsFunctionDefinition) {
DeclarationName Name = GetNameForDeclarator(D);
// All of these full declarators require an identifier. If it doesn't have
@@ -1500,9 +1507,15 @@ Sema::ActOnDeclarator(Scope *S, Declarator &D, bool IsFunctionDefinition) {
bool Redeclaration = false;
if (D.getDeclSpec().getStorageClassSpec() == DeclSpec::SCS_typedef) {
+ if (TemplateParamLists.size()) {
+ Diag(D.getIdentifierLoc(), diag::err_template_typedef);
+ return DeclPtrTy();
+ }
+
New = ActOnTypedefDeclarator(S, D, DC, R, PrevDecl, Redeclaration);
} else if (R->isFunctionType()) {
New = ActOnFunctionDeclarator(S, D, DC, R, PrevDecl,
+ move(TemplateParamLists),
IsFunctionDefinition, Redeclaration);
} else {
New = ActOnVariableDeclarator(S, D, DC, R, PrevDecl, Redeclaration);
@@ -1799,6 +1812,15 @@ Sema::ActOnVariableDeclarator(Scope* S, Declarator& D, DeclContext* DC,
} else if (SC == VarDecl::None)
SC = VarDecl::Static;
}
+ if (SC == VarDecl::Static) {
+ if (const CXXRecordDecl *RD = dyn_cast<CXXRecordDecl>(DC)) {
+ if (RD->isLocalClass())
+ Diag(D.getIdentifierLoc(),
+ diag::err_static_data_member_not_allowed_in_local_class)
+ << Name << RD->getDeclName();
+ }
+ }
+
// The variable can not
NewVD = VarDecl::Create(Context, DC, D.getIdentifierLoc(),
@@ -1987,6 +2009,7 @@ void Sema::CheckVariableDeclaration(VarDecl *NewVD, NamedDecl *PrevDecl,
NamedDecl*
Sema::ActOnFunctionDeclarator(Scope* S, Declarator& D, DeclContext* DC,
QualType R, NamedDecl* PrevDecl,
+ MultiTemplateParamsArg TemplateParamLists,
bool IsFunctionDefinition, bool &Redeclaration) {
assert(R.getTypePtr()->isFunctionType());
@@ -2044,6 +2067,11 @@ Sema::ActOnFunctionDeclarator(Scope* S, Declarator& D, DeclContext* DC,
<< R->getAsFunctionType()->getResultType();
D.setInvalidType();
}
+
+ // Check that we can declare a template here.
+ if (TemplateParamLists.size() &&
+ CheckTemplateDeclScope(S, TemplateParamLists))
+ return 0;
bool isVirtualOkay = false;
FunctionDecl *NewFD;
@@ -2143,6 +2171,26 @@ Sema::ActOnFunctionDeclarator(Scope* S, Declarator& D, DeclContext* DC,
// from the semantic context.
NewFD->setLexicalDeclContext(CurContext);
+ // If there is a template parameter list, then we are dealing with a
+ // template declaration or specialization.
+ FunctionTemplateDecl *FunctionTemplate = 0;
+ if (TemplateParamLists.size()) {
+ // FIXME: member templates!
+ TemplateParameterList *TemplateParams
+ = static_cast<TemplateParameterList *>(*TemplateParamLists.release());
+
+ if (TemplateParams->size() > 0) {
+ // This is a function template
+ FunctionTemplate = FunctionTemplateDecl::Create(Context, CurContext,
+ NewFD->getLocation(),
+ Name, TemplateParams,
+ NewFD);
+ NewFD->setDescribedFunctionTemplate(FunctionTemplate);
+ } else {
+ // FIXME: Handle function template specializations
+ }
+ }
+
// C++ [dcl.fct.spec]p5:
// The virtual specifier shall only be used in declarations of
// nonstatic class member functions that appear within a
@@ -2261,8 +2309,6 @@ Sema::ActOnFunctionDeclarator(Scope* S, Declarator& D, DeclContext* DC,
}
// Finally, we know we have the right number of parameters, install them.
NewFD->setParams(Context, Params.data(), Params.size());
-
-
// If name lookup finds a previous declaration that is not in the
// same scope as the new declaration, this may still be an
@@ -2342,6 +2388,15 @@ Sema::ActOnFunctionDeclarator(Scope* S, Declarator& D, DeclContext* DC,
&& !NewFD->isInvalidDecl())
RegisterLocallyScopedExternCDecl(NewFD, PrevDecl, S);
+ // Set this FunctionDecl's range up to the right paren.
+ NewFD->setLocEnd(D.getSourceRange().getEnd());
+
+ if (FunctionTemplate && NewFD->isInvalidDecl())
+ FunctionTemplate->setInvalidDecl();
+
+ if (FunctionTemplate)
+ return FunctionTemplate;
+
return NewFD;
}
@@ -2470,7 +2525,11 @@ void Sema::CheckFunctionDeclaration(FunctionDecl *NewFD, NamedDecl *&PrevDecl,
if (MergeFunctionDecl(NewFD, OldDecl))
return NewFD->setInvalidDecl();
- NewFD->setPreviousDeclaration(cast<FunctionDecl>(OldDecl));
+ if (FunctionTemplateDecl *OldTemplateDecl
+ = dyn_cast<FunctionTemplateDecl>(OldDecl))
+ NewFD->setPreviousDeclaration(OldTemplateDecl->getTemplatedDecl());
+ else
+ NewFD->setPreviousDeclaration(cast<FunctionDecl>(OldDecl));
}
}
@@ -2733,9 +2792,13 @@ void Sema::ActOnUninitializedDecl(DeclPtrTy dcl) {
IK_Default);
if (!Constructor)
Var->setInvalidDecl();
- else
+ else {
if (!RD->hasTrivialConstructor())
InitializeVarWithConstructor(Var, Constructor, InitType, 0, 0);
+ // FIXME. Must do all that is needed to destroy the object
+ // on scope exit. For now, just mark the destructor as used.
+ MarcDestructorReferenced(Var->getLocation(), InitType);
+ }
}
}
@@ -2987,11 +3050,15 @@ Sema::DeclPtrTy Sema::ActOnStartOfFunctionDef(Scope *FnBodyScope,
Scope *ParentScope = FnBodyScope->getParent();
- DeclPtrTy DP = ActOnDeclarator(ParentScope, D, /*IsFunctionDefinition=*/true);
+ DeclPtrTy DP = HandleDeclarator(ParentScope, D,
+ MultiTemplateParamsArg(*this),
+ /*IsFunctionDefinition=*/true);
return ActOnStartOfFunctionDef(FnBodyScope, DP);
}
Sema::DeclPtrTy Sema::ActOnStartOfFunctionDef(Scope *FnBodyScope, DeclPtrTy D) {
+ if (!D)
+ return D;
FunctionDecl *FD = cast<FunctionDecl>(D.getAs<Decl>());
CurFunctionNeedsScopeChecking = false;
@@ -3219,7 +3286,7 @@ NamedDecl *Sema::ImplicitlyDefineFunction(SourceLocation Loc,
CurContext = Context.getTranslationUnitDecl();
FunctionDecl *FD =
- dyn_cast<FunctionDecl>(ActOnDeclarator(TUScope, D, DeclPtrTy()).getAs<Decl>());
+ dyn_cast<FunctionDecl>(ActOnDeclarator(TUScope, D).getAs<Decl>());
FD->setImplicit();
CurContext = PrevDC;
diff --git a/lib/Sema/SemaDeclAttr.cpp b/lib/Sema/SemaDeclAttr.cpp
index d57630e6af7f..f7dd9303cb47 100644
--- a/lib/Sema/SemaDeclAttr.cpp
+++ b/lib/Sema/SemaDeclAttr.cpp
@@ -915,6 +915,30 @@ static void HandleDLLExportAttr(Decl *D, const AttributeList &Attr, Sema &S) {
D->addAttr(S.Context, ::new (S.Context) DLLExportAttr());
}
+static void HandleReqdWorkGroupSize(Decl *D, const AttributeList &Attr,
+ Sema &S) {
+ // Attribute has 3 arguments.
+ if (Attr.getNumArgs() != 3) {
+ S.Diag(Attr.getLoc(), diag::err_attribute_wrong_number_arguments) << 1;
+ return;
+ }
+
+ unsigned WGSize[3];
+ for (unsigned i = 0; i < 3; ++i) {
+ Expr *E = static_cast<Expr *>(Attr.getArg(i));
+ llvm::APSInt ArgNum(32);
+ if (!E->isIntegerConstantExpr(ArgNum, S.Context)) {
+ S.Diag(Attr.getLoc(), diag::err_attribute_argument_not_int)
+ << "reqd_work_group_size" << E->getSourceRange();
+ return;
+ }
+ WGSize[i] = (unsigned) ArgNum.getZExtValue();
+ }
+ D->addAttr(S.Context,
+ ::new (S.Context) ReqdWorkGroupSizeAttr(WGSize[0], WGSize[1],
+ WGSize[2]));
+}
+
static void HandleSectionAttr(Decl *D, const AttributeList &Attr, Sema &S) {
// Attribute has no arguments.
if (Attr.getNumArgs() != 1) {
@@ -1736,6 +1760,9 @@ static void ProcessDeclAttribute(Scope *scope, Decl *D, const AttributeList &Att
case AttributeList::AT_cf_returns_retained:
HandleNSReturnsRetainedAttr(D, Attr, S); break;
+ case AttributeList::AT_reqd_wg_size:
+ HandleReqdWorkGroupSize(D, Attr, S); break;
+
case AttributeList::AT_packed: HandlePackedAttr (D, Attr, S); break;
case AttributeList::AT_section: HandleSectionAttr (D, Attr, S); break;
case AttributeList::AT_stdcall: HandleStdCallAttr (D, Attr, S); break;
diff --git a/lib/Sema/SemaDeclCXX.cpp b/lib/Sema/SemaDeclCXX.cpp
index c9c662671c1f..cf0dab5cf298 100644
--- a/lib/Sema/SemaDeclCXX.cpp
+++ b/lib/Sema/SemaDeclCXX.cpp
@@ -1625,7 +1625,8 @@ Sema::DeclPtrTy Sema::ActOnConversionDeclarator(CXXConversionDecl *Conversion) {
Conv = Conversions->function_begin(),
ConvEnd = Conversions->function_end();
Conv != ConvEnd; ++Conv) {
- if (*Conv == Conversion->getPreviousDeclaration()) {
+ if (*Conv
+ == cast_or_null<NamedDecl>(Conversion->getPreviousDeclaration())) {
*Conv = Conversion;
return DeclPtrTy::make(Conversion);
}
@@ -1784,18 +1785,24 @@ Sema::DeclPtrTy Sema::ActOnUsingDeclaration(Scope *S,
const CXXScopeSpec &SS,
SourceLocation IdentLoc,
IdentifierInfo *TargetName,
+ OverloadedOperatorKind Op,
AttributeList *AttrList,
bool IsTypeName) {
assert(!SS.isInvalid() && "Invalid CXXScopeSpec.");
- assert(TargetName && "Invalid TargetName.");
+ assert((TargetName || Op) && "Invalid TargetName.");
assert(IdentLoc.isValid() && "Invalid TargetName location.");
assert(S->getFlags() & Scope::DeclScope && "Invalid Scope.");
UsingDecl *UsingAlias = 0;
+ DeclarationName Name;
+ if (TargetName)
+ Name = TargetName;
+ else
+ Name = Context.DeclarationNames.getCXXOperatorName(Op);
+
// Lookup target name.
- LookupResult R = LookupParsedName(S, &SS, TargetName,
- LookupOrdinaryName, false);
+ LookupResult R = LookupParsedName(S, &SS, Name, LookupOrdinaryName, false);
if (NamedDecl *NS = R) {
if (IsTypeName && !isa<TypeDecl>(NS)) {
@@ -1890,10 +1897,8 @@ void Sema::DefineImplicitDefaultConstructor(SourceLocation CurrentLocation,
= cast<CXXRecordDecl>(Base->getType()->getAsRecordType()->getDecl());
if (!BaseClassDecl->hasTrivialConstructor()) {
if (CXXConstructorDecl *BaseCtor =
- BaseClassDecl->getDefaultConstructor(Context)) {
- if (BaseCtor->isImplicit() && !BaseCtor->isUsed())
- MarkDeclarationReferenced(CurrentLocation, BaseCtor);
- }
+ BaseClassDecl->getDefaultConstructor(Context))
+ MarkDeclarationReferenced(CurrentLocation, BaseCtor);
else {
Diag(CurrentLocation, diag::err_defining_default_ctor)
<< Context.getTagDeclType(ClassDecl) << 1
@@ -1913,12 +1918,10 @@ void Sema::DefineImplicitDefaultConstructor(SourceLocation CurrentLocation,
if (const RecordType *FieldClassType = FieldType->getAsRecordType()) {
CXXRecordDecl *FieldClassDecl
= cast<CXXRecordDecl>(FieldClassType->getDecl());
- if (!FieldClassDecl->hasTrivialConstructor())
+ if (!FieldClassDecl->hasTrivialConstructor()) {
if (CXXConstructorDecl *FieldCtor =
- FieldClassDecl->getDefaultConstructor(Context)) {
- if (FieldCtor->isImplicit() && !FieldCtor->isUsed())
- MarkDeclarationReferenced(CurrentLocation, FieldCtor);
- }
+ FieldClassDecl->getDefaultConstructor(Context))
+ MarkDeclarationReferenced(CurrentLocation, FieldCtor);
else {
Diag(CurrentLocation, diag::err_defining_default_ctor)
<< Context.getTagDeclType(ClassDecl) << 0 <<
@@ -1928,6 +1931,7 @@ void Sema::DefineImplicitDefaultConstructor(SourceLocation CurrentLocation,
err = true;
}
}
+ }
else if (FieldType->isReferenceType()) {
Diag(CurrentLocation, diag::err_unintialized_member)
<< Context.getTagDeclType(ClassDecl) << 0 << (*Field)->getNameAsCString();
@@ -1942,7 +1946,147 @@ void Sema::DefineImplicitDefaultConstructor(SourceLocation CurrentLocation,
}
}
if (!err)
- Constructor->setUsed();
+ Constructor->setUsed();
+ else
+ Constructor->setInvalidDecl();
+}
+
+void Sema::DefineImplicitDestructor(SourceLocation CurrentLocation,
+ CXXDestructorDecl *Destructor) {
+ assert((Destructor->isImplicit() && !Destructor->isUsed()) &&
+ "DefineImplicitDestructor - call it for implicit default dtor");
+
+ CXXRecordDecl *ClassDecl
+ = cast<CXXRecordDecl>(Destructor->getDeclContext());
+ assert(ClassDecl && "DefineImplicitDestructor - invalid destructor");
+ // C++ [class.dtor] p5
+ // Before the implicitly-declared default destructor for a class is
+ // implicitly defined, all the implicitly-declared default destructors
+ // for its base class and its non-static data members shall have been
+ // implicitly defined.
+ for (CXXRecordDecl::base_class_iterator Base = ClassDecl->bases_begin();
+ Base != ClassDecl->bases_end(); ++Base) {
+ CXXRecordDecl *BaseClassDecl
+ = cast<CXXRecordDecl>(Base->getType()->getAsRecordType()->getDecl());
+ if (!BaseClassDecl->hasTrivialDestructor()) {
+ if (CXXDestructorDecl *BaseDtor =
+ const_cast<CXXDestructorDecl*>(BaseClassDecl->getDestructor(Context)))
+ MarkDeclarationReferenced(CurrentLocation, BaseDtor);
+ else
+ assert(false &&
+ "DefineImplicitDestructor - missing dtor in a base class");
+ }
+ }
+
+ for (CXXRecordDecl::field_iterator Field = ClassDecl->field_begin(Context);
+ Field != ClassDecl->field_end(Context);
+ ++Field) {
+ QualType FieldType = Context.getCanonicalType((*Field)->getType());
+ if (const ArrayType *Array = Context.getAsArrayType(FieldType))
+ FieldType = Array->getElementType();
+ if (const RecordType *FieldClassType = FieldType->getAsRecordType()) {
+ CXXRecordDecl *FieldClassDecl
+ = cast<CXXRecordDecl>(FieldClassType->getDecl());
+ if (!FieldClassDecl->hasTrivialDestructor()) {
+ if (CXXDestructorDecl *FieldDtor =
+ const_cast<CXXDestructorDecl*>(
+ FieldClassDecl->getDestructor(Context)))
+ MarkDeclarationReferenced(CurrentLocation, FieldDtor);
+ else
+ assert(false &&
+ "DefineImplicitDestructor - missing dtor in class of a data member");
+ }
+ }
+ }
+ Destructor->setUsed();
+}
+
+void Sema::DefineImplicitOverloadedAssign(SourceLocation CurrentLocation,
+ CXXMethodDecl *MethodDecl) {
+ assert((MethodDecl->isImplicit() && MethodDecl->isOverloadedOperator() &&
+ MethodDecl->getOverloadedOperator() == OO_Equal &&
+ !MethodDecl->isUsed()) &&
+ "DefineImplicitOverloadedAssign - call it for implicit assignment op");
+
+ CXXRecordDecl *ClassDecl
+ = cast<CXXRecordDecl>(MethodDecl->getDeclContext());
+ assert(ClassDecl && "DefineImplicitOverloadedAssign - invalid constructor");
+
+ // C++[class.copy] p12
+ // Before the implicitly-declared copy assignment operator for a class is
+ // implicitly defined, all implicitly-declared copy assignment operators
+ // for its direct base classes and its nonstatic data members shall have
+ // been implicitly defined.
+ bool err = false;
+ for (CXXRecordDecl::base_class_iterator Base = ClassDecl->bases_begin();
+ Base != ClassDecl->bases_end(); ++Base) {
+ CXXRecordDecl *BaseClassDecl
+ = cast<CXXRecordDecl>(Base->getType()->getAsRecordType()->getDecl());
+ if (CXXMethodDecl *BaseAssignOpMethod =
+ getAssignOperatorMethod(MethodDecl->getParamDecl(0), BaseClassDecl))
+ MarkDeclarationReferenced(CurrentLocation, BaseAssignOpMethod);
+ }
+ for (CXXRecordDecl::field_iterator Field = ClassDecl->field_begin(Context);
+ Field != ClassDecl->field_end(Context);
+ ++Field) {
+ QualType FieldType = Context.getCanonicalType((*Field)->getType());
+ if (const ArrayType *Array = Context.getAsArrayType(FieldType))
+ FieldType = Array->getElementType();
+ if (const RecordType *FieldClassType = FieldType->getAsRecordType()) {
+ CXXRecordDecl *FieldClassDecl
+ = cast<CXXRecordDecl>(FieldClassType->getDecl());
+ if (CXXMethodDecl *FieldAssignOpMethod =
+ getAssignOperatorMethod(MethodDecl->getParamDecl(0), FieldClassDecl))
+ MarkDeclarationReferenced(CurrentLocation, FieldAssignOpMethod);
+ }
+ else if (FieldType->isReferenceType()) {
+ Diag(ClassDecl->getLocation(), diag::err_uninitialized_member_for_assign)
+ << Context.getTagDeclType(ClassDecl) << 0 << (*Field)->getNameAsCString();
+ Diag((*Field)->getLocation(), diag::note_declared_at);
+ Diag(CurrentLocation, diag::note_first_required_here);
+ err = true;
+ }
+ else if (FieldType.isConstQualified()) {
+ Diag(ClassDecl->getLocation(), diag::err_uninitialized_member_for_assign)
+ << Context.getTagDeclType(ClassDecl) << 1 << (*Field)->getNameAsCString();
+ Diag((*Field)->getLocation(), diag::note_declared_at);
+ Diag(CurrentLocation, diag::note_first_required_here);
+ err = true;
+ }
+ }
+ if (!err)
+ MethodDecl->setUsed();
+}
+
+CXXMethodDecl *
+Sema::getAssignOperatorMethod(ParmVarDecl *ParmDecl,
+ CXXRecordDecl *ClassDecl) {
+ QualType LHSType = Context.getTypeDeclType(ClassDecl);
+ QualType RHSType(LHSType);
+ // If class's assignment operator argument is const/volatile qualified,
+ // look for operator = (const/volatile B&). Otherwise, look for
+ // operator = (B&).
+ if (ParmDecl->getType().isConstQualified())
+ RHSType.addConst();
+ if (ParmDecl->getType().isVolatileQualified())
+ RHSType.addVolatile();
+ ExprOwningPtr<Expr> LHS(this, new (Context) DeclRefExpr(ParmDecl,
+ LHSType,
+ SourceLocation()));
+ ExprOwningPtr<Expr> RHS(this, new (Context) DeclRefExpr(ParmDecl,
+ RHSType,
+ SourceLocation()));
+ Expr *Args[2] = { &*LHS, &*RHS };
+ OverloadCandidateSet CandidateSet;
+ AddMemberOperatorCandidates(clang::OO_Equal, SourceLocation(), Args, 2,
+ CandidateSet);
+ OverloadCandidateSet::iterator Best;
+ if (BestViableFunction(CandidateSet,
+ ClassDecl->getLocation(), Best) == OR_Success)
+ return cast<CXXMethodDecl>(Best->Function);
+ assert(false &&
+ "getAssignOperatorMethod - copy assignment operator method not found");
+ return 0;
}
void Sema::DefineImplicitCopyConstructor(SourceLocation CurrentLocation,
@@ -1956,6 +2100,7 @@ void Sema::DefineImplicitCopyConstructor(SourceLocation CurrentLocation,
CXXRecordDecl *ClassDecl
= cast<CXXRecordDecl>(CopyConstructor->getDeclContext());
assert(ClassDecl && "DefineImplicitCopyConstructor - invalid constructor");
+ // C++ [class.copy] p209
// Before the implicitly-declared copy constructor for a class is
// implicitly defined, all the implicitly-declared copy constructors
// for its base class and its non-static data members shall have been
@@ -1966,8 +2111,7 @@ void Sema::DefineImplicitCopyConstructor(SourceLocation CurrentLocation,
= cast<CXXRecordDecl>(Base->getType()->getAsRecordType()->getDecl());
if (CXXConstructorDecl *BaseCopyCtor =
BaseClassDecl->getCopyConstructor(Context, TypeQuals))
- if (BaseCopyCtor->isImplicit() && !BaseCopyCtor->isUsed())
- MarkDeclarationReferenced(CurrentLocation, BaseCopyCtor);
+ MarkDeclarationReferenced(CurrentLocation, BaseCopyCtor);
}
for (CXXRecordDecl::field_iterator Field = ClassDecl->field_begin(Context);
Field != ClassDecl->field_end(Context);
@@ -1980,8 +2124,7 @@ void Sema::DefineImplicitCopyConstructor(SourceLocation CurrentLocation,
= cast<CXXRecordDecl>(FieldClassType->getDecl());
if (CXXConstructorDecl *FieldCopyCtor =
FieldClassDecl->getCopyConstructor(Context, TypeQuals))
- if (FieldCopyCtor->isImplicit() && !FieldCopyCtor->isUsed())
- MarkDeclarationReferenced(CurrentLocation, FieldCopyCtor);
+ MarkDeclarationReferenced(CurrentLocation, FieldCopyCtor);
}
}
CopyConstructor->setUsed();
@@ -1997,6 +2140,16 @@ void Sema::InitializeVarWithConstructor(VarDecl *VD,
VD->setInit(Context, Temp);
}
+void Sema::MarcDestructorReferenced(SourceLocation Loc, QualType DeclInitType)
+{
+ CXXRecordDecl *ClassDecl = cast<CXXRecordDecl>(
+ DeclInitType->getAsRecordType()->getDecl());
+ if (!ClassDecl->hasTrivialDestructor())
+ if (CXXDestructorDecl *Destructor =
+ const_cast<CXXDestructorDecl*>(ClassDecl->getDestructor(Context)))
+ MarkDeclarationReferenced(Loc, Destructor);
+}
+
/// AddCXXDirectInitializerToDecl - This action is called immediately after
/// ActOnDeclarator, when a C++ direct initializer is present.
/// e.g: "int x(1);"
@@ -2063,6 +2216,9 @@ void Sema::AddCXXDirectInitializerToDecl(DeclPtrTy Dcl,
VDecl->setCXXDirectInitializer(true);
InitializeVarWithConstructor(VDecl, Constructor, DeclInitType,
(Expr**)Exprs.release(), NumExprs);
+ // FIXME. Must do all that is needed to destroy the object
+ // on scope exit. For now, just mark the destructor as used.
+ MarcDestructorReferenced(VDecl->getLocation(), DeclInitType);
}
return;
}
@@ -2590,7 +2746,8 @@ bool Sema::CheckOverloadedOperatorDeclaration(FunctionDecl *FnDecl) {
ParamEnd = FnDecl->param_end();
Param != ParamEnd; ++Param) {
QualType ParamType = (*Param)->getType().getNonReferenceType();
- if (ParamType->isRecordType() || ParamType->isEnumeralType()) {
+ if (ParamType->isDependentType() || ParamType->isRecordType() ||
+ ParamType->isEnumeralType()) {
ClassOrEnumParam = true;
break;
}
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp
index 56d3bfe690bf..383edeca07a0 100644
--- a/lib/Sema/SemaExpr.cpp
+++ b/lib/Sema/SemaExpr.cpp
@@ -623,17 +623,42 @@ Sema::OwningExprResult Sema::ActOnIdentifierExpr(Scope *S, SourceLocation Loc,
/// BuildDeclRefExpr - Build either a DeclRefExpr or a
/// QualifiedDeclRefExpr based on whether or not SS is a
/// nested-name-specifier.
-DeclRefExpr *
+Sema::OwningExprResult
Sema::BuildDeclRefExpr(NamedDecl *D, QualType Ty, SourceLocation Loc,
bool TypeDependent, bool ValueDependent,
const CXXScopeSpec *SS) {
+ if (Context.getCanonicalType(Ty) == Context.UndeducedAutoTy) {
+ Diag(Loc,
+ diag::err_auto_variable_cannot_appear_in_own_initializer)
+ << D->getDeclName();
+ return ExprError();
+ }
+
+ if (const VarDecl *VD = dyn_cast<VarDecl>(D)) {
+ if (const CXXMethodDecl *MD = dyn_cast<CXXMethodDecl>(CurContext)) {
+ if (const FunctionDecl *FD = MD->getParent()->isLocalClass()) {
+ if (VD->hasLocalStorage() && VD->getDeclContext() != CurContext) {
+ Diag(Loc, diag::err_reference_to_local_var_in_enclosing_function)
+ << D->getIdentifier() << FD->getDeclName();
+ Diag(D->getLocation(), diag::note_local_variable_declared_here)
+ << D->getIdentifier();
+ return ExprError();
+ }
+ }
+ }
+ }
+
MarkDeclarationReferenced(Loc, D);
+
+ Expr *E;
if (SS && !SS->isEmpty()) {
- return new (Context) QualifiedDeclRefExpr(D, Ty, Loc, TypeDependent,
- ValueDependent, SS->getRange(),
+ E = new (Context) QualifiedDeclRefExpr(D, Ty, Loc, TypeDependent,
+ ValueDependent, SS->getRange(),
static_cast<NestedNameSpecifier *>(SS->getScopeRep()));
} else
- return new (Context) DeclRefExpr(D, Ty, Loc, TypeDependent, ValueDependent);
+ E = new (Context) DeclRefExpr(D, Ty, Loc, TypeDependent, ValueDependent);
+
+ return Owned(E);
}
/// getObjectForAnonymousRecordDecl - Retrieve the (unnamed) field or
@@ -968,7 +993,7 @@ Sema::ActOnDeclarationNameExpr(Scope *S, SourceLocation Loc,
// The pointer is type- and value-dependent if it points into something
// dependent.
bool Dependent = DC->isDependentContext();
- return Owned(BuildDeclRefExpr(D, DType, Loc, Dependent, Dependent, SS));
+ return BuildDeclRefExpr(D, DType, Loc, Dependent, Dependent, SS);
}
}
}
@@ -1061,11 +1086,11 @@ Sema::ActOnDeclarationNameExpr(Scope *S, SourceLocation Loc,
// Make the DeclRefExpr or BlockDeclRefExpr for the decl.
if (OverloadedFunctionDecl *Ovl = dyn_cast<OverloadedFunctionDecl>(D))
- return Owned(BuildDeclRefExpr(Ovl, Context.OverloadTy, Loc,
- false, false, SS));
+ return BuildDeclRefExpr(Ovl, Context.OverloadTy, Loc,
+ false, false, SS);
else if (TemplateDecl *Template = dyn_cast<TemplateDecl>(D))
- return Owned(BuildDeclRefExpr(Template, Context.OverloadTy, Loc,
- false, false, SS));
+ return BuildDeclRefExpr(Template, Context.OverloadTy, Loc,
+ false, false, SS);
ValueDecl *VD = cast<ValueDecl>(D);
// Check whether this declaration can be used. Note that we suppress
@@ -1113,7 +1138,7 @@ Sema::ActOnDeclarationNameExpr(Scope *S, SourceLocation Loc,
QualType NoProtoType = T;
if (const FunctionProtoType *Proto = T->getAsFunctionProtoType())
NoProtoType = Context.getFunctionNoProtoType(Proto->getResultType());
- return Owned(BuildDeclRefExpr(VD, NoProtoType, Loc, false, false, SS));
+ return BuildDeclRefExpr(VD, NoProtoType, Loc, false, false, SS);
}
}
@@ -1194,8 +1219,8 @@ Sema::ActOnDeclarationNameExpr(Scope *S, SourceLocation Loc,
}
}
- return Owned(BuildDeclRefExpr(VD, VD->getType().getNonReferenceType(), Loc,
- TypeDependent, ValueDependent, SS));
+ return BuildDeclRefExpr(VD, VD->getType().getNonReferenceType(), Loc,
+ TypeDependent, ValueDependent, SS);
}
Sema::OwningExprResult Sema::ActOnPredefinedExpr(SourceLocation Loc,
@@ -1886,7 +1911,7 @@ CheckExtVectorComponent(QualType baseType, SourceLocation OpLoc,
// This flag determines whether or not CompName has an 's' char prefix,
// indicating that it is a string of hex values to be used as vector indices.
- bool HexSwizzle = *compStr == 's';
+ bool HexSwizzle = *compStr == 's' || *compStr == 'S';
// Check that we've found one of the special components, or that the component
// names must come from the same set.
@@ -2586,11 +2611,16 @@ Sema::ActOnCallExpr(Scope *S, ExprArg fn, SourceLocation LParenLoc,
CommaLocs, RParenLoc));
// Determine whether this is a call to a member function.
- if (MemberExpr *MemExpr = dyn_cast<MemberExpr>(Fn->IgnoreParens()))
- if (isa<OverloadedFunctionDecl>(MemExpr->getMemberDecl()) ||
- isa<CXXMethodDecl>(MemExpr->getMemberDecl()))
+ if (MemberExpr *MemExpr = dyn_cast<MemberExpr>(Fn->IgnoreParens())) {
+ NamedDecl *MemDecl = MemExpr->getMemberDecl();
+ if (isa<OverloadedFunctionDecl>(MemDecl) ||
+ isa<CXXMethodDecl>(MemDecl) ||
+ (isa<FunctionTemplateDecl>(MemDecl) &&
+ isa<CXXMethodDecl>(
+ cast<FunctionTemplateDecl>(MemDecl)->getTemplatedDecl())))
return Owned(BuildCallToMemberFunction(S, Fn, LParenLoc, Args, NumArgs,
CommaLocs, RParenLoc));
+ }
}
// If we're directly calling a function, get the appropriate declaration.
@@ -2626,13 +2656,19 @@ Sema::ActOnCallExpr(Scope *S, ExprArg fn, SourceLocation LParenLoc,
}
OverloadedFunctionDecl *Ovl = 0;
+ FunctionTemplateDecl *FunctionTemplate = 0;
if (DRExpr) {
FDecl = dyn_cast<FunctionDecl>(DRExpr->getDecl());
+ if ((FunctionTemplate = dyn_cast<FunctionTemplateDecl>(DRExpr->getDecl())))
+ FDecl = FunctionTemplate->getTemplatedDecl();
+ else
+ FDecl = dyn_cast<FunctionDecl>(DRExpr->getDecl());
Ovl = dyn_cast<OverloadedFunctionDecl>(DRExpr->getDecl());
NDecl = dyn_cast<NamedDecl>(DRExpr->getDecl());
}
- if (Ovl || (getLangOptions().CPlusPlus && (FDecl || UnqualifiedName))) {
+ if (Ovl || FunctionTemplate ||
+ (getLangOptions().CPlusPlus && (FDecl || UnqualifiedName))) {
// We don't perform ADL for implicit declarations of builtins.
if (FDecl && FDecl->getBuiltinID(Context) && FDecl->isImplicit())
ADL = false;
@@ -2641,7 +2677,7 @@ Sema::ActOnCallExpr(Scope *S, ExprArg fn, SourceLocation LParenLoc,
if (!getLangOptions().CPlusPlus)
ADL = false;
- if (Ovl || ADL) {
+ if (Ovl || FunctionTemplate || ADL) {
FDecl = ResolveOverloadedCallFn(Fn, DRExpr? DRExpr->getDecl() : 0,
UnqualifiedName, LParenLoc, Args,
NumArgs, CommaLocs, RParenLoc, ADL);
@@ -2846,12 +2882,15 @@ bool Sema::CheckCastTypes(SourceRange TyR, QualType castType, Expr *&castExpr) {
return Diag(castExpr->getLocStart(),
diag::err_typecheck_expect_scalar_operand)
<< castExpr->getType() << castExpr->getSourceRange();
- } else if (castExpr->getType()->isVectorType()) {
- if (CheckVectorCast(TyR, castExpr->getType(), castType))
+ } else if (castType->isExtVectorType()) {
+ if (CheckExtVectorCast(TyR, castType, castExpr->getType()))
return true;
} else if (castType->isVectorType()) {
if (CheckVectorCast(TyR, castType, castExpr->getType()))
return true;
+ } else if (castExpr->getType()->isVectorType()) {
+ if (CheckVectorCast(TyR, castExpr->getType(), castType))
+ return true;
} else if (getLangOptions().ObjC1 && isa<ObjCSuperExpr>(castExpr)) {
return Diag(castExpr->getLocStart(), diag::err_illegal_super_cast) << TyR;
} else if (!castType->isArithmeticType()) {
@@ -2889,6 +2928,35 @@ bool Sema::CheckVectorCast(SourceRange R, QualType VectorTy, QualType Ty) {
return false;
}
+bool Sema::CheckExtVectorCast(SourceRange R, QualType DestTy, QualType SrcTy) {
+ assert(DestTy->isExtVectorType() && "Not an extended vector type!");
+
+ // If SrcTy is also an ExtVectorType, the types must be identical unless
+ // lax vector conversions is enabled.
+ if (SrcTy->isExtVectorType()) {
+ if (getLangOptions().LaxVectorConversions &&
+ Context.getTypeSize(DestTy) == Context.getTypeSize(SrcTy))
+ return false;
+ if (DestTy != SrcTy)
+ return Diag(R.getBegin(),diag::err_invalid_conversion_between_ext_vectors)
+ << DestTy << SrcTy << R;
+ return false;
+ }
+
+ // If SrcTy is a VectorType, then only the total size must match.
+ if (SrcTy->isVectorType()) {
+ if (Context.getTypeSize(DestTy) != Context.getTypeSize(SrcTy))
+ return Diag(R.getBegin(),diag::err_invalid_conversion_between_ext_vectors)
+ << DestTy << SrcTy << R;
+ return false;
+ }
+
+ // All scalar -> ext vector "c-style" casts are legal; the appropriate
+ // conversion will take place first from scalar to elt type, and then
+ // splat from elt type to vector.
+ return false;
+}
+
Action::OwningExprResult
Sema::ActOnCastExpr(SourceLocation LParenLoc, TypeTy *Ty,
SourceLocation RParenLoc, ExprArg Op) {
@@ -5525,18 +5593,27 @@ void Sema::MarkDeclarationReferenced(SourceLocation Loc, Decl *D) {
if (!Constructor->isUsed())
DefineImplicitCopyConstructor(Loc, Constructor, TypeQuals);
}
- // FIXME: more checking for other implicits go here.
- else
- Constructor->setUsed(true);
- }
-
+ } else if (CXXDestructorDecl *Destructor = dyn_cast<CXXDestructorDecl>(D)) {
+ if (Destructor->isImplicit() && !Destructor->isUsed())
+ DefineImplicitDestructor(Loc, Destructor);
+
+ } else if (CXXMethodDecl *MethodDecl = dyn_cast<CXXMethodDecl>(D)) {
+ if (MethodDecl->isImplicit() && MethodDecl->isOverloadedOperator() &&
+ MethodDecl->getOverloadedOperator() == OO_Equal) {
+ if (!MethodDecl->isUsed())
+ DefineImplicitOverloadedAssign(Loc, MethodDecl);
+ }
+ }
if (FunctionDecl *Function = dyn_cast<FunctionDecl>(D)) {
- // Implicit instantiation of function templates
+ // Implicit instantiation of function templates and member functions of
+ // class templates.
if (!Function->getBody(Context)) {
- if (Function->getInstantiatedFromMemberFunction())
+ // FIXME: distinguish between implicit instantiations of function
+ // templates and explicit specializations (the latter don't get
+ // instantiated, naturally).
+ if (Function->getInstantiatedFromMemberFunction() ||
+ Function->getPrimaryTemplate())
PendingImplicitInstantiations.push(std::make_pair(Function, Loc));
-
- // FIXME: check for function template specializations.
}
diff --git a/lib/Sema/SemaExprCXX.cpp b/lib/Sema/SemaExprCXX.cpp
index a567218eaa88..bc8fc4eae502 100644
--- a/lib/Sema/SemaExprCXX.cpp
+++ b/lib/Sema/SemaExprCXX.cpp
@@ -771,7 +771,7 @@ Sema::ActOnCXXConditionDeclarationExpr(Scope *S, SourceLocation StartLoc,
Diag(ED->getLocation(), diag::err_type_defined_in_condition);
}
- DeclPtrTy Dcl = ActOnDeclarator(S, D, DeclPtrTy());
+ DeclPtrTy Dcl = ActOnDeclarator(S, D);
if (!Dcl)
return ExprError();
AddInitializerToDecl(Dcl, move(AssignExprVal), /*DirectInit=*/false);
@@ -1567,7 +1567,7 @@ Sema::OwningExprResult Sema::MaybeBindToTemporary(Expr *E) {
CXXTemporary *Temp = CXXTemporary::Create(Context,
RD->getDestructor(Context));
ExprTemporaries.push_back(Temp);
-
+ MarcDestructorReferenced(E->getExprLoc(), E->getType());
// FIXME: Add the temporary to the temporaries vector.
return Owned(CXXBindTemporaryExpr::Create(Context, Temp, E));
}
diff --git a/lib/Sema/SemaInit.cpp b/lib/Sema/SemaInit.cpp
index 45085962d488..6b812e1968de 100644
--- a/lib/Sema/SemaInit.cpp
+++ b/lib/Sema/SemaInit.cpp
@@ -200,10 +200,9 @@ bool Sema::CheckInitializerTypes(Expr *&Init, QualType &DeclType,
if (InitEntity)
return Diag(InitLoc, diag::err_cannot_initialize_decl)
- << InitEntity << (int)(Init->isLvalue(Context) == Expr::LV_Valid)
- << Init->getType() << Init->getSourceRange();
- else
- return Diag(InitLoc, diag::err_cannot_initialize_decl_noname)
+ << InitEntity << (int)(Init->isLvalue(Context) == Expr::LV_Valid)
+ << Init->getType() << Init->getSourceRange();
+ return Diag(InitLoc, diag::err_cannot_initialize_decl_noname)
<< DeclType << (int)(Init->isLvalue(Context) == Expr::LV_Valid)
<< Init->getType() << Init->getSourceRange();
}
@@ -211,7 +210,7 @@ bool Sema::CheckInitializerTypes(Expr *&Init, QualType &DeclType,
// C99 6.7.8p16.
if (DeclType->isArrayType())
return Diag(Init->getLocStart(), diag::err_array_init_list_required)
- << Init->getSourceRange();
+ << Init->getSourceRange();
return CheckSingleInitializer(Init, DeclType, DirectInit, *this);
}
diff --git a/lib/Sema/SemaLookup.cpp b/lib/Sema/SemaLookup.cpp
index 37e1df3a197d..cc9e783f6166 100644
--- a/lib/Sema/SemaLookup.cpp
+++ b/lib/Sema/SemaLookup.cpp
@@ -125,21 +125,32 @@ MaybeConstructOverloadSet(ASTContext &Context,
assert(!isa<OverloadedFunctionDecl>(*I) &&
"Cannot have an overloaded function");
- if (isa<FunctionDecl>(*I)) {
+ if ((*I)->isFunctionOrFunctionTemplate()) {
// If we found a function, there might be more functions. If
// so, collect them into an overload set.
DeclIterator Last = I;
OverloadedFunctionDecl *Ovl = 0;
- for (++Last; Last != IEnd && isa<FunctionDecl>(*Last); ++Last) {
+ for (++Last;
+ Last != IEnd && (*Last)->isFunctionOrFunctionTemplate();
+ ++Last) {
if (!Ovl) {
// FIXME: We leak this overload set. Eventually, we want to stop
// building the declarations for these overload sets, so there will be
// nothing to leak.
Ovl = OverloadedFunctionDecl::Create(Context, (*I)->getDeclContext(),
(*I)->getDeclName());
- Ovl->addOverload(cast<FunctionDecl>(*I));
+ NamedDecl *ND = (*I)->getUnderlyingDecl();
+ if (isa<FunctionDecl>(ND))
+ Ovl->addOverload(cast<FunctionDecl>(ND));
+ else
+ Ovl->addOverload(cast<FunctionTemplateDecl>(ND));
}
- Ovl->addOverload(cast<FunctionDecl>(*Last));
+
+ NamedDecl *ND = (*Last)->getUnderlyingDecl();
+ if (isa<FunctionDecl>(ND))
+ Ovl->addOverload(cast<FunctionDecl>(ND));
+ else
+ Ovl->addOverload(cast<FunctionTemplateDecl>(ND));
}
// If we had more than one function, we built an overload
@@ -202,11 +213,12 @@ MergeLookupResults(ASTContext &Context, LookupResultsTy &Results) {
break;
case LResult::Found: {
- NamedDecl *ND = I->getAsDecl();
+ NamedDecl *ND = I->getAsDecl()->getUnderlyingDecl();
+
if (TagDecl *TD = dyn_cast<TagDecl>(ND)) {
TagFound = Context.getCanonicalDecl(TD);
TagNames += FoundDecls.insert(TagFound)? 1 : 0;
- } else if (isa<FunctionDecl>(ND))
+ } else if (ND->isFunctionOrFunctionTemplate())
Functions += FoundDecls.insert(ND)? 1 : 0;
else
FoundDecls.insert(ND);
@@ -313,10 +325,9 @@ getIdentifierNamespacesFromLookupNameKind(Sema::LookupNameKind NameKind,
Sema::LookupResult
Sema::LookupResult::CreateLookupResult(ASTContext &Context, NamedDecl *D) {
- if (ObjCCompatibleAliasDecl *Alias
- = dyn_cast_or_null<ObjCCompatibleAliasDecl>(D))
- D = Alias->getClassInterface();
-
+ if (D)
+ D = D->getUnderlyingDecl();
+
LookupResult Result;
Result.StoredKind = (D && isa<OverloadedFunctionDecl>(D))?
OverloadedDeclSingleDecl : SingleDecl;
@@ -334,10 +345,10 @@ Sema::LookupResult::CreateLookupResult(ASTContext &Context,
LookupResult Result;
Result.Context = &Context;
- if (F != L && isa<FunctionDecl>(*F)) {
+ if (F != L && (*F)->isFunctionOrFunctionTemplate()) {
IdentifierResolver::iterator Next = F;
++Next;
- if (Next != L && isa<FunctionDecl>(*Next)) {
+ if (Next != L && (*Next)->isFunctionOrFunctionTemplate()) {
Result.StoredKind = OverloadedDeclFromIdResolver;
Result.First = F.getAsOpaqueValue();
Result.Last = L.getAsOpaqueValue();
@@ -345,11 +356,10 @@ Sema::LookupResult::CreateLookupResult(ASTContext &Context,
}
}
- Decl *D = *F;
- if (ObjCCompatibleAliasDecl *Alias
- = dyn_cast_or_null<ObjCCompatibleAliasDecl>(D))
- D = Alias->getClassInterface();
-
+ NamedDecl *D = *F;
+ if (D)
+ D = D->getUnderlyingDecl();
+
Result.StoredKind = SingleDecl;
Result.First = reinterpret_cast<uintptr_t>(D);
Result.Last = 0;
@@ -363,10 +373,10 @@ Sema::LookupResult::CreateLookupResult(ASTContext &Context,
LookupResult Result;
Result.Context = &Context;
- if (F != L && isa<FunctionDecl>(*F)) {
+ if (F != L && (*F)->isFunctionOrFunctionTemplate()) {
DeclContext::lookup_iterator Next = F;
++Next;
- if (Next != L && isa<FunctionDecl>(*Next)) {
+ if (Next != L && (*Next)->isFunctionOrFunctionTemplate()) {
Result.StoredKind = OverloadedDeclFromDeclContext;
Result.First = reinterpret_cast<uintptr_t>(F);
Result.Last = reinterpret_cast<uintptr_t>(L);
@@ -374,10 +384,9 @@ Sema::LookupResult::CreateLookupResult(ASTContext &Context,
}
}
- Decl *D = *F;
- if (ObjCCompatibleAliasDecl *Alias
- = dyn_cast_or_null<ObjCCompatibleAliasDecl>(D))
- D = Alias->getClassInterface();
+ NamedDecl *D = *F;
+ if (D)
+ D = D->getUnderlyingDecl();
Result.StoredKind = SingleDecl;
Result.First = reinterpret_cast<uintptr_t>(D);
@@ -1083,7 +1092,7 @@ Sema::LookupQualifiedName(DeclContext *LookupCtx, DeclarationName Name,
// Lookup in a base class succeeded; return these results.
// If we found a function declaration, return an overload set.
- if (isa<FunctionDecl>(*Paths.front().Decls.first))
+ if ((*Paths.front().Decls.first)->isFunctionOrFunctionTemplate())
return LookupResult::CreateLookupResult(Context,
Paths.front().Decls.first, Paths.front().Decls.second);
@@ -1239,7 +1248,8 @@ static void
addAssociatedClassesAndNamespaces(CXXRecordDecl *Class,
ASTContext &Context,
Sema::AssociatedNamespaceSet &AssociatedNamespaces,
- Sema::AssociatedClassSet &AssociatedClasses) {
+ Sema::AssociatedClassSet &AssociatedClasses,
+ bool &GlobalScope) {
// C++ [basic.lookup.koenig]p2:
// [...]
// -- If T is a class type (including unions), its associated
@@ -1252,13 +1262,14 @@ addAssociatedClassesAndNamespaces(CXXRecordDecl *Class,
DeclContext *Ctx = Class->getDeclContext();
if (CXXRecordDecl *EnclosingClass = dyn_cast<CXXRecordDecl>(Ctx))
AssociatedClasses.insert(EnclosingClass);
-
// Add the associated namespace for this class.
while (Ctx->isRecord())
Ctx = Ctx->getParent();
if (NamespaceDecl *EnclosingNamespace = dyn_cast<NamespaceDecl>(Ctx))
AssociatedNamespaces.insert(EnclosingNamespace);
-
+ else if (Ctx->isTranslationUnit())
+ GlobalScope = true;
+
// Add the class itself. If we've already seen this class, we don't
// need to visit base classes.
if (!AssociatedClasses.insert(Class))
@@ -1288,6 +1299,8 @@ addAssociatedClassesAndNamespaces(CXXRecordDecl *Class,
BaseCtx = BaseCtx->getParent();
if (NamespaceDecl *EnclosingNamespace = dyn_cast<NamespaceDecl>(BaseCtx))
AssociatedNamespaces.insert(EnclosingNamespace);
+ else if (BaseCtx->isTranslationUnit())
+ GlobalScope = true;
// Make sure we visit the bases of this base class.
if (BaseDecl->bases_begin() != BaseDecl->bases_end())
@@ -1304,7 +1317,8 @@ static void
addAssociatedClassesAndNamespaces(QualType T,
ASTContext &Context,
Sema::AssociatedNamespaceSet &AssociatedNamespaces,
- Sema::AssociatedClassSet &AssociatedClasses) {
+ Sema::AssociatedClassSet &AssociatedClasses,
+ bool &GlobalScope) {
// C++ [basic.lookup.koenig]p2:
//
// For each argument type T in the function call, there is a set
@@ -1346,7 +1360,8 @@ addAssociatedClassesAndNamespaces(QualType T,
= dyn_cast<CXXRecordDecl>(ClassType->getDecl())) {
addAssociatedClassesAndNamespaces(ClassDecl, Context,
AssociatedNamespaces,
- AssociatedClasses);
+ AssociatedClasses,
+ GlobalScope);
return;
}
@@ -1366,6 +1381,8 @@ addAssociatedClassesAndNamespaces(QualType T,
Ctx = Ctx->getParent();
if (NamespaceDecl *EnclosingNamespace = dyn_cast<NamespaceDecl>(Ctx))
AssociatedNamespaces.insert(EnclosingNamespace);
+ else if (Ctx->isTranslationUnit())
+ GlobalScope = true;
return;
}
@@ -1377,7 +1394,8 @@ addAssociatedClassesAndNamespaces(QualType T,
// Return type
addAssociatedClassesAndNamespaces(FunctionType->getResultType(),
Context,
- AssociatedNamespaces, AssociatedClasses);
+ AssociatedNamespaces, AssociatedClasses,
+ GlobalScope);
const FunctionProtoType *Proto = dyn_cast<FunctionProtoType>(FunctionType);
if (!Proto)
@@ -1388,7 +1406,8 @@ addAssociatedClassesAndNamespaces(QualType T,
ArgEnd = Proto->arg_type_end();
Arg != ArgEnd; ++Arg)
addAssociatedClassesAndNamespaces(*Arg, Context,
- AssociatedNamespaces, AssociatedClasses);
+ AssociatedNamespaces, AssociatedClasses,
+ GlobalScope);
return;
}
@@ -1406,13 +1425,15 @@ addAssociatedClassesAndNamespaces(QualType T,
// Handle the type that the pointer to member points to.
addAssociatedClassesAndNamespaces(MemberPtr->getPointeeType(),
Context,
- AssociatedNamespaces, AssociatedClasses);
+ AssociatedNamespaces, AssociatedClasses,
+ GlobalScope);
// Handle the class type into which this points.
if (const RecordType *Class = MemberPtr->getClass()->getAsRecordType())
addAssociatedClassesAndNamespaces(cast<CXXRecordDecl>(Class->getDecl()),
Context,
- AssociatedNamespaces, AssociatedClasses);
+ AssociatedNamespaces, AssociatedClasses,
+ GlobalScope);
return;
}
@@ -1431,7 +1452,8 @@ addAssociatedClassesAndNamespaces(QualType T,
void
Sema::FindAssociatedClassesAndNamespaces(Expr **Args, unsigned NumArgs,
AssociatedNamespaceSet &AssociatedNamespaces,
- AssociatedClassSet &AssociatedClasses) {
+ AssociatedClassSet &AssociatedClasses,
+ bool &GlobalScope) {
AssociatedNamespaces.clear();
AssociatedClasses.clear();
@@ -1447,7 +1469,8 @@ Sema::FindAssociatedClassesAndNamespaces(Expr **Args, unsigned NumArgs,
if (Arg->getType() != Context.OverloadTy) {
addAssociatedClassesAndNamespaces(Arg->getType(), Context,
- AssociatedNamespaces, AssociatedClasses);
+ AssociatedNamespaces, AssociatedClasses,
+ GlobalScope);
continue;
}
@@ -1475,7 +1498,9 @@ Sema::FindAssociatedClassesAndNamespaces(Expr **Args, unsigned NumArgs,
for (OverloadedFunctionDecl::function_iterator Func = Ovl->function_begin(),
FuncEnd = Ovl->function_end();
Func != FuncEnd; ++Func) {
- FunctionDecl *FDecl = cast<FunctionDecl>(*Func);
+ FunctionDecl *FDecl = dyn_cast<FunctionDecl>(*Func);
+ if (!FDecl)
+ FDecl = cast<FunctionTemplateDecl>(*Func)->getTemplatedDecl();
// Add the namespace in which this function was defined. Note
// that, if this is a member function, we do *not* consider the
@@ -1483,11 +1508,14 @@ Sema::FindAssociatedClassesAndNamespaces(Expr **Args, unsigned NumArgs,
DeclContext *Ctx = FDecl->getDeclContext();
if (NamespaceDecl *EnclosingNamespace = dyn_cast<NamespaceDecl>(Ctx))
AssociatedNamespaces.insert(EnclosingNamespace);
+ else if (Ctx->isTranslationUnit())
+ GlobalScope = true;
// Add the classes and namespaces associated with the parameter
// types and return type of this function.
addAssociatedClassesAndNamespaces(FDecl->getType(), Context,
- AssociatedNamespaces, AssociatedClasses);
+ AssociatedNamespaces, AssociatedClasses,
+ GlobalScope);
}
}
}
@@ -1589,8 +1617,10 @@ void Sema::ArgumentDependentLookup(DeclarationName Name,
// arguments we have.
AssociatedNamespaceSet AssociatedNamespaces;
AssociatedClassSet AssociatedClasses;
+ bool GlobalScope = false;
FindAssociatedClassesAndNamespaces(Args, NumArgs,
- AssociatedNamespaces, AssociatedClasses);
+ AssociatedNamespaces, AssociatedClasses,
+ GlobalScope);
// C++ [basic.lookup.argdep]p3:
// Let X be the lookup set produced by unqualified lookup (3.4.1)
@@ -1626,4 +1656,17 @@ void Sema::ArgumentDependentLookup(DeclarationName Name,
Functions.insert(Func);
}
}
+
+ if (GlobalScope) {
+ DeclContext::lookup_iterator I, E;
+ for (llvm::tie(I, E)
+ = Context.getTranslationUnitDecl()->lookup(Context, Name);
+ I != E; ++I) {
+ FunctionDecl *Func = dyn_cast<FunctionDecl>(*I);
+ if (!Func)
+ break;
+
+ Functions.insert(Func);
+ }
+ }
}
diff --git a/lib/Sema/SemaOverload.cpp b/lib/Sema/SemaOverload.cpp
index 11cd5107fc63..fcc155750cdc 100644
--- a/lib/Sema/SemaOverload.cpp
+++ b/lib/Sema/SemaOverload.cpp
@@ -300,7 +300,18 @@ Sema::IsOverload(FunctionDecl *New, Decl* OldD,
// This function overloads every function in the overload set.
return true;
- } else if (FunctionDecl* Old = dyn_cast<FunctionDecl>(OldD)) {
+ } else if (FunctionTemplateDecl *Old = dyn_cast<FunctionTemplateDecl>(OldD))
+ return IsOverload(New, Old->getTemplatedDecl(), MatchedDecl);
+ else if (FunctionDecl* Old = dyn_cast<FunctionDecl>(OldD)) {
+ FunctionTemplateDecl *OldTemplate = Old->getDescribedFunctionTemplate();
+ FunctionTemplateDecl *NewTemplate = New->getDescribedFunctionTemplate();
+
+ // C++ [temp.fct]p2:
+ // A function template can be overloaded with other function templates
+ // and with normal (non-template) functions.
+ if ((OldTemplate == 0) != (NewTemplate == 0))
+ return true;
+
// Is the function New an overload of the function Old?
QualType OldQType = Context.getCanonicalType(Old->getType());
QualType NewQType = Context.getCanonicalType(New->getType());
@@ -315,8 +326,8 @@ Sema::IsOverload(FunctionDecl *New, Decl* OldD,
isa<FunctionNoProtoType>(NewQType.getTypePtr()))
return false;
- FunctionProtoType* OldType = cast<FunctionProtoType>(OldQType.getTypePtr());
- FunctionProtoType* NewType = cast<FunctionProtoType>(NewQType.getTypePtr());
+ FunctionProtoType* OldType = cast<FunctionProtoType>(OldQType);
+ FunctionProtoType* NewType = cast<FunctionProtoType>(NewQType);
// The signature of a function includes the types of its
// parameters (C++ 1.3.10), which includes the presence or absence
@@ -328,6 +339,22 @@ Sema::IsOverload(FunctionDecl *New, Decl* OldD,
NewType->arg_type_begin())))
return true;
+ // C++ [temp.over.link]p4:
+ // The signature of a function template consists of its function
+ // signature, its return type and its template parameter list. The names
+ // of the template parameters are significant only for establishing the
+ // relationship between the template parameters and the rest of the
+ // signature.
+ //
+ // We check the return type and template parameter lists for function
+ // templates first; the remaining checks follow.
+ if (NewTemplate &&
+ (!TemplateParameterListsAreEqual(NewTemplate->getTemplateParameters(),
+ OldTemplate->getTemplateParameters(),
+ false, false, SourceLocation()) ||
+ OldType->getResultType() != NewType->getResultType()))
+ return true;
+
// If the function is a class member, its signature includes the
// cv-qualifiers (if any) on the function itself.
//
@@ -2048,7 +2075,9 @@ Sema::AddOverloadCandidate(FunctionDecl *Function,
assert(Proto && "Functions without a prototype cannot be overloaded");
assert(!isa<CXXConversionDecl>(Function) &&
"Use AddConversionCandidate for conversion functions");
-
+ assert(!Function->getDescribedFunctionTemplate() &&
+ "Use AddTemplateOverloadCandidate for function templates");
+
if (CXXMethodDecl *Method = dyn_cast<CXXMethodDecl>(Function)) {
if (!isa<CXXConstructorDecl>(Method)) {
// If we get here, it's because we're calling a member function
@@ -2233,6 +2262,42 @@ Sema::AddMethodCandidate(CXXMethodDecl *Method, Expr *Object,
}
}
+/// \brief Add a C++ function template as a candidate in the candidate set,
+/// using template argument deduction to produce an appropriate function
+/// template specialization.
+void
+Sema::AddTemplateOverloadCandidate(FunctionTemplateDecl *FunctionTemplate,
+ Expr **Args, unsigned NumArgs,
+ OverloadCandidateSet& CandidateSet,
+ bool SuppressUserConversions,
+ bool ForceRValue) {
+ // C++ [over.match.funcs]p7:
+ // In each case where a candidate is a function template, candidate
+ // function template specializations are generated using template argument
+ // deduction (14.8.3, 14.8.2). Those candidates are then handled as
+ // candidate functions in the usual way.113) A given name can refer to one
+ // or more function templates and also to a set of overloaded non-template
+ // functions. In such a case, the candidate functions generated from each
+ // function template are combined with the set of non-template candidate
+ // functions.
+ TemplateDeductionInfo Info(Context);
+ FunctionDecl *Specialization = 0;
+ if (TemplateDeductionResult Result
+ = DeduceTemplateArguments(FunctionTemplate, Args, NumArgs,
+ Specialization, Info)) {
+ // FIXME: Record what happened with template argument deduction, so
+ // that we can give the user a beautiful diagnostic.
+ (void)Result;
+ return;
+ }
+
+ // Add the function template specialization produced by template argument
+ // deduction as a candidate.
+ assert(Specialization && "Missing function template specialization?");
+ AddOverloadCandidate(Specialization, Args, NumArgs, CandidateSet,
+ SuppressUserConversions, ForceRValue);
+}
+
/// AddConversionCandidate - Add a C++ conversion function as a
/// candidate in the candidate set (C++ [over.match.conv],
/// C++ [over.match.copy]). From is the expression we're converting from,
@@ -3653,8 +3718,15 @@ Sema::ResolveAddressOfOverloadedFunction(Expr *From, QualType ToType,
} else if (IsMember)
continue;
- if (FunctionType == Context.getCanonicalType((*Fun)->getType()))
- return *Fun;
+ if (FunctionDecl *FunDecl = dyn_cast<FunctionDecl>(*Fun)) {
+ if (FunctionType == Context.getCanonicalType(FunDecl->getType()))
+ return FunDecl;
+ } else {
+ unsigned DiagID
+ = PP.getDiagnostics().getCustomDiagID(Diagnostic::Warning,
+ "Clang does not yet support templated conversion functions");
+ Diag(From->getLocStart(), DiagID);
+ }
}
return 0;
@@ -3699,10 +3771,18 @@ FunctionDecl *Sema::ResolveOverloadedCallFn(Expr *Fn, NamedDecl *Callee,
for (OverloadedFunctionDecl::function_iterator Func = Ovl->function_begin(),
FuncEnd = Ovl->function_end();
Func != FuncEnd; ++Func) {
- AddOverloadCandidate(*Func, Args, NumArgs, CandidateSet);
+ DeclContext *Ctx = 0;
+ if (FunctionDecl *FunDecl = dyn_cast<FunctionDecl>(*Func)) {
+ AddOverloadCandidate(FunDecl, Args, NumArgs, CandidateSet);
+ Ctx = FunDecl->getDeclContext();
+ } else {
+ FunctionTemplateDecl *FunTmpl = cast<FunctionTemplateDecl>(*Func);
+ AddTemplateOverloadCandidate(FunTmpl, Args, NumArgs, CandidateSet);
+ Ctx = FunTmpl->getDeclContext();
+ }
- if ((*Func)->getDeclContext()->isRecord() ||
- (*Func)->getDeclContext()->isFunctionOrMethod())
+
+ if (Ctx->isRecord() || Ctx->isFunctionOrMethod())
ArgumentDependentLookup = false;
}
} else if (FunctionDecl *Func = dyn_cast_or_null<FunctionDecl>(Callee)) {
@@ -3711,7 +3791,13 @@ FunctionDecl *Sema::ResolveOverloadedCallFn(Expr *Fn, NamedDecl *Callee,
if (Func->getDeclContext()->isRecord() ||
Func->getDeclContext()->isFunctionOrMethod())
ArgumentDependentLookup = false;
- }
+ } else if (FunctionTemplateDecl *FuncTemplate
+ = dyn_cast_or_null<FunctionTemplateDecl>(Callee)) {
+ AddTemplateOverloadCandidate(FuncTemplate, Args, NumArgs, CandidateSet);
+
+ if (FuncTemplate->getDeclContext()->isRecord())
+ ArgumentDependentLookup = false;
+ }
if (Callee)
UnqualifiedName = Callee->getDeclName();
diff --git a/lib/Sema/SemaTemplate.cpp b/lib/Sema/SemaTemplate.cpp
index e98ebb13f811..cd985c536c77 100644
--- a/lib/Sema/SemaTemplate.cpp
+++ b/lib/Sema/SemaTemplate.cpp
@@ -67,9 +67,10 @@ TemplateNameKind Sema::isTemplateName(const IdentifierInfo &II, Scope *S,
}
}
- // FIXME: What follows is a gross hack.
+ // FIXME: What follows is a slightly less gross hack than what used to
+ // follow.
if (FunctionDecl *FD = dyn_cast<FunctionDecl>(IIDecl)) {
- if (FD->getType()->isDependentType()) {
+ if (FD->getDescribedFunctionTemplate()) {
TemplateResult = TemplateTy::make(FD);
return TNK_Function_template;
}
@@ -78,7 +79,7 @@ TemplateNameKind Sema::isTemplateName(const IdentifierInfo &II, Scope *S,
for (OverloadedFunctionDecl::function_iterator F = Ovl->function_begin(),
FEnd = Ovl->function_end();
F != FEnd; ++F) {
- if ((*F)->getType()->isDependentType()) {
+ if (isa<FunctionTemplateDecl>(*F)) {
TemplateResult = TemplateTy::make(Ovl);
return TNK_Function_template;
}
@@ -1808,8 +1809,8 @@ bool Sema::CheckTemplateArgument(TemplateTemplateParmDecl *Param,
!isa<TemplateTemplateParmDecl>(Template)) {
assert(isa<FunctionTemplateDecl>(Template) &&
"Only function templates are possible here");
- Diag(Arg->getSourceRange().getBegin(),
- diag::note_template_arg_refers_here_func)
+ Diag(Arg->getLocStart(), diag::err_template_arg_not_class_template);
+ Diag(Template->getLocation(), diag::note_template_arg_refers_here_func)
<< Template;
}
@@ -1873,15 +1874,17 @@ Sema::TemplateParameterListsAreEqual(TemplateParameterList *New,
OldParmEnd = Old->end(), NewParm = New->begin();
OldParm != OldParmEnd; ++OldParm, ++NewParm) {
if ((*OldParm)->getKind() != (*NewParm)->getKind()) {
- unsigned NextDiag = diag::err_template_param_different_kind;
- if (TemplateArgLoc.isValid()) {
- Diag(TemplateArgLoc, diag::err_template_arg_template_params_mismatch);
- NextDiag = diag::note_template_param_different_kind;
- }
- Diag((*NewParm)->getLocation(), NextDiag)
+ if (Complain) {
+ unsigned NextDiag = diag::err_template_param_different_kind;
+ if (TemplateArgLoc.isValid()) {
+ Diag(TemplateArgLoc, diag::err_template_arg_template_params_mismatch);
+ NextDiag = diag::note_template_param_different_kind;
+ }
+ Diag((*NewParm)->getLocation(), NextDiag)
<< IsTemplateTemplateParm;
- Diag((*OldParm)->getLocation(), diag::note_template_prev_declaration)
+ Diag((*OldParm)->getLocation(), diag::note_template_prev_declaration)
<< IsTemplateTemplateParm;
+ }
return false;
}
@@ -2499,6 +2502,40 @@ Sema::ActOnClassTemplateSpecialization(Scope *S, unsigned TagSpec, TagKind TK,
return DeclPtrTy::make(Specialization);
}
+Sema::DeclPtrTy
+Sema::ActOnTemplateDeclarator(Scope *S,
+ MultiTemplateParamsArg TemplateParameterLists,
+ Declarator &D) {
+ return HandleDeclarator(S, D, move(TemplateParameterLists), false);
+}
+
+Sema::DeclPtrTy
+Sema::ActOnStartOfFunctionTemplateDef(Scope *FnBodyScope,
+ MultiTemplateParamsArg TemplateParameterLists,
+ Declarator &D) {
+ assert(getCurFunctionDecl() == 0 && "Function parsing confused");
+ assert(D.getTypeObject(0).Kind == DeclaratorChunk::Function &&
+ "Not a function declarator!");
+ DeclaratorChunk::FunctionTypeInfo &FTI = D.getTypeObject(0).Fun;
+
+ if (FTI.hasPrototype) {
+ // FIXME: Diagnose arguments without names in C.
+ }
+
+ Scope *ParentScope = FnBodyScope->getParent();
+
+ DeclPtrTy DP = HandleDeclarator(ParentScope, D,
+ move(TemplateParameterLists),
+ /*IsFunctionDefinition=*/true);
+ FunctionTemplateDecl *FunctionTemplate
+ = cast_or_null<FunctionTemplateDecl>(DP.getAs<Decl>());
+ if (FunctionTemplate)
+ return ActOnStartOfFunctionDef(FnBodyScope,
+ DeclPtrTy::make(FunctionTemplate->getTemplatedDecl()));
+
+ return DeclPtrTy();
+}
+
// Explicit instantiation of a class template specialization
Sema::DeclResult
Sema::ActOnExplicitInstantiation(Scope *S, SourceLocation TemplateLoc,
diff --git a/lib/Sema/SemaTemplateDeduction.cpp b/lib/Sema/SemaTemplateDeduction.cpp
index de3e52df3763..3d909bb26a79 100644
--- a/lib/Sema/SemaTemplateDeduction.cpp
+++ b/lib/Sema/SemaTemplateDeduction.cpp
@@ -18,6 +18,30 @@
#include "clang/AST/ExprCXX.h"
#include "clang/Parse/DeclSpec.h"
#include "llvm/Support/Compiler.h"
+
+namespace clang {
+ /// \brief Various flags that control template argument deduction.
+ ///
+ /// These flags can be bitwise-OR'd together.
+ enum TemplateDeductionFlags {
+ /// \brief No template argument deduction flags, which indicates the
+ /// strictest results for template argument deduction (as used for, e.g.,
+ /// matching class template partial specializations).
+ TDF_None = 0,
+ /// \brief Within template argument deduction from a function call, we are
+ /// matching with a parameter type for which the original parameter was
+ /// a reference.
+ TDF_ParamWithReferenceType = 0x1,
+ /// \brief Within template argument deduction from a function call, we
+ /// are matching in a case where we ignore cv-qualifiers.
+ TDF_IgnoreQualifiers = 0x02,
+ /// \brief Within template argument deduction from a function call,
+ /// we are matching in a case where we can perform template argument
+ /// deduction from a template-id of a derived class of the argument type.
+ TDF_DerivedClass = 0x04
+ };
+}
+
using namespace clang;
static Sema::TemplateDeductionResult
@@ -156,27 +180,52 @@ DeduceTemplateArguments(ASTContext &Context,
return Sema::TDK_Success;
}
+/// \brief Deduce the template arguments by comparing the parameter type and
+/// the argument type (C++ [temp.deduct.type]).
+///
+/// \param Context the AST context in which this deduction occurs.
+///
+/// \param TemplateParams the template parameters that we are deducing
+///
+/// \param ParamIn the parameter type
+///
+/// \param ArgIn the argument type
+///
+/// \param Info information about the template argument deduction itself
+///
+/// \param Deduced the deduced template arguments
+///
+/// \param TDF bitwise OR of the TemplateDeductionFlags bits that describe
+/// how template argument deduction is performed.
+///
+/// \returns the result of template argument deduction so far. Note that a
+/// "success" result means that template argument deduction has not yet failed,
+/// but it may still fail, later, for other reasons.
static Sema::TemplateDeductionResult
DeduceTemplateArguments(ASTContext &Context,
TemplateParameterList *TemplateParams,
QualType ParamIn, QualType ArgIn,
Sema::TemplateDeductionInfo &Info,
- llvm::SmallVectorImpl<TemplateArgument> &Deduced) {
+ llvm::SmallVectorImpl<TemplateArgument> &Deduced,
+ unsigned TDF) {
// We only want to look at the canonical types, since typedefs and
// sugar are not part of template argument deduction.
QualType Param = Context.getCanonicalType(ParamIn);
QualType Arg = Context.getCanonicalType(ArgIn);
- // If the parameter type is not dependent, just compare the types
- // directly.
- if (!Param->isDependentType()) {
- if (Param == Arg)
- return Sema::TDK_Success;
-
- Info.FirstArg = TemplateArgument(SourceLocation(), ParamIn);
- Info.SecondArg = TemplateArgument(SourceLocation(), ArgIn);
- return Sema::TDK_NonDeducedMismatch;
+ // C++0x [temp.deduct.call]p4 bullet 1:
+ // - If the original P is a reference type, the deduced A (i.e., the type
+ // referred to by the reference) can be more cv-qualified than the
+ // transformed A.
+ if (TDF & TDF_ParamWithReferenceType) {
+ unsigned ExtraQualsOnParam
+ = Param.getCVRQualifiers() & ~Arg.getCVRQualifiers();
+ Param.setCVRQualifiers(Param.getCVRQualifiers() & ~ExtraQualsOnParam);
}
+
+ // If the parameter type is not dependent, there is nothing to deduce.
+ if (!Param->isDependentType())
+ return Sema::TDK_Success;
// C++ [temp.deduct.type]p9:
// A template type argument T, a template template argument TT or a
@@ -191,7 +240,7 @@ DeduceTemplateArguments(ASTContext &Context,
// The argument type can not be less qualified than the parameter
// type.
- if (Param.isMoreQualifiedThan(Arg)) {
+ if (Param.isMoreQualifiedThan(Arg) && !(TDF & TDF_IgnoreQualifiers)) {
Info.Param = cast<TemplateTypeParmDecl>(TemplateParams->getParam(Index));
Info.FirstArg = Deduced[Index];
Info.SecondArg = TemplateArgument(SourceLocation(), Arg);
@@ -227,8 +276,16 @@ DeduceTemplateArguments(ASTContext &Context,
Info.FirstArg = TemplateArgument(SourceLocation(), ParamIn);
Info.SecondArg = TemplateArgument(SourceLocation(), ArgIn);
- if (Param.getCVRQualifiers() != Arg.getCVRQualifiers())
- return Sema::TDK_NonDeducedMismatch;
+ // Check the cv-qualifiers on the parameter and argument types.
+ if (!(TDF & TDF_IgnoreQualifiers)) {
+ if (TDF & TDF_ParamWithReferenceType) {
+ if (Param.isMoreQualifiedThan(Arg))
+ return Sema::TDK_NonDeducedMismatch;
+ } else {
+ if (Param.getCVRQualifiers() != Arg.getCVRQualifiers())
+ return Sema::TDK_NonDeducedMismatch;
+ }
+ }
switch (Param->getTypeClass()) {
// No deduction possible for these types
@@ -241,10 +298,11 @@ DeduceTemplateArguments(ASTContext &Context,
if (!PointerArg)
return Sema::TDK_NonDeducedMismatch;
+ unsigned SubTDF = TDF & (TDF_IgnoreQualifiers | TDF_DerivedClass);
return DeduceTemplateArguments(Context, TemplateParams,
cast<PointerType>(Param)->getPointeeType(),
PointerArg->getPointeeType(),
- Info, Deduced);
+ Info, Deduced, SubTDF);
}
// T &
@@ -256,7 +314,7 @@ DeduceTemplateArguments(ASTContext &Context,
return DeduceTemplateArguments(Context, TemplateParams,
cast<LValueReferenceType>(Param)->getPointeeType(),
ReferenceArg->getPointeeType(),
- Info, Deduced);
+ Info, Deduced, 0);
}
// T && [C++0x]
@@ -268,7 +326,7 @@ DeduceTemplateArguments(ASTContext &Context,
return DeduceTemplateArguments(Context, TemplateParams,
cast<RValueReferenceType>(Param)->getPointeeType(),
ReferenceArg->getPointeeType(),
- Info, Deduced);
+ Info, Deduced, 0);
}
// T [] (implied, but not stated explicitly)
@@ -281,7 +339,7 @@ DeduceTemplateArguments(ASTContext &Context,
return DeduceTemplateArguments(Context, TemplateParams,
Context.getAsIncompleteArrayType(Param)->getElementType(),
IncompleteArrayArg->getElementType(),
- Info, Deduced);
+ Info, Deduced, 0);
}
// T [integer-constant]
@@ -299,7 +357,7 @@ DeduceTemplateArguments(ASTContext &Context,
return DeduceTemplateArguments(Context, TemplateParams,
ConstantArrayParm->getElementType(),
ConstantArrayArg->getElementType(),
- Info, Deduced);
+ Info, Deduced, 0);
}
// type [i]
@@ -315,7 +373,7 @@ DeduceTemplateArguments(ASTContext &Context,
= DeduceTemplateArguments(Context, TemplateParams,
DependentArrayParm->getElementType(),
ArrayArg->getElementType(),
- Info, Deduced))
+ Info, Deduced, 0))
return Result;
// Determine the array bound is something we can deduce.
@@ -371,7 +429,7 @@ DeduceTemplateArguments(ASTContext &Context,
= DeduceTemplateArguments(Context, TemplateParams,
FunctionProtoParam->getResultType(),
FunctionProtoArg->getResultType(),
- Info, Deduced))
+ Info, Deduced, 0))
return Result;
for (unsigned I = 0, N = FunctionProtoParam->getNumArgs(); I != N; ++I) {
@@ -380,14 +438,14 @@ DeduceTemplateArguments(ASTContext &Context,
= DeduceTemplateArguments(Context, TemplateParams,
FunctionProtoParam->getArgType(I),
FunctionProtoArg->getArgType(I),
- Info, Deduced))
+ Info, Deduced, 0))
return Result;
}
return Sema::TDK_Success;
}
- // template-name<T> (wheretemplate-name refers to a class template)
+ // template-name<T> (where template-name refers to a class template)
// template-name<i>
// TT<T> (TODO)
// TT<i> (TODO)
@@ -440,6 +498,11 @@ DeduceTemplateArguments(ASTContext &Context,
if (!RecordArg)
return Sema::TDK_NonDeducedMismatch;
+ // FIXME: Check TDF_DerivedClass here. When this flag is set, we need
+ // to troll through the base classes of the argument and try matching
+ // all of them. Failure to match does not mean that there is a problem,
+ // of course.
+
ClassTemplateSpecializationDecl *SpecArg
= dyn_cast<ClassTemplateSpecializationDecl>(RecordArg->getDecl());
if (!SpecArg)
@@ -489,13 +552,14 @@ DeduceTemplateArguments(ASTContext &Context,
= DeduceTemplateArguments(Context, TemplateParams,
MemPtrParam->getPointeeType(),
MemPtrArg->getPointeeType(),
- Info, Deduced))
+ Info, Deduced,
+ TDF & TDF_IgnoreQualifiers))
return Result;
return DeduceTemplateArguments(Context, TemplateParams,
QualType(MemPtrParam->getClass(), 0),
QualType(MemPtrArg->getClass(), 0),
- Info, Deduced);
+ Info, Deduced, 0);
}
// (clang extension)
@@ -513,7 +577,7 @@ DeduceTemplateArguments(ASTContext &Context,
return DeduceTemplateArguments(Context, TemplateParams,
BlockPtrParam->getPointeeType(),
BlockPtrArg->getPointeeType(), Info,
- Deduced);
+ Deduced, 0);
}
case Type::TypeOfExpr:
@@ -527,7 +591,7 @@ DeduceTemplateArguments(ASTContext &Context,
}
// FIXME: Many more cases to go (to go).
- return Sema::TDK_NonDeducedMismatch;
+ return Sema::TDK_Success;
}
static Sema::TemplateDeductionResult
@@ -544,9 +608,8 @@ DeduceTemplateArguments(ASTContext &Context,
case TemplateArgument::Type:
assert(Arg.getKind() == TemplateArgument::Type && "Type/value mismatch");
- return DeduceTemplateArguments(Context, TemplateParams,
- Param.getAsType(),
- Arg.getAsType(), Info, Deduced);
+ return DeduceTemplateArguments(Context, TemplateParams, Param.getAsType(),
+ Arg.getAsType(), Info, Deduced, 0);
case TemplateArgument::Declaration:
// FIXME: Implement this check
@@ -624,6 +687,62 @@ DeduceTemplateArguments(ASTContext &Context,
return Sema::TDK_Success;
}
+/// \brief Determine whether two template arguments are the same.
+static bool isSameTemplateArg(ASTContext &Context,
+ const TemplateArgument &X,
+ const TemplateArgument &Y) {
+ if (X.getKind() != Y.getKind())
+ return false;
+
+ switch (X.getKind()) {
+ case TemplateArgument::Null:
+ assert(false && "Comparing NULL template argument");
+ break;
+
+ case TemplateArgument::Type:
+ return Context.getCanonicalType(X.getAsType()) ==
+ Context.getCanonicalType(Y.getAsType());
+
+ case TemplateArgument::Declaration:
+ return Context.getCanonicalDecl(X.getAsDecl()) ==
+ Context.getCanonicalDecl(Y.getAsDecl());
+
+ case TemplateArgument::Integral:
+ return *X.getAsIntegral() == *Y.getAsIntegral();
+
+ case TemplateArgument::Expression:
+ // FIXME: We assume that all expressions are distinct, but we should
+ // really check their canonical forms.
+ return false;
+
+ case TemplateArgument::Pack:
+ if (X.pack_size() != Y.pack_size())
+ return false;
+
+ for (TemplateArgument::pack_iterator XP = X.pack_begin(),
+ XPEnd = X.pack_end(),
+ YP = Y.pack_begin();
+ XP != XPEnd; ++XP, ++YP)
+ if (!isSameTemplateArg(Context, *XP, *YP))
+ return false;
+
+ return true;
+ }
+
+ return false;
+}
+
+/// \brief Helper function to build a TemplateParameter when we don't
+/// know its type statically.
+static TemplateParameter makeTemplateParameter(Decl *D) {
+ if (TemplateTypeParmDecl *TTP = dyn_cast<TemplateTypeParmDecl>(D))
+ return TemplateParameter(TTP);
+ else if (NonTypeTemplateParmDecl *NTTP = dyn_cast<NonTypeTemplateParmDecl>(D))
+ return TemplateParameter(NTTP);
+
+ return TemplateParameter(cast<TemplateTemplateParmDecl>(D));
+}
+
/// \brief Perform template argument deduction to determine whether
/// the given template arguments match the given class template
/// partial specialization per C++ [temp.class.spec.match].
@@ -688,32 +807,243 @@ Sema::DeduceTemplateArguments(ClassTemplatePartialSpecializationDecl *Partial,
for (unsigned I = 0, N = PartialTemplateArgs.flat_size(); I != N; ++I) {
Decl *Param = const_cast<Decl *>(
ClassTemplate->getTemplateParameters()->getParam(I));
- if (TemplateTypeParmDecl *TTP = dyn_cast<TemplateTypeParmDecl>(Param)) {
- TemplateArgument InstArg = Instantiate(PartialTemplateArgs[I],
- *DeducedArgumentList);
- if (InstArg.getKind() != TemplateArgument::Type) {
- Info.Param = TTP;
- Info.FirstArg = PartialTemplateArgs[I];
- return TDK_SubstitutionFailure;
+ TemplateArgument InstArg = Instantiate(PartialTemplateArgs[I],
+ *DeducedArgumentList);
+ if (InstArg.isNull()) {
+ Info.Param = makeTemplateParameter(Param);
+ Info.FirstArg = PartialTemplateArgs[I];
+ return TDK_SubstitutionFailure;
+ }
+
+ if (InstArg.getKind() == TemplateArgument::Expression) {
+ // When the argument is an expression, check the expression result
+ // against the actual template parameter to get down to the canonical
+ // template argument.
+ Expr *InstExpr = InstArg.getAsExpr();
+ if (NonTypeTemplateParmDecl *NTTP
+ = dyn_cast<NonTypeTemplateParmDecl>(Param)) {
+ if (CheckTemplateArgument(NTTP, NTTP->getType(), InstExpr, InstArg)) {
+ Info.Param = makeTemplateParameter(Param);
+ Info.FirstArg = PartialTemplateArgs[I];
+ return TDK_SubstitutionFailure;
+ }
+ } else if (TemplateTemplateParmDecl *TTP
+ = dyn_cast<TemplateTemplateParmDecl>(Param)) {
+ // FIXME: template template arguments should really resolve to decls
+ DeclRefExpr *DRE = dyn_cast<DeclRefExpr>(InstExpr);
+ if (!DRE || CheckTemplateArgument(TTP, DRE)) {
+ Info.Param = makeTemplateParameter(Param);
+ Info.FirstArg = PartialTemplateArgs[I];
+ return TDK_SubstitutionFailure;
+ }
}
+ }
+
+ if (!isSameTemplateArg(Context, TemplateArgs[I], InstArg)) {
+ Info.Param = makeTemplateParameter(Param);
+ Info.FirstArg = TemplateArgs[I];
+ Info.SecondArg = InstArg;
+ return TDK_NonDeducedMismatch;
+ }
+ }
- if (Context.getCanonicalType(InstArg.getAsType())
- != Context.getCanonicalType(TemplateArgs[I].getAsType())) {
- Info.Param = TTP;
- Info.FirstArg = TemplateArgs[I];
- Info.SecondArg = InstArg;
- return TDK_NonDeducedMismatch;
- }
+ if (Trap.hasErrorOccurred())
+ return TDK_SubstitutionFailure;
- continue;
- }
+ return TDK_Success;
+}
- // FIXME: Check template template arguments?
+/// \brief Determine whether the given type T is a simple-template-id type.
+static bool isSimpleTemplateIdType(QualType T) {
+ if (const TemplateSpecializationType *Spec
+ = T->getAsTemplateSpecializationType())
+ return Spec->getTemplateName().getAsTemplateDecl() != 0;
+
+ return false;
+}
+
+/// \brief Perform template argument deduction from a function call
+/// (C++ [temp.deduct.call]).
+///
+/// \param FunctionTemplate the function template for which we are performing
+/// template argument deduction.
+///
+/// \param Args the function call arguments
+///
+/// \param NumArgs the number of arguments in Args
+///
+/// \param Specialization if template argument deduction was successful,
+/// this will be set to the function template specialization produced by
+/// template argument deduction.
+///
+/// \param Info the argument will be updated to provide additional information
+/// about template argument deduction.
+///
+/// \returns the result of template argument deduction.
+///
+/// FIXME: We will also need to pass in any explicitly-specified template
+/// arguments.
+Sema::TemplateDeductionResult
+Sema::DeduceTemplateArguments(FunctionTemplateDecl *FunctionTemplate,
+ Expr **Args, unsigned NumArgs,
+ FunctionDecl *&Specialization,
+ TemplateDeductionInfo &Info) {
+ FunctionDecl *Function = FunctionTemplate->getTemplatedDecl();
+
+ // C++ [temp.deduct.call]p1:
+ // Template argument deduction is done by comparing each function template
+ // parameter type (call it P) with the type of the corresponding argument
+ // of the call (call it A) as described below.
+ unsigned CheckArgs = NumArgs;
+ if (NumArgs < Function->getNumParams())
+ return TDK_TooFewArguments;
+ else if (NumArgs > Function->getNumParams()) {
+ const FunctionProtoType *Proto
+ = Function->getType()->getAsFunctionProtoType();
+ if (!Proto->isVariadic())
+ return TDK_TooManyArguments;
+
+ CheckArgs = Function->getNumParams();
+ }
+
+ // Template argument deduction for function templates in a SFINAE context.
+ // Trap any errors that might occur.
+ SFINAETrap Trap(*this);
+
+ // Deduce template arguments from the function parameters.
+ llvm::SmallVector<TemplateArgument, 4> Deduced;
+ Deduced.resize(FunctionTemplate->getTemplateParameters()->size());
+ TemplateParameterList *TemplateParams
+ = FunctionTemplate->getTemplateParameters();
+ for (unsigned I = 0; I != CheckArgs; ++I) {
+ QualType ParamType = Function->getParamDecl(I)->getType();
+ QualType ArgType = Args[I]->getType();
+
+ // C++ [temp.deduct.call]p2:
+ // If P is not a reference type:
+ QualType CanonParamType = Context.getCanonicalType(ParamType);
+ bool ParamWasReference = isa<ReferenceType>(CanonParamType);
+ if (!ParamWasReference) {
+ // - If A is an array type, the pointer type produced by the
+ // array-to-pointer standard conversion (4.2) is used in place of
+ // A for type deduction; otherwise,
+ if (ArgType->isArrayType())
+ ArgType = Context.getArrayDecayedType(ArgType);
+ // - If A is a function type, the pointer type produced by the
+ // function-to-pointer standard conversion (4.3) is used in place
+ // of A for type deduction; otherwise,
+ else if (ArgType->isFunctionType())
+ ArgType = Context.getPointerType(ArgType);
+ else {
+ // - If A is a cv-qualified type, the top level cv-qualifiers of A’s
+ // type are ignored for type deduction.
+ QualType CanonArgType = Context.getCanonicalType(ArgType);
+ if (CanonArgType.getCVRQualifiers())
+ ArgType = CanonArgType.getUnqualifiedType();
+ }
+ }
+
+ // C++0x [temp.deduct.call]p3:
+ // If P is a cv-qualified type, the top level cv-qualifiers of P’s type
+ // are ignored for type deduction.
+ if (CanonParamType.getCVRQualifiers())
+ ParamType = CanonParamType.getUnqualifiedType();
+ if (const ReferenceType *ParamRefType = ParamType->getAsReferenceType()) {
+ // [...] If P is a reference type, the type referred to by P is used
+ // for type deduction.
+ ParamType = ParamRefType->getPointeeType();
+
+ // [...] If P is of the form T&&, where T is a template parameter, and
+ // the argument is an lvalue, the type A& is used in place of A for
+ // type deduction.
+ if (isa<RValueReferenceType>(ParamRefType) &&
+ ParamRefType->getAsTemplateTypeParmType() &&
+ Args[I]->isLvalue(Context) == Expr::LV_Valid)
+ ArgType = Context.getLValueReferenceType(ArgType);
+ }
+
+ // C++0x [temp.deduct.call]p4:
+ // In general, the deduction process attempts to find template argument
+ // values that will make the deduced A identical to A (after the type A
+ // is transformed as described above). [...]
+ unsigned TDF = 0;
+
+ // - If the original P is a reference type, the deduced A (i.e., the
+ // type referred to by the reference) can be more cv-qualified than
+ // the transformed A.
+ if (ParamWasReference)
+ TDF |= TDF_ParamWithReferenceType;
+ // - The transformed A can be another pointer or pointer to member
+ // type that can be converted to the deduced A via a qualification
+ // conversion (4.4).
+ if (ArgType->isPointerType() || ArgType->isMemberPointerType())
+ TDF |= TDF_IgnoreQualifiers;
+ // - If P is a class and P has the form simple-template-id, then the
+ // transformed A can be a derived class of the deduced A. Likewise,
+ // if P is a pointer to a class of the form simple-template-id, the
+ // transformed A can be a pointer to a derived class pointed to by
+ // the deduced A.
+ if (isSimpleTemplateIdType(ParamType) ||
+ (isa<PointerType>(ParamType) &&
+ isSimpleTemplateIdType(
+ ParamType->getAsPointerType()->getPointeeType())))
+ TDF |= TDF_DerivedClass;
+
+ if (TemplateDeductionResult Result
+ = ::DeduceTemplateArguments(Context, TemplateParams,
+ ParamType, ArgType, Info, Deduced,
+ TDF))
+ return Result;
+
+ // FIXME: C++ [temp.deduct.call] paragraphs 6-9 deal with function
+ // pointer parameters.
}
- if (Trap.hasErrorOccurred())
+ InstantiatingTemplate Inst(*this, FunctionTemplate->getLocation(),
+ FunctionTemplate, Deduced.data(), Deduced.size());
+ if (Inst)
+ return TDK_InstantiationDepth;
+
+ // C++ [temp.deduct.type]p2:
+ // [...] or if any template argument remains neither deduced nor
+ // explicitly specified, template argument deduction fails.
+ TemplateArgumentListBuilder Builder(TemplateParams, Deduced.size());
+ for (unsigned I = 0, N = Deduced.size(); I != N; ++I) {
+ if (Deduced[I].isNull()) {
+ Decl *Param
+ = const_cast<Decl *>(TemplateParams->getParam(I));
+ if (TemplateTypeParmDecl *TTP = dyn_cast<TemplateTypeParmDecl>(Param))
+ Info.Param = TTP;
+ else if (NonTypeTemplateParmDecl *NTTP
+ = dyn_cast<NonTypeTemplateParmDecl>(Param))
+ Info.Param = NTTP;
+ else
+ Info.Param = cast<TemplateTemplateParmDecl>(Param);
+ return TDK_Incomplete;
+ }
+
+ Builder.Append(Deduced[I]);
+ }
+
+ // Form the template argument list from the deduced template arguments.
+ TemplateArgumentList *DeducedArgumentList
+ = new (Context) TemplateArgumentList(Context, Builder, /*TakeArgs=*/true);
+ Info.reset(DeducedArgumentList);
+
+ // Substitute the deduced template arguments into the function template
+ // declaration to produce the function template specialization.
+ Specialization = cast_or_null<FunctionDecl>(
+ InstantiateDecl(FunctionTemplate->getTemplatedDecl(),
+ FunctionTemplate->getDeclContext(),
+ *DeducedArgumentList));
+
+ if (!Specialization || Trap.hasErrorOccurred())
return TDK_SubstitutionFailure;
+ // Turn the specialization into an actual function template specialization.
+ Specialization->setFunctionTemplateSpecialization(Context,
+ FunctionTemplate,
+ Info.take());
return TDK_Success;
}
diff --git a/lib/Sema/SemaTemplateInstantiate.cpp b/lib/Sema/SemaTemplateInstantiate.cpp
index 1c4e907d4d6f..aed348966a4f 100644
--- a/lib/Sema/SemaTemplateInstantiate.cpp
+++ b/lib/Sema/SemaTemplateInstantiate.cpp
@@ -29,10 +29,18 @@ using namespace clang;
/// instantiate the given declaration.
const TemplateArgumentList &
Sema::getTemplateInstantiationArgs(NamedDecl *D) {
+ // Template arguments for a class template specialization.
if (ClassTemplateSpecializationDecl *Spec
= dyn_cast<ClassTemplateSpecializationDecl>(D))
return Spec->getTemplateArgs();
+ // Template arguments for a function template specialization.
+ if (FunctionDecl *Function = dyn_cast<FunctionDecl>(D))
+ if (const TemplateArgumentList *TemplateArgs
+ = Function->getTemplateSpecializationArgs())
+ return *TemplateArgs;
+
+ // Template arguments for a member of a class template specialization.
DeclContext *EnclosingTemplateCtx = D->getDeclContext();
while (!isa<ClassTemplateSpecializationDecl>(EnclosingTemplateCtx)) {
assert(!EnclosingTemplateCtx->isFileContext() &&
@@ -158,8 +166,11 @@ void Sema::PrintInstantiationStack() {
<< Active->InstantiationRange;
} else {
FunctionDecl *Function = cast<FunctionDecl>(D);
- unsigned DiagID = diag::note_template_member_function_here;
- // FIXME: check for a function template
+ unsigned DiagID;
+ if (Function->getPrimaryTemplate())
+ DiagID = diag::note_function_template_spec_here;
+ else
+ DiagID = diag::note_template_member_function_here;
Diags.Report(FullSourceLoc(Active->PointOfInstantiation, SourceMgr),
DiagID)
<< Function
@@ -251,88 +262,82 @@ namespace {
// Declare instantiate functions for each type.
#define TYPE(Class, Base) \
- QualType Instantiate##Class##Type(const Class##Type *T, \
- unsigned Quals) const;
+ QualType Instantiate##Class##Type(const Class##Type *T) const;
#define ABSTRACT_TYPE(Class, Base)
#include "clang/AST/TypeNodes.def"
};
}
QualType
-TemplateTypeInstantiator::InstantiateExtQualType(const ExtQualType *T,
- unsigned Quals) const {
+TemplateTypeInstantiator::InstantiateExtQualType(const ExtQualType *T) const {
// FIXME: Implement this
assert(false && "Cannot instantiate ExtQualType yet");
return QualType();
}
QualType
-TemplateTypeInstantiator::InstantiateBuiltinType(const BuiltinType *T,
- unsigned Quals) const {
+TemplateTypeInstantiator::InstantiateBuiltinType(const BuiltinType *T) const {
assert(false && "Builtin types are not dependent and cannot be instantiated");
- return QualType(T, Quals);
+ return QualType(T, 0);
}
QualType
TemplateTypeInstantiator::
-InstantiateFixedWidthIntType(const FixedWidthIntType *T, unsigned Quals) const {
+InstantiateFixedWidthIntType(const FixedWidthIntType *T) const {
// FIXME: Implement this
assert(false && "Cannot instantiate FixedWidthIntType yet");
return QualType();
}
QualType
-TemplateTypeInstantiator::InstantiateComplexType(const ComplexType *T,
- unsigned Quals) const {
+TemplateTypeInstantiator::InstantiateComplexType(const ComplexType *T) const {
// FIXME: Implement this
assert(false && "Cannot instantiate ComplexType yet");
return QualType();
}
QualType
-TemplateTypeInstantiator::InstantiatePointerType(const PointerType *T,
- unsigned Quals) const {
+TemplateTypeInstantiator::InstantiatePointerType(const PointerType *T) const {
QualType PointeeType = Instantiate(T->getPointeeType());
if (PointeeType.isNull())
return QualType();
- return SemaRef.BuildPointerType(PointeeType, Quals, Loc, Entity);
+ return SemaRef.BuildPointerType(PointeeType, 0, Loc, Entity);
}
QualType
-TemplateTypeInstantiator::InstantiateBlockPointerType(const BlockPointerType *T,
- unsigned Quals) const {
+TemplateTypeInstantiator::InstantiateBlockPointerType(
+ const BlockPointerType *T) const {
QualType PointeeType = Instantiate(T->getPointeeType());
if (PointeeType.isNull())
return QualType();
- return SemaRef.BuildBlockPointerType(PointeeType, Quals, Loc, Entity);
+ return SemaRef.BuildBlockPointerType(PointeeType, 0, Loc, Entity);
}
QualType
TemplateTypeInstantiator::InstantiateLValueReferenceType(
- const LValueReferenceType *T, unsigned Quals) const {
+ const LValueReferenceType *T) const {
QualType ReferentType = Instantiate(T->getPointeeType());
if (ReferentType.isNull())
return QualType();
- return SemaRef.BuildReferenceType(ReferentType, true, Quals, Loc, Entity);
+ return SemaRef.BuildReferenceType(ReferentType, true, 0, Loc, Entity);
}
QualType
TemplateTypeInstantiator::InstantiateRValueReferenceType(
- const RValueReferenceType *T, unsigned Quals) const {
+ const RValueReferenceType *T) const {
QualType ReferentType = Instantiate(T->getPointeeType());
if (ReferentType.isNull())
return QualType();
- return SemaRef.BuildReferenceType(ReferentType, false, Quals, Loc, Entity);
+ return SemaRef.BuildReferenceType(ReferentType, false, 0, Loc, Entity);
}
QualType
TemplateTypeInstantiator::
-InstantiateMemberPointerType(const MemberPointerType *T,
- unsigned Quals) const {
+InstantiateMemberPointerType(const MemberPointerType *T) const {
QualType PointeeType = Instantiate(T->getPointeeType());
if (PointeeType.isNull())
return QualType();
@@ -341,14 +346,13 @@ InstantiateMemberPointerType(const MemberPointerType *T,
if (ClassType.isNull())
return QualType();
- return SemaRef.BuildMemberPointerType(PointeeType, ClassType, Quals, Loc,
+ return SemaRef.BuildMemberPointerType(PointeeType, ClassType, 0, Loc,
Entity);
}
QualType
TemplateTypeInstantiator::
-InstantiateConstantArrayType(const ConstantArrayType *T,
- unsigned Quals) const {
+InstantiateConstantArrayType(const ConstantArrayType *T) const {
QualType ElementType = Instantiate(T->getElementType());
if (ElementType.isNull())
return ElementType;
@@ -383,8 +387,7 @@ InstantiateConstantArrayType(const ConstantArrayType *T,
QualType
TemplateTypeInstantiator::
-InstantiateIncompleteArrayType(const IncompleteArrayType *T,
- unsigned Quals) const {
+InstantiateIncompleteArrayType(const IncompleteArrayType *T) const {
QualType ElementType = Instantiate(T->getElementType());
if (ElementType.isNull())
return ElementType;
@@ -396,8 +399,7 @@ InstantiateIncompleteArrayType(const IncompleteArrayType *T,
QualType
TemplateTypeInstantiator::
-InstantiateVariableArrayType(const VariableArrayType *T,
- unsigned Quals) const {
+InstantiateVariableArrayType(const VariableArrayType *T) const {
// FIXME: Implement this
assert(false && "Cannot instantiate VariableArrayType yet");
return QualType();
@@ -405,8 +407,7 @@ InstantiateVariableArrayType(const VariableArrayType *T,
QualType
TemplateTypeInstantiator::
-InstantiateDependentSizedArrayType(const DependentSizedArrayType *T,
- unsigned Quals) const {
+InstantiateDependentSizedArrayType(const DependentSizedArrayType *T) const {
Expr *ArraySize = T->getSizeExpr();
assert(ArraySize->isValueDependent() &&
"dependent sized array types must have value dependent size expr");
@@ -433,8 +434,8 @@ InstantiateDependentSizedArrayType(const DependentSizedArrayType *T,
QualType
TemplateTypeInstantiator::
-InstantiateDependentSizedExtVectorType(const DependentSizedExtVectorType *T,
- unsigned Quals) const {
+InstantiateDependentSizedExtVectorType(
+ const DependentSizedExtVectorType *T) const {
// Instantiate the element type if needed.
QualType ElementType = T->getElementType();
@@ -462,16 +463,15 @@ InstantiateDependentSizedExtVectorType(const DependentSizedExtVectorType *T,
}
QualType
-TemplateTypeInstantiator::InstantiateVectorType(const VectorType *T,
- unsigned Quals) const {
+TemplateTypeInstantiator::InstantiateVectorType(const VectorType *T) const {
// FIXME: Implement this
assert(false && "Cannot instantiate VectorType yet");
return QualType();
}
QualType
-TemplateTypeInstantiator::InstantiateExtVectorType(const ExtVectorType *T,
- unsigned Quals) const {
+TemplateTypeInstantiator::InstantiateExtVectorType(
+ const ExtVectorType *T) const {
// FIXME: Implement this
assert(false && "Cannot instantiate ExtVectorType yet");
return QualType();
@@ -479,8 +479,7 @@ TemplateTypeInstantiator::InstantiateExtVectorType(const ExtVectorType *T,
QualType
TemplateTypeInstantiator::
-InstantiateFunctionProtoType(const FunctionProtoType *T,
- unsigned Quals) const {
+InstantiateFunctionProtoType(const FunctionProtoType *T) const {
QualType ResultType = Instantiate(T->getResultType());
if (ResultType.isNull())
return ResultType;
@@ -504,15 +503,13 @@ InstantiateFunctionProtoType(const FunctionProtoType *T,
QualType
TemplateTypeInstantiator::
-InstantiateFunctionNoProtoType(const FunctionNoProtoType *T,
- unsigned Quals) const {
+InstantiateFunctionNoProtoType(const FunctionNoProtoType *T) const {
assert(false && "Functions without prototypes cannot be dependent.");
return QualType();
}
QualType
-TemplateTypeInstantiator::InstantiateTypedefType(const TypedefType *T,
- unsigned Quals) const {
+TemplateTypeInstantiator::InstantiateTypedefType(const TypedefType *T) const {
TypedefDecl *Typedef
= cast_or_null<TypedefDecl>(
SemaRef.InstantiateCurrentDeclRef(T->getDecl()));
@@ -523,8 +520,8 @@ TemplateTypeInstantiator::InstantiateTypedefType(const TypedefType *T,
}
QualType
-TemplateTypeInstantiator::InstantiateTypeOfExprType(const TypeOfExprType *T,
- unsigned Quals) const {
+TemplateTypeInstantiator::InstantiateTypeOfExprType(
+ const TypeOfExprType *T) const {
// The expression in a typeof is not potentially evaluated.
EnterExpressionEvaluationContext Unevaluated(SemaRef, Action::Unevaluated);
@@ -537,8 +534,7 @@ TemplateTypeInstantiator::InstantiateTypeOfExprType(const TypeOfExprType *T,
}
QualType
-TemplateTypeInstantiator::InstantiateTypeOfType(const TypeOfType *T,
- unsigned Quals) const {
+TemplateTypeInstantiator::InstantiateTypeOfType(const TypeOfType *T) const {
QualType Underlying = Instantiate(T->getUnderlyingType());
if (Underlying.isNull())
return QualType();
@@ -546,9 +542,24 @@ TemplateTypeInstantiator::InstantiateTypeOfType(const TypeOfType *T,
return SemaRef.Context.getTypeOfType(Underlying);
}
+QualType
+TemplateTypeInstantiator::InstantiateDecltypeType(const DecltypeType *T) const {
+ // C++0x [dcl.type.simple]p4:
+ // The operand of the decltype specifier is an unevaluated operand.
+ EnterExpressionEvaluationContext Unevaluated(SemaRef,
+ Action::Unevaluated);
+
+ Sema::OwningExprResult E
+ = SemaRef.InstantiateExpr(T->getUnderlyingExpr(), TemplateArgs);
+
+ if (E.isInvalid())
+ return QualType();
+
+ return SemaRef.Context.getDecltypeType(E.takeAs<Expr>());
+}
+
QualType
-TemplateTypeInstantiator::InstantiateRecordType(const RecordType *T,
- unsigned Quals) const {
+TemplateTypeInstantiator::InstantiateRecordType(const RecordType *T) const {
RecordDecl *Record
= cast_or_null<RecordDecl>(SemaRef.InstantiateCurrentDeclRef(T->getDecl()));
if (!Record)
@@ -558,8 +569,7 @@ TemplateTypeInstantiator::InstantiateRecordType(const RecordType *T,
}
QualType
-TemplateTypeInstantiator::InstantiateEnumType(const EnumType *T,
- unsigned Quals) const {
+TemplateTypeInstantiator::InstantiateEnumType(const EnumType *T) const {
EnumDecl *Enum
= cast_or_null<EnumDecl>(SemaRef.InstantiateCurrentDeclRef(T->getDecl()));
if (!Enum)
@@ -570,26 +580,13 @@ TemplateTypeInstantiator::InstantiateEnumType(const EnumType *T,
QualType
TemplateTypeInstantiator::
-InstantiateTemplateTypeParmType(const TemplateTypeParmType *T,
- unsigned Quals) const {
+InstantiateTemplateTypeParmType(const TemplateTypeParmType *T) const {
if (T->getDepth() == 0) {
// Replace the template type parameter with its corresponding
// template argument.
assert(TemplateArgs[T->getIndex()].getKind() == TemplateArgument::Type &&
"Template argument kind mismatch");
- QualType Result = TemplateArgs[T->getIndex()].getAsType();
- if (Result.isNull() || !Quals)
- return Result;
-
- // C++ [dcl.ref]p1:
- // [...] Cv-qualified references are ill-formed except when
- // the cv-qualifiers are introduced through the use of a
- // typedef (7.1.3) or of a template type argument (14.3), in
- // which case the cv-qualifiers are ignored.
- if (Quals && Result->isReferenceType())
- Quals = 0;
-
- return QualType(Result.getTypePtr(), Quals | Result.getCVRQualifiers());
+ return TemplateArgs[T->getIndex()].getAsType();
}
// The template type parameter comes from an inner template (e.g.,
@@ -599,15 +596,13 @@ InstantiateTemplateTypeParmType(const TemplateTypeParmType *T,
return SemaRef.Context.getTemplateTypeParmType(T->getDepth() - 1,
T->getIndex(),
T->isParameterPack(),
- T->getName())
- .getQualifiedType(Quals);
+ T->getName());
}
QualType
TemplateTypeInstantiator::
InstantiateTemplateSpecializationType(
- const TemplateSpecializationType *T,
- unsigned Quals) const {
+ const TemplateSpecializationType *T) const {
llvm::SmallVector<TemplateArgument, 4> InstantiatedTemplateArgs;
InstantiatedTemplateArgs.reserve(T->getNumArgs());
for (TemplateSpecializationType::iterator Arg = T->begin(), ArgEnd = T->end();
@@ -633,8 +628,7 @@ InstantiateTemplateSpecializationType(
QualType
TemplateTypeInstantiator::
-InstantiateQualifiedNameType(const QualifiedNameType *T,
- unsigned Quals) const {
+InstantiateQualifiedNameType(const QualifiedNameType *T) const {
// When we instantiated a qualified name type, there's no point in
// keeping the qualification around in the instantiated result. So,
// just instantiate the named type.
@@ -643,14 +637,14 @@ InstantiateQualifiedNameType(const QualifiedNameType *T,
QualType
TemplateTypeInstantiator::
-InstantiateTypenameType(const TypenameType *T, unsigned Quals) const {
+InstantiateTypenameType(const TypenameType *T) const {
if (const TemplateSpecializationType *TemplateId = T->getTemplateId()) {
// When the typename type refers to a template-id, the template-id
// is dependent and has enough information to instantiate the
// result of the typename type. Since we don't care about keeping
// the spelling of the typename type in template instantiations,
// we just instantiate the template-id.
- return InstantiateTemplateSpecializationType(TemplateId, Quals);
+ return InstantiateTemplateSpecializationType(TemplateId);
}
NestedNameSpecifier *NNS
@@ -665,24 +659,22 @@ InstantiateTypenameType(const TypenameType *T, unsigned Quals) const {
QualType
TemplateTypeInstantiator::
-InstantiateObjCObjectPointerType(const ObjCObjectPointerType *T,
- unsigned Quals) const {
+InstantiateObjCObjectPointerType(const ObjCObjectPointerType *T) const {
assert(false && "Objective-C types cannot be dependent");
return QualType();
}
QualType
TemplateTypeInstantiator::
-InstantiateObjCInterfaceType(const ObjCInterfaceType *T,
- unsigned Quals) const {
+InstantiateObjCInterfaceType(const ObjCInterfaceType *T) const {
assert(false && "Objective-C types cannot be dependent");
return QualType();
}
QualType
TemplateTypeInstantiator::
-InstantiateObjCQualifiedInterfaceType(const ObjCQualifiedInterfaceType *T,
- unsigned Quals) const {
+InstantiateObjCQualifiedInterfaceType(
+ const ObjCQualifiedInterfaceType *T) const {
assert(false && "Objective-C types cannot be dependent");
return QualType();
}
@@ -693,17 +685,27 @@ QualType TemplateTypeInstantiator::Instantiate(QualType T) const {
if (!T->isDependentType())
return T;
+ QualType Result;
switch (T->getTypeClass()) {
#define TYPE(Class, Base) \
case Type::Class: \
- return Instantiate##Class##Type(cast<Class##Type>(T.getTypePtr()), \
- T.getCVRQualifiers());
+ Result = Instantiate##Class##Type(cast<Class##Type>(T.getTypePtr())); \
+ break;
#define ABSTRACT_TYPE(Class, Base)
#include "clang/AST/TypeNodes.def"
}
-
- assert(false && "Not all types have been decoded for instantiation");
- return QualType();
+
+ // C++ [dcl.ref]p1:
+ // [...] Cv-qualified references are ill-formed except when
+ // the cv-qualifiers are introduced through the use of a
+ // typedef (7.1.3) or of a template type argument (14.3), in
+ // which case the cv-qualifiers are ignored.
+ //
+ // The same rule applies to function types.
+ if (!Result.isNull() && T.getCVRQualifiers() &&
+ !Result->isFunctionType() && !Result->isReferenceType())
+ Result = Result.getWithAdditionalQualifiers(T.getCVRQualifiers());
+ return Result;
}
/// \brief Instantiate the type T with a given set of template arguments.
diff --git a/lib/Sema/SemaTemplateInstantiateDecl.cpp b/lib/Sema/SemaTemplateInstantiateDecl.cpp
index ece71bc0d326..a05095fa57a6 100644
--- a/lib/Sema/SemaTemplateInstantiateDecl.cpp
+++ b/lib/Sema/SemaTemplateInstantiateDecl.cpp
@@ -44,6 +44,7 @@ namespace {
Decl *VisitStaticAssertDecl(StaticAssertDecl *D);
Decl *VisitEnumDecl(EnumDecl *D);
Decl *VisitEnumConstantDecl(EnumConstantDecl *D);
+ Decl *VisitFunctionDecl(FunctionDecl *D);
Decl *VisitCXXRecordDecl(CXXRecordDecl *D);
Decl *VisitCXXMethodDecl(CXXMethodDecl *D);
Decl *VisitCXXConstructorDecl(CXXConstructorDecl *D);
@@ -61,6 +62,7 @@ namespace {
// Helper functions for instantiating methods.
QualType InstantiateFunctionType(FunctionDecl *D,
llvm::SmallVectorImpl<ParmVarDecl *> &Params);
+ bool InitFunctionInstantiation(FunctionDecl *New, FunctionDecl *Tmpl);
bool InitMethodInstantiation(CXXMethodDecl *New, CXXMethodDecl *Tmpl);
};
}
@@ -291,12 +293,47 @@ Decl *TemplateDeclInstantiator::VisitCXXRecordDecl(CXXRecordDecl *D) {
return Record;
}
-Decl *TemplateDeclInstantiator::VisitCXXMethodDecl(CXXMethodDecl *D) {
- // Only handle actual methods; we'll deal with constructors,
- // destructors, etc. separately.
- if (D->getKind() != Decl::CXXMethod)
+Decl *TemplateDeclInstantiator::VisitFunctionDecl(FunctionDecl *D) {
+ // FIXME: Look for existing specializations (explicit or otherwise).
+
+ Sema::LocalInstantiationScope Scope(SemaRef);
+
+ llvm::SmallVector<ParmVarDecl *, 4> Params;
+ QualType T = InstantiateFunctionType(D, Params);
+ if (T.isNull())
return 0;
+
+ // Build the instantiated method declaration.
+ FunctionDecl *Function
+ = FunctionDecl::Create(SemaRef.Context, Owner, D->getLocation(),
+ D->getDeclName(), T, D->getStorageClass(),
+ D->isInline(), D->hasWrittenPrototype(),
+ D->getTypeSpecStartLoc());
+
+ // FIXME: friend functions
+
+ // Attach the parameters
+ for (unsigned P = 0; P < Params.size(); ++P)
+ Params[P]->setOwningFunction(Function);
+ Function->setParams(SemaRef.Context, Params.data(), Params.size());
+
+ if (InitFunctionInstantiation(Function, D))
+ Function->setInvalidDecl();
+
+ bool Redeclaration = false;
+ bool OverloadableAttrRequired = false;
+ NamedDecl *PrevDecl = 0;
+ SemaRef.CheckFunctionDeclaration(Function, PrevDecl, Redeclaration,
+ /*FIXME:*/OverloadableAttrRequired);
+
+
+ // FIXME: link this to the function template from which it was instantiated.
+
+ return Function;
+}
+Decl *TemplateDeclInstantiator::VisitCXXMethodDecl(CXXMethodDecl *D) {
+ // FIXME: Look for existing, explicit specializations.
Sema::LocalInstantiationScope Scope(SemaRef);
llvm::SmallVector<ParmVarDecl *, 4> Params;
@@ -340,6 +377,7 @@ Decl *TemplateDeclInstantiator::VisitCXXMethodDecl(CXXMethodDecl *D) {
}
Decl *TemplateDeclInstantiator::VisitCXXConstructorDecl(CXXConstructorDecl *D) {
+ // FIXME: Look for existing, explicit specializations.
Sema::LocalInstantiationScope Scope(SemaRef);
llvm::SmallVector<ParmVarDecl *, 4> Params;
@@ -387,6 +425,7 @@ Decl *TemplateDeclInstantiator::VisitCXXConstructorDecl(CXXConstructorDecl *D) {
}
Decl *TemplateDeclInstantiator::VisitCXXDestructorDecl(CXXDestructorDecl *D) {
+ // FIXME: Look for existing, explicit specializations.
Sema::LocalInstantiationScope Scope(SemaRef);
llvm::SmallVector<ParmVarDecl *, 4> Params;
@@ -418,6 +457,7 @@ Decl *TemplateDeclInstantiator::VisitCXXDestructorDecl(CXXDestructorDecl *D) {
}
Decl *TemplateDeclInstantiator::VisitCXXConversionDecl(CXXConversionDecl *D) {
+ // FIXME: Look for existing, explicit specializations.
Sema::LocalInstantiationScope Scope(SemaRef);
llvm::SmallVector<ParmVarDecl *, 4> Params;
@@ -557,6 +597,18 @@ TemplateDeclInstantiator::InstantiateFunctionType(FunctionDecl *D,
D->getLocation(), D->getDeclName());
}
+/// \brief Initializes the common fields of an instantiation function
+/// declaration (New) from the corresponding fields of its template (Tmpl).
+///
+/// \returns true if there was an error
+bool
+TemplateDeclInstantiator::InitFunctionInstantiation(FunctionDecl *New,
+ FunctionDecl *Tmpl) {
+ if (Tmpl->isDeleted())
+ New->setDeleted();
+ return false;
+}
+
/// \brief Initializes common fields of an instantiated method
/// declaration (New) from the corresponding fields of its template
/// (Tmpl).
@@ -565,6 +617,9 @@ TemplateDeclInstantiator::InstantiateFunctionType(FunctionDecl *D,
bool
TemplateDeclInstantiator::InitMethodInstantiation(CXXMethodDecl *New,
CXXMethodDecl *Tmpl) {
+ if (InitFunctionInstantiation(New, Tmpl))
+ return true;
+
CXXRecordDecl *Record = cast<CXXRecordDecl>(Owner);
New->setAccess(Tmpl->getAccess());
if (Tmpl->isVirtualAsWritten()) {
@@ -573,8 +628,6 @@ TemplateDeclInstantiator::InitMethodInstantiation(CXXMethodDecl *New,
Record->setPOD(false);
Record->setPolymorphic(true);
}
- if (Tmpl->isDeleted())
- New->setDeleted();
if (Tmpl->isPure()) {
New->setPure();
Record->setAbstract(true);
@@ -592,16 +645,17 @@ TemplateDeclInstantiator::InitMethodInstantiation(CXXMethodDecl *New,
/// function.
void Sema::InstantiateFunctionDefinition(SourceLocation PointOfInstantiation,
FunctionDecl *Function) {
- // FIXME: make this work for function template specializations, too.
-
if (Function->isInvalidDecl())
return;
assert(!Function->getBody(Context) && "Already instantiated!");
// Find the function body that we'll be substituting.
- const FunctionDecl *PatternDecl
- = Function->getInstantiatedFromMemberFunction();
+ const FunctionDecl *PatternDecl = 0;
+ if (FunctionTemplateDecl *Primary = Function->getPrimaryTemplate())
+ PatternDecl = Primary->getTemplatedDecl();
+ else
+ PatternDecl = Function->getInstantiatedFromMemberFunction();
Stmt *Pattern = 0;
if (PatternDecl)
Pattern = PatternDecl->getBody(Context, PatternDecl);
diff --git a/lib/Sema/SemaTemplateInstantiateExpr.cpp b/lib/Sema/SemaTemplateInstantiateExpr.cpp
index 749fb5894878..65a35f92f7c6 100644
--- a/lib/Sema/SemaTemplateInstantiateExpr.cpp
+++ b/lib/Sema/SemaTemplateInstantiateExpr.cpp
@@ -119,6 +119,14 @@ TemplateExprInstantiator::VisitDeclRefExpr(DeclRefExpr *E) {
// FIXME: Clone the expression!
return SemaRef.Owned(Arg.getAsExpr());
+ if (Arg.getKind() == TemplateArgument::Declaration) {
+ ValueDecl *VD = cast<ValueDecl>(Arg.getAsDecl());
+
+ // FIXME: Can VD ever have a dependent type?
+ return SemaRef.BuildDeclRefExpr(VD, VD->getType(), E->getLocation(),
+ false, false);
+ }
+
assert(Arg.getKind() == TemplateArgument::Integral);
QualType T = Arg.getIntegralType();
if (T->isCharType() || T->isWideCharType())
@@ -400,7 +408,7 @@ TemplateExprInstantiator::VisitCXXOperatorCallExpr(CXXOperatorCallExpr *E) {
F = Overloads->function_begin(),
FEnd = Overloads->function_end();
F != FEnd; ++F)
- Functions.insert(*F);
+ Functions.insert(cast<FunctionDecl>(*F));
// Add any functions found via argument-dependent lookup.
DeclarationName OpName
diff --git a/lib/Sema/SemaType.cpp b/lib/Sema/SemaType.cpp
index 967f650d13b4..c6bcdc36f132 100644
--- a/lib/Sema/SemaType.cpp
+++ b/lib/Sema/SemaType.cpp
@@ -121,16 +121,18 @@ QualType Sema::ConvertDeclSpecToType(const DeclSpec &DS,
if (DeclLoc.isInvalid())
DeclLoc = DS.getSourceRange().getBegin();
- if (getLangOptions().CPlusPlus && !getLangOptions().Microsoft)
+ if (getLangOptions().CPlusPlus && !getLangOptions().Microsoft) {
Diag(DeclLoc, diag::err_missing_type_specifier)
<< DS.getSourceRange();
- else
+
+ // When this occurs in C++ code, often something is very broken with the
+ // value being declared, poison it as invalid so we don't get chains of
+ // errors.
+ isInvalid = true;
+ } else {
Diag(DeclLoc, diag::ext_missing_type_specifier)
<< DS.getSourceRange();
-
- // FIXME: If we could guarantee that the result would be well-formed, it
- // would be useful to have a code insertion hint here. However, after
- // emitting this warning/error, we often emit other errors.
+ }
}
// FALL THROUGH.
@@ -236,6 +238,19 @@ QualType Sema::ConvertDeclSpecToType(const DeclSpec &DS,
Result = Context.getTypeOfExprType(E);
break;
}
+ case DeclSpec::TST_decltype: {
+ Expr *E = static_cast<Expr *>(DS.getTypeRep());
+ assert(E && "Didn't get an expression for decltype?");
+ // TypeQuals handled by caller.
+ Result = Context.getDecltypeType(E);
+ break;
+ }
+ case DeclSpec::TST_auto: {
+ // TypeQuals handled by caller.
+ Result = Context.UndeducedAutoTy;
+ break;
+ }
+
case DeclSpec::TST_error:
Result = Context.IntTy;
isInvalid = true;
@@ -483,6 +498,12 @@ QualType Sema::BuildArrayType(QualType T, ArrayType::ArraySizeModifier ASM,
return QualType();
}
+ if (Context.getCanonicalType(T) == Context.UndeducedAutoTy) {
+ Diag(Loc, diag::err_illegal_decl_array_of_auto)
+ << getPrintableNameForEntity(Entity);
+ return QualType();
+ }
+
if (const RecordType *EltTy = T->getAsRecordType()) {
// If the element type is a struct or union that contains a variadic
// array, accept it as a GNU extension: C99 6.7.2.1p2.
@@ -786,6 +807,52 @@ QualType Sema::GetTypeForDeclarator(Declarator &D, Scope *S, unsigned Skip,
break;
}
+ if (T == Context.UndeducedAutoTy) {
+ int Error = -1;
+
+ switch (D.getContext()) {
+ case Declarator::KNRTypeListContext:
+ assert(0 && "K&R type lists aren't allowed in C++");
+ break;
+ default:
+ printf("context: %d\n", D.getContext());
+ assert(0);
+ case Declarator::PrototypeContext:
+ Error = 0; // Function prototype
+ break;
+ case Declarator::MemberContext:
+ switch (cast<TagDecl>(CurContext)->getTagKind()) {
+ case TagDecl::TK_enum: assert(0 && "unhandled tag kind"); break;
+ case TagDecl::TK_struct: Error = 1; /* Struct member */ break;
+ case TagDecl::TK_union: Error = 2; /* Union member */ break;
+ case TagDecl::TK_class: Error = 3; /* Class member */ break;
+ }
+ break;
+ case Declarator::CXXCatchContext:
+ Error = 4; // Exception declaration
+ break;
+ case Declarator::TemplateParamContext:
+ Error = 5; // Template parameter
+ break;
+ case Declarator::BlockLiteralContext:
+ Error = 6; // Block literal
+ break;
+ case Declarator::FileContext:
+ case Declarator::BlockContext:
+ case Declarator::ForContext:
+ case Declarator::ConditionContext:
+ case Declarator::TypeNameContext:
+ break;
+ }
+
+ if (Error != -1) {
+ Diag(D.getDeclSpec().getTypeSpecTypeLoc(), diag::err_auto_not_allowed)
+ << Error;
+ T = Context.IntTy;
+ D.setInvalidType(true);
+ }
+ }
+
// The name we're declaring, if any.
DeclarationName Name;
if (D.getIdentifier())
diff --git a/test/Analysis/NoReturn.m b/test/Analysis/NoReturn.m
index a43f99bdd79b..5f5ce281a794 100644
--- a/test/Analysis/NoReturn.m
+++ b/test/Analysis/NoReturn.m
@@ -1,5 +1,3 @@
-// RUN: clang-cc -analyze -checker-simple -analyzer-store=basic -analyzer-constraints=basic -verify %s &&
-// RUN: clang-cc -analyze -checker-simple -analyzer-store=basic -analyzer-constraints=range -verify %s &&
// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic -analyzer-constraints=basic -verify %s &&
// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic -analyzer-constraints=range -verify %s &&
// RUN: clang-cc -analyze -checker-cfref -analyzer-store=region -analyzer-constraints=basic -verify %s &&
diff --git a/test/Analysis/ObjCProperties.m b/test/Analysis/ObjCProperties.m
index 7787a1d6ecdc..3ad256914a42 100644
--- a/test/Analysis/ObjCProperties.m
+++ b/test/Analysis/ObjCProperties.m
@@ -1,5 +1,3 @@
-// RUN: clang-cc -analyze -checker-simple -analyzer-store=basic -analyzer-constraints=basic %s -verify &&
-// RUN: clang-cc -analyze -checker-simple -analyzer-store=basic -analyzer-constraints=range %s -verify &&
// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic -analyzer-constraints=basic %s -verify &&
// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic -analyzer-constraints=range %s -verify &&
// RUN: clang-cc -analyze -checker-cfref -analyzer-store=region -analyzer-constraints=basic %s -verify &&
diff --git a/test/Analysis/array-struct.c b/test/Analysis/array-struct.c
index 0ad7ae7e8283..438e1ccf476d 100644
--- a/test/Analysis/array-struct.c
+++ b/test/Analysis/array-struct.c
@@ -1,4 +1,3 @@
-// RUN: clang-cc -analyze -checker-simple -analyzer-store=basic -analyzer-constraints=basic -verify %s &&
// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic -analyzer-constraints=basic -verify %s &&
// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic -analyzer-constraints=range -verify %s
diff --git a/test/Analysis/complex.c b/test/Analysis/complex.c
index f29fc70c4944..cef624577a6d 100644
--- a/test/Analysis/complex.c
+++ b/test/Analysis/complex.c
@@ -1,4 +1,3 @@
-// RUN: clang-cc -analyze -checker-simple -analyzer-store=basic -analyzer-constraints=basic -verify %s &&
// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic -analyzer-constraints=basic -verify %s &&
// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic -analyzer-constraints=range -verify %s &&
// RUN: clang-cc -analyze -checker-cfref -analyzer-store=region -analyzer-constraints=basic -verify %s &&
diff --git a/test/Analysis/dead-stores.c b/test/Analysis/dead-stores.c
index c100344adf6d..6d3b7e6f540d 100644
--- a/test/Analysis/dead-stores.c
+++ b/test/Analysis/dead-stores.c
@@ -1,6 +1,4 @@
// RUN: clang-cc -analyze -warn-dead-stores -verify %s &&
-// RUN: clang-cc -analyze -checker-simple -analyzer-store=basic -analyzer-constraints=basic -warn-dead-stores -verify %s &&
-// RUN: clang-cc -analyze -checker-simple -analyzer-store=basic -analyzer-constraints=range -warn-dead-stores -verify %s &&
// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic -analyzer-constraints=basic -warn-dead-stores -verify %s &&
// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic -analyzer-constraints=range -warn-dead-stores -verify %s &&
// RUN: clang-cc -analyze -checker-cfref -analyzer-store=region -analyzer-constraints=basic -warn-dead-stores -verify %s &&
diff --git a/test/Analysis/elementtype.c b/test/Analysis/elementtype.c
index 10328e69efa2..2bdaad423a39 100644
--- a/test/Analysis/elementtype.c
+++ b/test/Analysis/elementtype.c
@@ -1,4 +1,4 @@
-// RUN: clang-cc -analyze -checker-simple -analyzer-store=region %s
+// RUN: clang-cc -analyze -checker-cfref -analyzer-store=region %s
typedef struct added_obj_st {
int type;
diff --git a/test/Analysis/exercise-ps.c b/test/Analysis/exercise-ps.c
index 08842b1b8dbf..c309349ab3a9 100644
--- a/test/Analysis/exercise-ps.c
+++ b/test/Analysis/exercise-ps.c
@@ -1,4 +1,3 @@
-// RUN: clang-cc -analyze -checker-simple -verify %s &&
// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic -verify %s &&
// RUN: clang-cc -analyze -checker-cfref -analyzer-store=region -verify %s
//
diff --git a/test/Analysis/func.c b/test/Analysis/func.c
index a018d0afc1cc..2b4e7b0db076 100644
--- a/test/Analysis/func.c
+++ b/test/Analysis/func.c
@@ -1,5 +1,3 @@
-// RUN: clang-cc -analyze -checker-simple -verify %s &&
-// RUN: clang-cc -analyze -checker-simple -analyzer-store=region -verify %s &&
// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic -verify %s &&
// RUN: clang-cc -analyze -checker-cfref -analyzer-store=region -verify %s
diff --git a/test/Analysis/null-deref-ps.c b/test/Analysis/null-deref-ps.c
index 09b9c2ffa3b7..6e2074146c30 100644
--- a/test/Analysis/null-deref-ps.c
+++ b/test/Analysis/null-deref-ps.c
@@ -1,7 +1,7 @@
-// RUN: clang-cc -analyze -std=gnu99 -checker-simple -verify %s &&
-// RUN: clang-cc -analyze -std=gnu99 -checker-simple -verify %s -analyzer-constraints=range &&
-// RUN: clang-cc -analyze -std=gnu99 -checker-simple -analyzer-store=region -analyzer-purge-dead=false -verify %s &&
-// RUN: clang-cc -analyze -std=gnu99 -checker-cfref -analyzer-store=region -verify %s
+// RUN: clang-cc -analyze -std=gnu99 -checker-cfref -verify %s -analyzer-constraints=basic -analyzer-store=basic &&
+// RUN: clang-cc -analyze -std=gnu99 -checker-cfref -verify %s -analyzer-constraints=range -analyzer-store=basic &&
+// RUN: clang-cc -analyze -std=gnu99 -checker-cfref -analyzer-store=region -analyzer-constraints=range -analyzer-purge-dead=false -verify %s &&
+// RUN: clang-cc -analyze -std=gnu99 -checker-cfref -analyzer-store=region -analyzer-constraints=range -verify %s
#include<stdint.h>
#include <assert.h>
diff --git a/test/Analysis/outofbound.c b/test/Analysis/outofbound.c
index 953075fe03d7..527a311d2b7d 100644
--- a/test/Analysis/outofbound.c
+++ b/test/Analysis/outofbound.c
@@ -1,4 +1,4 @@
-// RUN: clang-cc -analyze -checker-simple -analyzer-store=region -verify %s
+// RUN: clang-cc -analyze -checker-cfref -analyzer-store=region -verify %s
char f1() {
char* s = "abcd";
diff --git a/test/Analysis/ptr-arith.c b/test/Analysis/ptr-arith.c
index 34840c7b7c58..4f2c7d9edb0b 100644
--- a/test/Analysis/ptr-arith.c
+++ b/test/Analysis/ptr-arith.c
@@ -1,4 +1,3 @@
-// RUN: clang-cc -analyze -checker-simple -analyzer-store=region -verify %s &&
// RUN: clang-cc -analyze -checker-cfref -analyzer-store=region -verify -triple x86_64-apple-darwin9 %s &&
// RUN: clang-cc -analyze -checker-cfref -analyzer-store=region -verify -triple i686-apple-darwin9 %s
diff --git a/test/Analysis/region-only-test.c b/test/Analysis/region-only-test.c
index fdc740488a2c..64d3fcd57b2a 100644
--- a/test/Analysis/region-only-test.c
+++ b/test/Analysis/region-only-test.c
@@ -1,4 +1,4 @@
-// RUN: clang-cc -analyze -checker-simple -analyzer-store=region -verify %s
+// RUN: clang-cc -analyze -checker-cfref -analyzer-store=region -verify %s
// Region store must be enabled for tests in this file.
diff --git a/test/Analysis/stack-addr-ps.c b/test/Analysis/stack-addr-ps.c
index 4bc9a7def2c8..2f7a4bdf7408 100644
--- a/test/Analysis/stack-addr-ps.c
+++ b/test/Analysis/stack-addr-ps.c
@@ -1,4 +1,3 @@
-// RUN: clang-cc -analyze -checker-simple -verify %s &&
// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic -verify %s &&
// RUN: clang-cc -analyze -checker-cfref -analyzer-store=region -verify %s
diff --git a/test/Analysis/uninit-msg-expr.m b/test/Analysis/uninit-msg-expr.m
index 161ab8041de1..5ec878ea3c37 100644
--- a/test/Analysis/uninit-msg-expr.m
+++ b/test/Analysis/uninit-msg-expr.m
@@ -1,4 +1,3 @@
-// RUN: clang-cc -analyze -checker-simple -verify %s &&
// RUN: clang-cc -analyze -checker-cfref -analyzer-store=basic -verify %s &&
// RUN: clang-cc -analyze -checker-cfref -analyzer-store=region -verify %s
diff --git a/test/Analysis/uninit-vals-ps-region.c b/test/Analysis/uninit-vals-ps-region.c
index 6f3762ee10bf..32f787db4aeb 100644
--- a/test/Analysis/uninit-vals-ps-region.c
+++ b/test/Analysis/uninit-vals-ps-region.c
@@ -1,4 +1,4 @@
-// RUN: clang-cc -analyze -checker-simple -analyzer-store=region -verify %s
+// RUN: clang-cc -analyze -checker-cfref -analyzer-store=region -verify %s
struct s {
int data;
diff --git a/test/CXX/class/class.local/p1.cpp b/test/CXX/class/class.local/p1.cpp
new file mode 100644
index 000000000000..8a84f5dbed8a
--- /dev/null
+++ b/test/CXX/class/class.local/p1.cpp
@@ -0,0 +1,18 @@
+// RUN: clang-cc -fsyntax-only -verify %s
+
+int x;
+void f()
+{
+ static int s;
+ int x; // expected-note{{'x' declared here}}
+ extern int g();
+
+ struct local {
+ int g() { return x; } // expected-error{{reference to local variable 'x' declared in enclosed function 'f'}}
+ int h() { return s; }
+ int k() { return :: x; }
+ int l() { return g(); }
+ };
+}
+
+local* p = 0; // expected-error{{unknown type name 'local'}}
diff --git a/test/CXX/class/class.local/p2.cpp b/test/CXX/class/class.local/p2.cpp
new file mode 100644
index 000000000000..854415fe307d
--- /dev/null
+++ b/test/CXX/class/class.local/p2.cpp
@@ -0,0 +1,12 @@
+// RUN: clang-cc -fsyntax-only -verify %s -faccess-control
+
+struct A { };
+
+void f() {
+ struct B : private A {}; // expected-note{{'private' inheritance specifier here}}
+
+ B b;
+
+ A *a = &b; // expected-error{{conversion from 'struct B' to inaccessible base class 'struct A'}} \
+ expected-error{{incompatible type initializing 'struct B *', expected 'struct A *'}}
+}
diff --git a/test/CXX/class/class.local/p3.cpp b/test/CXX/class/class.local/p3.cpp
new file mode 100644
index 000000000000..d888a6d93633
--- /dev/null
+++ b/test/CXX/class/class.local/p3.cpp
@@ -0,0 +1,30 @@
+// RUN: clang-cc -fsyntax-only -verify %s
+
+void f1() {
+ struct X {
+ struct Y;
+ };
+
+ struct X::Y {
+ void f() {}
+ };
+}
+
+void f2() {
+ struct X {
+ struct Y;
+
+ struct Y {
+ void f() {}
+ };
+ };
+}
+
+// A class nested within a local class is a local class.
+void f3(int a) { // expected-note{{'a' declared here}}
+ struct X {
+ struct Y {
+ int f() { return a; } // expected-error{{reference to local variable 'a' declared in enclosed function 'f3'}}
+ };
+ };
+} \ No newline at end of file
diff --git a/test/CXX/class/class.local/p4.cpp b/test/CXX/class/class.local/p4.cpp
new file mode 100644
index 000000000000..40702ad96899
--- /dev/null
+++ b/test/CXX/class/class.local/p4.cpp
@@ -0,0 +1,10 @@
+// RUN: clang-cc -fsyntax-only -verify %s
+
+void f() {
+ struct X {
+ static int a; // expected-error {{static data member 'a' not allowed in local class 'X'}}
+ int b;
+
+ static void f() { }
+ };
+} \ No newline at end of file
diff --git a/test/CXX/class/class.nested.type/p1.cpp b/test/CXX/class/class.nested.type/p1.cpp
new file mode 100644
index 000000000000..33bf4b4473e5
--- /dev/null
+++ b/test/CXX/class/class.nested.type/p1.cpp
@@ -0,0 +1,11 @@
+class X {
+public:
+ typedef int I;
+ class Y { };
+ I a;
+};
+
+I b; // expected-error{{unknown type name 'I'}}
+Y c; // expected-error{{unknown type name 'Y'}}
+X::Y d;
+X::I e; \ No newline at end of file
diff --git a/test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.spec.auto/p2.cpp b/test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.spec.auto/p2.cpp
new file mode 100644
index 000000000000..fa3101c6736c
--- /dev/null
+++ b/test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.spec.auto/p2.cpp
@@ -0,0 +1,13 @@
+// RUN: clang-cc -fsyntax-only -verify %s -std=c++0x
+void f() {
+ auto a = a; // expected-error{{variable 'a' declared with 'auto' type cannot appear in its own initializer}}
+}
+
+struct S { auto a; }; // expected-error{{'auto' not allowed in struct member}}
+
+void f(auto a) // expected-error{{'auto' not allowed in function prototype}}
+{
+ try { } catch (auto a) { } // expected-error{{'auto' not allowed in exception declaration}}
+}
+
+template <auto a = 10> class C { }; // expected-error{{'auto' not allowed in template parameter}}
diff --git a/test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.type.simple/p4-cxx0x.cpp b/test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.type.simple/p4-cxx0x.cpp
new file mode 100644
index 000000000000..d97f2b83d1a7
--- /dev/null
+++ b/test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.type.simple/p4-cxx0x.cpp
@@ -0,0 +1,21 @@
+// RUN: clang-cc -fsyntax-only -std=c++0x -verify %s
+
+template<typename T, typename U>
+struct is_same {
+ static const bool value = false;
+};
+
+template<typename T>
+struct is_same<T, T> {
+ static const bool value = true;
+};
+
+const int&& foo();
+int i;
+struct A { double x; };
+const A* a = new A();
+
+static_assert(is_same<decltype(foo()), const int&&>::value, "");
+static_assert(is_same<decltype(i), int>::value, "");
+static_assert(is_same<decltype(a->x), double>::value, "");
+static_assert(is_same<decltype((a->x)), const double&>::value, "");
diff --git a/test/CXX/dcl.decl/dcl.meaning/dcl.array/p1-cxx0x.cpp b/test/CXX/dcl.decl/dcl.meaning/dcl.array/p1-cxx0x.cpp
new file mode 100644
index 000000000000..9d855349f295
--- /dev/null
+++ b/test/CXX/dcl.decl/dcl.meaning/dcl.array/p1-cxx0x.cpp
@@ -0,0 +1,6 @@
+// RUN: clang-cc -fsyntax-only -verify %s -std=c++0x
+
+void f() {
+ int b[5];
+ auto a[5] = b; // expected-error{{'a' declared as array of 'auto'}}
+}
diff --git a/test/CXX/temp/temp.decls/temp.fct/temp.over.link/p4-neg.cpp b/test/CXX/temp/temp.decls/temp.fct/temp.over.link/p4-neg.cpp
new file mode 100644
index 000000000000..b482955818cb
--- /dev/null
+++ b/test/CXX/temp/temp.decls/temp.fct/temp.over.link/p4-neg.cpp
@@ -0,0 +1,27 @@
+// RUN: clang-cc -fsyntax-only -verify %s
+
+template<typename T> void f0(T) { } // expected-note{{previous}}
+template<class U> void f0(U) { } // expected-error{{redefinition}}
+
+template<int I> void f0() { } // expected-note{{previous}}
+template<int> void f0() { } // expected-error{{redefinition}}
+
+typedef int INT;
+
+template<template<class T, T Value1, INT> class X>
+ void f0() { } // expected-note{{previous}}
+template<template<typename T, T Value1, int> class>
+ void f0() { } // expected-error{{redefinition}}
+
+template<typename T>
+struct MetaFun;
+
+template<typename T>
+ typename MetaFun<T*>::type f0(const T&) { } // expected-note{{previous}}
+template<class U>
+ typename MetaFun<U*>::type f0(const U&) { } // expected-error{{redefinition}}
+
+// FIXME: We need canonicalization of expressions for this to work
+// template<int> struct A { };
+// template<int I> void f0(A<I>) { } // Xpected-note{{previous}}
+// template<int J> void f0(A<J>) { } // Xpected-error{{redefinition}} \ No newline at end of file
diff --git a/test/CXX/temp/temp.decls/temp.fct/temp.over.link/p4.cpp b/test/CXX/temp/temp.decls/temp.fct/temp.over.link/p4.cpp
new file mode 100644
index 000000000000..de1a883bcd7a
--- /dev/null
+++ b/test/CXX/temp/temp.decls/temp.fct/temp.over.link/p4.cpp
@@ -0,0 +1,13 @@
+// RUN: clang-cc -fsyntax-only -verify %s
+
+// All of these function templates are distinct.
+template<typename T> void f0(T) { }
+template<typename T, typename U> void f0(T) { }
+template<typename T, typename U> void f0(U) { }
+void f0();
+template<typename T> void f0(T*);
+void f0(int);
+template<int I> void f0();
+template<typename T> void f0();
+
+
diff --git a/test/CXX/temp/temp.fct.spec/temp.deduct/temp.deduct.call/basic.cpp b/test/CXX/temp/temp.fct.spec/temp.deduct/temp.deduct.call/basic.cpp
new file mode 100644
index 000000000000..beb6aad2c089
--- /dev/null
+++ b/test/CXX/temp/temp.fct.spec/temp.deduct/temp.deduct.call/basic.cpp
@@ -0,0 +1,28 @@
+// RUN: clang-cc -fsyntax-only -verify %s
+
+template<typename T> struct A { };
+
+template<typename T> A<T> f0(T*);
+
+void test_f0(int *ip, float const *cfp) {
+ A<int> a0 = f0(ip);
+ A<const float> a1 = f0(cfp);
+}
+
+template<typename T> void f1(T*, int);
+
+void test_f1(int *ip, float fv) {
+ f1(ip, fv);
+}
+
+template<typename T> void f2(T*, T*);
+
+struct ConvToIntPtr {
+ operator int*() const;
+};
+
+void test_f2(int *ip, float *fp) {
+ f2(ip, ConvToIntPtr()); // expected-error{{no matching function}}
+ f2(ip, ip); // okay
+ f2(ip, fp); // expected-error{{no matching function}}
+}
diff --git a/test/CXX/temp/temp.fct.spec/temp.deduct/temp.deduct.call/p2.cpp b/test/CXX/temp/temp.fct.spec/temp.deduct/temp.deduct.call/p2.cpp
new file mode 100644
index 000000000000..6f27d3636892
--- /dev/null
+++ b/test/CXX/temp/temp.fct.spec/temp.deduct/temp.deduct.call/p2.cpp
@@ -0,0 +1,31 @@
+// RUN: clang-cc -fsyntax-only -verify %s
+template<typename T> struct A { };
+
+// bullet 1
+template<typename T> A<T> f0(T* ptr);
+
+void test_f0_bullet1() {
+ int arr0[6];
+ A<int> a0 = f0(arr0);
+ const int arr1[] = { 1, 2, 3, 4, 5 };
+ A<const int> a1 = f0(arr1);
+}
+
+// bullet 2
+int g0(int, int);
+float g1(float);
+
+void test_f0_bullet2() {
+ A<int(int, int)> a0 = f0(g0);
+ A<float(float)> a1 = f0(g1);
+}
+
+// bullet 3
+struct X { };
+const X get_X();
+
+template<typename T> A<T> f1(T);
+
+void test_f1_bullet3() {
+ A<X> a0 = f1(get_X());
+}
diff --git a/test/CXX/temp/temp.fct.spec/temp.deduct/temp.deduct.call/p3.cpp b/test/CXX/temp/temp.fct.spec/temp.deduct/temp.deduct.call/p3.cpp
new file mode 100644
index 000000000000..c014c663598c
--- /dev/null
+++ b/test/CXX/temp/temp.fct.spec/temp.deduct/temp.deduct.call/p3.cpp
@@ -0,0 +1,60 @@
+// RUN: clang-cc -fsyntax-only %s
+
+template<typename T> struct A { };
+
+// Top-level cv-qualifiers of P's type are ignored for type deduction.
+template<typename T> A<T> f0(const T);
+
+void test_f0(int i, const int ci) {
+ A<int> a0 = f0(i);
+ A<int> a1 = f0(ci);
+}
+
+// If P is a reference type, the type referred to by P is used for type
+// deduction.
+template<typename T> A<T> f1(T&);
+
+void test_f1(int i, const int ci, volatile int vi) {
+ A<int> a0 = f1(i);
+ A<const int> a1 = f1(ci);
+ A<volatile int> a2 = f1(vi);
+}
+
+template<typename T, unsigned N> struct B { };
+template<typename T, unsigned N> B<T, N> g0(T (&array)[N]);
+
+void test_g0() {
+ int array0[5];
+ B<int, 5> b0 = g0(array0);
+ const int array1[] = { 1, 2, 3};
+ B<const int, 3> b1 = g0(array1);
+}
+
+template<typename T> B<T, 0> g1(const A<T>&);
+
+void test_g1(A<float> af) {
+ B<float, 0> b0 = g1(af);
+ B<int, 0> b1 = g1(A<int>());
+}
+
+// - If the original P is a reference type, the deduced A (i.e., the type
+// referred to by the reference) can be more cv-qualified than the
+// transformed A.
+template<typename T> A<T> f2(const T&);
+
+void test_f2(int i, const int ci, volatile int vi) {
+ A<int> a0 = f2(i);
+ A<int> a1 = f2(ci);
+ A<volatile int> a2 = f2(vi);
+}
+
+// - The transformed A can be another pointer or pointer to member type that
+// can be converted to the deduced A via a qualification conversion (4.4).
+template<typename T> A<T> f3(T * * const * const);
+
+void test_f3(int ***ip, volatile int ***vip) {
+ A<int> a0 = f3(ip);
+ A<volatile int> a1 = f3(vip);
+}
+
+// FIXME: the next bullet requires a lot of effort.
diff --git a/test/CodeGen/2009-06-16-inc_test.c b/test/CodeGen/2009-06-16-inc_test.c
index b28f63a1c580..e69de29bb2d1 100644
--- a/test/CodeGen/2009-06-16-inc_test.c
+++ b/test/CodeGen/2009-06-16-inc_test.c
@@ -1,3 +0,0 @@
-// RUN: clang -c -g %s -o /dev/null
-// PR 4228
-#include "2009-06-16-test.c"
diff --git a/test/CodeGen/2009-06-16-test.c b/test/CodeGen/2009-06-16-test.c
index 4189d06812af..e69de29bb2d1 100644
--- a/test/CodeGen/2009-06-16-test.c
+++ b/test/CodeGen/2009-06-16-test.c
@@ -1,15 +0,0 @@
-
-#ifndef TEST
-#define TEST
-#define INSIDE_RECURSION
-#include "2009-06-16-test.c"
-#undef INSIDE_RECURSION
-#endif
-
-#ifndef INSIDE_RECURSION
-int i;
-#endif
-
-#ifdef INSIDE_RECURSION
-int j;
-#endif
diff --git a/test/CodeGenObjC/deadcode_strip_used_var.m b/test/CodeGenObjC/deadcode_strip_used_var.m
new file mode 100644
index 000000000000..444cf766f7dd
--- /dev/null
+++ b/test/CodeGenObjC/deadcode_strip_used_var.m
@@ -0,0 +1,9 @@
+// RUN: clang-cc %s -emit-llvm -o %t -triple i386-apple-darwin10 &&
+// RUN: grep "llvm.used" %t | count 1 &&
+// RUN: clang-cc %s -emit-llvm -o %t -triple x86_64-apple-darwin10 &&
+// RUN: grep "llvm.used" %t | count 1
+
+
+__attribute__((used)) static int XXXXXX __attribute__ ((section ("__DATA,__Xinterpose"))) ;
+__attribute__((used)) static int YYYY __attribute__ ((section ("__DATA,__Xinterpose"))) ;
+
diff --git a/test/Coverage/html-diagnostics.c b/test/Coverage/html-diagnostics.c
index 6144f2fb98a3..e3db1668d836 100644
--- a/test/Coverage/html-diagnostics.c
+++ b/test/Coverage/html-diagnostics.c
@@ -1,5 +1,5 @@
// RUN: rm -rf %t &&
-// RUN: clang-cc --html-diags=%t -checker-simple %s
+// RUN: clang-cc --html-diags=%t -checker-cfref %s
void f0(int x) {
int *p = &x;
diff --git a/test/Index/resolve-loc.c b/test/Index/resolve-loc.c
new file mode 100644
index 000000000000..d04b79b024ed
--- /dev/null
+++ b/test/Index/resolve-loc.c
@@ -0,0 +1,24 @@
+// RUN: clang-cc -emit-pch %s -o %t.ast &&
+// RUN: index-test %t.ast -point-at %s:15:8 | grep top_var &&
+// RUN: index-test %t.ast -point-at %s:17:15 | grep top_func_decl &&
+// RUN: index-test %t.ast -point-at %s:17:25 | grep param1 &&
+// RUN: index-test %t.ast -point-at %s:19:17 | grep top_func_def &&
+// RUN: index-test %t.ast -point-at %s:19:23 | grep param2 &&
+// RUN: index-test %t.ast -point-at %s:20:10 | grep local_var1 &&
+// RUN: index-test %t.ast -point-at %s:21:15 | grep for_var &&
+// RUN: index-test %t.ast -point-at %s:21:43 | grep top_func_def &&
+// RUN: index-test %t.ast -point-at %s:21:43 | grep '++for_var' &&
+// RUN: index-test %t.ast -point-at %s:22:9 | grep local_var2 &&
+// RUN: index-test %t.ast -point-at %s:22:30 | grep local_var2 &&
+// RUN: index-test %t.ast -point-at %s:22:30 | grep 'for_var + 1'
+
+int top_var;
+
+void top_func_decl(int param1);
+
+void top_func_def(int param2) {
+ int local_var1;
+ for (int for_var = 100; for_var < 500; ++for_var) {
+ int local_var2 = for_var + 1;
+ }
+}
diff --git a/test/Parser/check-syntax-1.m b/test/Parser/check-syntax-1.m
index f4aa430cde18..af1b7a8b714a 100644
--- a/test/Parser/check-syntax-1.m
+++ b/test/Parser/check-syntax-1.m
@@ -2,3 +2,10 @@
int @interface bla ; // expected-error {{cannot combine with previous 'int' declaration specifier}}
@end
+
+typedef float CGFloat;
+@interface XNSNumber
++ (XNSNumber *) numberWithCGFloat : (CGFloat) float; // expected-error {{expected identifier}} \
+ // expected-error {{ expected ';' after method prototype}}
+@end
+
diff --git a/test/Parser/cxx-template-decl.cpp b/test/Parser/cxx-template-decl.cpp
index 75b26a98e44e..695501879098 100644
--- a/test/Parser/cxx-template-decl.cpp
+++ b/test/Parser/cxx-template-decl.cpp
@@ -33,11 +33,11 @@ template <typename = int> class X2;
// Forward declarations w/template template parameters
template <template <typename> class T> class TTP1;
template <template <typename> class> class TTP2;
-template <template <typename> class T = foo> class TTP3; // FIXME:expected-error{{template argument for template template parameter must be a template}}
-template <template <typename> class = foo> class TTP3; // FIXME:expected-error{{template argument for template template parameter must be a template}}
+template <template <typename> class T = foo> class TTP3; // expected-error{{must be a class template}}
+template <template <typename> class = foo> class TTP3; // expected-error{{must be a class template}}
template <template <typename X, typename Y> class T> class TTP5;
-// Forward declararations with non-type params
+// Forward declarations with non-type params
template <int> class NTP0;
template <int N> class NTP1;
template <int N = 5> class NTP2;
diff --git a/test/Sema/attr-format_arg.c b/test/Sema/attr-format_arg.c
new file mode 100644
index 000000000000..6f953155f8c8
--- /dev/null
+++ b/test/Sema/attr-format_arg.c
@@ -0,0 +1,11 @@
+#include <stdio.h>
+
+const char* f(const char *s) __attribute__((format_arg(1)));
+
+void g(const char *s) {
+ printf("%d", 123);
+ printf("%d %d", 123); // expected-warning{{more '%' conversions than data arguments}}
+
+ printf(f("%d"), 123);
+ printf(f("%d %d"), 123); // expected-warning{{more '%' conversions than data arguments}}
+}
diff --git a/test/Sema/ext_vector_casts.c b/test/Sema/ext_vector_casts.c
new file mode 100644
index 000000000000..8aa762ebcf2a
--- /dev/null
+++ b/test/Sema/ext_vector_casts.c
@@ -0,0 +1,23 @@
+// RUN: clang-cc -fsyntax-only -verify %s
+
+typedef __attribute__(( ext_vector_type(2) )) float float2;
+typedef __attribute__(( ext_vector_type(4) )) int int4;
+typedef __attribute__(( ext_vector_type(4) )) float float4;
+typedef float t3 __attribute__ ((vector_size (16)));
+
+static void test() {
+ float2 vec2;
+ float4 vec4, vec4_2;
+ int4 ivec4;
+ t3 vec4_3;
+
+ vec4 = (float4)5.0f;
+ vec4 = (float4)5;
+ vec4 = (float4)vec4_3;
+
+ ivec4 = (int4)5.0f;
+ ivec4 = (int4)5;
+ ivec4 = (int4)vec4_3;
+
+ vec4 = (float4)vec2; // expected-error {{invalid conversion between ext-vector type 'float4' and 'float2'}}
+}
diff --git a/test/Sema/ext_vector_components.c b/test/Sema/ext_vector_components.c
index 422a9e6f2287..48903024d3c6 100644
--- a/test/Sema/ext_vector_components.c
+++ b/test/Sema/ext_vector_components.c
@@ -3,11 +3,15 @@
typedef __attribute__(( ext_vector_type(2) )) float float2;
typedef __attribute__(( ext_vector_type(3) )) float float3;
typedef __attribute__(( ext_vector_type(4) )) float float4;
+typedef __attribute__(( ext_vector_type(16) )) float float16;
+
+static float4 vec4_0 = (float4)0.5f;
static void test() {
float2 vec2, vec2_2;
float3 vec3;
float4 vec4, vec4_2, *vec4p;
+ float16 vec16;
float f;
vec2.z; // expected-error {{vector component access exceeds type 'float2'}}
@@ -16,6 +20,7 @@ static void test() {
vec4.xyzc; // expected-error {{illegal vector component name 'c'}}
vec4.s01z; // expected-error {{illegal vector component name 'z'}}
vec2 = vec4.s01; // legal, shorten
+ vec2 = vec4.S01; // legal, shorten
vec3 = vec4.xyz; // legal, shorten
f = vec2.x; // legal, shorten
@@ -32,6 +37,8 @@ static void test() {
vec4 = (float4){ 1,2,3,4 };
vec4.xy.w; // expected-error {{vector component access exceeds type 'float2'}}
vec4.s06; // expected-error {{vector component access exceeds type 'float4'}}
+ vec4.x = vec16.sf;
+ vec4.x = vec16.sF;
vec4p->yz = vec4p->xy;
}
diff --git a/test/Sema/vector-cast.c b/test/Sema/vector-cast.c
index bd09e69800cc..9460cac6d187 100644
--- a/test/Sema/vector-cast.c
+++ b/test/Sema/vector-cast.c
@@ -11,9 +11,9 @@ void f()
t3 v3;
v2 = (t2)v1; // -expected-error {{invalid conversion between vector type \
-'t1' and 't2' of different size}}
- v1 = (t1)v2; // -expected-error {{invalid conversion between vector type \
't2' and 't1' of different size}}
+ v1 = (t1)v2; // -expected-error {{invalid conversion between vector type \
+'t1' and 't2' of different size}}
v3 = (t3)v2;
v1 = (t1)(char *)10; // -expected-error {{invalid conversion between vector \
diff --git a/test/SemaCXX/auto-cxx0x.cpp b/test/SemaCXX/auto-cxx0x.cpp
new file mode 100644
index 000000000000..33156ef23d2e
--- /dev/null
+++ b/test/SemaCXX/auto-cxx0x.cpp
@@ -0,0 +1,5 @@
+// RUN: clang-cc -fsyntax-only -verify %s -std=c++0x
+void f() {
+ auto int a; // expected-error{{cannot combine with previous 'auto' declaration specifier}}
+ int auto b; // expected-error{{cannot combine with previous 'int' declaration specifier}}
+}
diff --git a/test/SemaCXX/auto-cxx98.cpp b/test/SemaCXX/auto-cxx98.cpp
new file mode 100644
index 000000000000..14670cd69942
--- /dev/null
+++ b/test/SemaCXX/auto-cxx98.cpp
@@ -0,0 +1,5 @@
+// RUN: clang-cc -fsyntax-only -verify %s -std=c++98
+void f() {
+ auto int a;
+ int auto b;
+}
diff --git a/test/SemaCXX/basic_lookup_argdep.cpp b/test/SemaCXX/basic_lookup_argdep.cpp
index 486a688d9437..677df8284a72 100644
--- a/test/SemaCXX/basic_lookup_argdep.cpp
+++ b/test/SemaCXX/basic_lookup_argdep.cpp
@@ -58,3 +58,16 @@ namespace M {
void test_operator_name_adl(N::X x) {
(void)operator+(x, x);
}
+
+struct Z { };
+int& f(Z);
+
+namespace O {
+ char &f();
+ void test_global_scope_adl(Z z) {
+ {
+ int& ir = f(z);
+ }
+ }
+}
+
diff --git a/test/SemaCXX/decltype-pr4444.cpp b/test/SemaCXX/decltype-pr4444.cpp
new file mode 100644
index 000000000000..8b2f584d24dd
--- /dev/null
+++ b/test/SemaCXX/decltype-pr4444.cpp
@@ -0,0 +1,6 @@
+// RUN: clang-cc -fsyntax-only -verify %s -std=c++0x
+
+template<typename T, T t>
+struct TestStruct {
+ typedef decltype(t+2) sum_type;
+};
diff --git a/test/SemaCXX/decltype-pr4448.cpp b/test/SemaCXX/decltype-pr4448.cpp
new file mode 100644
index 000000000000..fbf5da1d53ea
--- /dev/null
+++ b/test/SemaCXX/decltype-pr4448.cpp
@@ -0,0 +1,8 @@
+// RUN: clang-cc -fsyntax-only -verify %s -std=c++0x
+
+template< typename T, T t, decltype(t+2) v >
+struct Convoluted {};
+
+int test_array[5];
+
+Convoluted< int *, test_array, nullptr > tarray;
diff --git a/test/SemaCXX/default-assignment-operator.cpp b/test/SemaCXX/default-assignment-operator.cpp
new file mode 100644
index 000000000000..090ba3c3ca80
--- /dev/null
+++ b/test/SemaCXX/default-assignment-operator.cpp
@@ -0,0 +1,74 @@
+// RUN: clang-cc -fsyntax-only -verify %s
+
+class Base { // expected-error {{cannot define the implicit default assignment operator for 'class Base'}} \
+ // expected-note {{synthesized method is first required here}}
+ int &ref; // expected-note {{declared at}}
+};
+
+class X : Base { // // expected-error {{cannot define the implicit default assignment operator for 'class X'}}
+public:
+ X();
+ const int cint; // expected-note {{declared at}}
+};
+
+struct Y : X {
+ Y();
+ Y& operator=(const Y&);
+ Y& operator=(volatile Y&);
+ Y& operator=(const volatile Y&);
+ Y& operator=(Y&);
+};
+
+class Z : Y {};
+
+Z z1;
+Z z2;
+
+// Test1
+void f(X x, const X cx) {
+ x = cx; // expected-note {{synthesized method is first required here}}
+ x = cx;
+ z1 = z2;
+}
+
+// Test2
+class T {};
+T t1;
+T t2;
+
+void g()
+{
+ t1 = t2;
+}
+
+// Test3
+class V {
+public:
+ V();
+ V &operator = (V &b);
+};
+
+class W : V {};
+W w1, w2;
+
+void h()
+{
+ w1 = w2;
+}
+
+// Test4
+
+class B1 {
+public:
+ B1();
+ B1 &operator = (B1 b);
+};
+
+class D1 : B1 {};
+D1 d1, d2;
+
+void i()
+{
+ d1 = d2;
+}
+
diff --git a/test/SemaCXX/nested-name-spec.cpp b/test/SemaCXX/nested-name-spec.cpp
index 4c3ecee09051..8fff8a2b2cbc 100644
--- a/test/SemaCXX/nested-name-spec.cpp
+++ b/test/SemaCXX/nested-name-spec.cpp
@@ -171,3 +171,26 @@ Y::foo y; // expected-error{{incomplete type 'struct Y' named in nested name spe
X::X() : a(5) { } // expected-error{{use of undeclared identifier 'X'}} \
// expected-error{{C++ requires a type specifier for all declarations}} \
// expected-error{{only constructors take base initializers}}
+
+
+
+
+namespace somens {
+ struct a { };
+}
+
+template <typename T>
+class foo {
+};
+
+
+// PR4452
+// FIXME: This error recovery sucks.
+foo<somens:a> a2; // expected-error {{unexpected namespace name 'somens': expected expression}} \
+expected-error {{C++ requires a type specifier for all declarations}}
+
+somens::a a3 = a2;
+
+
+
+
diff --git a/test/SemaCXX/template-specialization.cpp b/test/SemaCXX/template-specialization.cpp
index b3bb08d7e6a2..e23a192d8034 100644
--- a/test/SemaCXX/template-specialization.cpp
+++ b/test/SemaCXX/template-specialization.cpp
@@ -1,4 +1,5 @@
// RUN: clang-cc -fsyntax-only -verify %s
+// XFAIL
template<int N> void f(int (&array)[N]);
template<> void f<1>(int (&array)[1]) { }
diff --git a/test/SemaCXX/using-decl-1.cpp b/test/SemaCXX/using-decl-1.cpp
new file mode 100644
index 000000000000..2459f251deb2
--- /dev/null
+++ b/test/SemaCXX/using-decl-1.cpp
@@ -0,0 +1,8 @@
+// RUN: clang-cc -fsyntax-only -verify %s
+
+extern "C" { void f(bool); }
+
+namespace std {
+ using ::f;
+ inline void f() { return f(true); }
+}
diff --git a/test/SemaCXX/using-decl-pr4441.cpp b/test/SemaCXX/using-decl-pr4441.cpp
new file mode 100644
index 000000000000..6aa2b261e4db
--- /dev/null
+++ b/test/SemaCXX/using-decl-pr4441.cpp
@@ -0,0 +1,8 @@
+// RUN: clang-cc -fsyntax-only -verify %s
+
+namespace A {
+ struct B { };
+ void operator+(B,B);
+}
+
+using A::operator+;
diff --git a/test/SemaCXX/using-decl-pr4450.cpp b/test/SemaCXX/using-decl-pr4450.cpp
new file mode 100644
index 000000000000..c3d5b8300624
--- /dev/null
+++ b/test/SemaCXX/using-decl-pr4450.cpp
@@ -0,0 +1,15 @@
+// RUN: clang-cc -fsyntax-only -verify %s
+
+namespace A {
+ void g();
+}
+
+namespace X {
+ using A::g;
+}
+
+void h()
+{
+ A::g();
+ X::g();
+}
diff --git a/test/SemaTemplate/implicit-instantiation-1.cpp b/test/SemaTemplate/implicit-instantiation-1.cpp
index eecaf2f6c799..b8f9622001e1 100644
--- a/test/SemaTemplate/implicit-instantiation-1.cpp
+++ b/test/SemaTemplate/implicit-instantiation-1.cpp
@@ -1,5 +1,4 @@
// RUN: clang-cc -fsyntax-only -verify %s
-
template<typename T, typename U>
struct X {
T f(T x, U y) { return x + y; }
@@ -14,3 +13,13 @@ void test(X<int, int> *xii, X<int*, int> *xpi, X<int, int*> *xip) {
(void)xip->g(2, 0); // okay: does not instantiate
}
+template<typename T, typename U>
+T add(T t, U u) {
+ return t + u; // expected-error{{invalid operands}}
+}
+
+void test_add(char *cp, int i, int *ip) {
+ char* cp2 = add(cp, i);
+ add(cp, cp); // expected-note{{instantiation of}}
+ (void)sizeof(add(ip, ip));
+} \ No newline at end of file
diff --git a/test/SemaTemplate/operator-template.cpp b/test/SemaTemplate/operator-template.cpp
new file mode 100644
index 000000000000..3d041ec13a32
--- /dev/null
+++ b/test/SemaTemplate/operator-template.cpp
@@ -0,0 +1,14 @@
+// RUN: clang-cc -fsyntax-only -verify %s
+
+// Make sure we accept this
+template<class X>struct A{typedef X Y;};
+template<class X>bool operator==(A<X>,typename A<X>::Y);
+int a(A<int> x) { return operator==(x,1); }
+
+// FIXME: The diagnostic here is a bit messed up
+template<class X>struct B{typedef X Y;};
+template<class X>bool operator==(B<X>*,typename B<X>::Y); // \
+expected-error{{overloaded 'operator==' must have at least one parameter of class or enumeration type}} \
+expected-note{{in instantiation of default argument for 'operator==<int>' required here}}
+int a(B<int> x) { return operator==(&x,1); }
+
diff --git a/test/SemaTemplate/temp_arg_template.cpp b/test/SemaTemplate/temp_arg_template.cpp
index a5e9f75fa77a..f2ee66b3f731 100644
--- a/test/SemaTemplate/temp_arg_template.cpp
+++ b/test/SemaTemplate/temp_arg_template.cpp
@@ -26,12 +26,12 @@ B<X> *a6; // expected-error{{template template argument has different template p
C<Y> *a7;
C<Ylong> *a8; // expected-error{{template template argument has different template parameters than its corresponding template template parameter}}
-template<typename T> void f(int);
+template<typename T> void f(int); // expected-note{{function template}}
// FIXME: we're right to provide an error message, but it should say
// that we need a class template. We won't get this right until name
// lookup of 'f' returns a TemplateDecl.
-A<f> *a9; // expected-error{{template argument for template template parameter must be a template}}
+A<f> *a9; // expected-error{{template argument does not refer to}}
// FIXME: The code below is ill-formed, because of the evil digraph '<:'.
// We should provide a much better error message than we currently do.
diff --git a/test/SemaTemplate/template-decl-fail.cpp b/test/SemaTemplate/template-decl-fail.cpp
new file mode 100644
index 000000000000..b136f6279d52
--- /dev/null
+++ b/test/SemaTemplate/template-decl-fail.cpp
@@ -0,0 +1,3 @@
+// RUN: clang-cc -fsyntax-only -verify %s
+
+template<typename T> typedef T X; // expected-error{{typedef cannot be a template}}
diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt
index 6c66deac03eb..fc30fb848e75 100644
--- a/tools/CMakeLists.txt
+++ b/tools/CMakeLists.txt
@@ -1,2 +1,3 @@
add_subdirectory(clang-cc)
add_subdirectory(driver)
+add_subdirectory(index-test)
diff --git a/tools/Makefile b/tools/Makefile
index 43124ba47cc5..5b49cc8ad0d1 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -8,6 +8,6 @@
##===----------------------------------------------------------------------===##
LEVEL := ../../..
-DIRS := clang-cc driver
+DIRS := clang-cc driver index-test
include $(LEVEL)/Makefile.common
diff --git a/tools/clang-cc/CMakeLists.txt b/tools/clang-cc/CMakeLists.txt
index ec2ea3d62909..e224d40f6c8c 100644
--- a/tools/clang-cc/CMakeLists.txt
+++ b/tools/clang-cc/CMakeLists.txt
@@ -24,3 +24,4 @@ set( LLVM_LINK_COMPONENTS
add_clang_executable(clang-cc
clang-cc.cpp
)
+add_dependencies(clang-cc clang-headers)
diff --git a/tools/clang-cc/clang-cc.cpp b/tools/clang-cc/clang-cc.cpp
index 39d839e4d8f2..a3ffb48281d1 100644
--- a/tools/clang-cc/clang-cc.cpp
+++ b/tools/clang-cc/clang-cc.cpp
@@ -33,6 +33,7 @@
#include "clang/Frontend/PCHReader.h"
#include "clang/Frontend/TextDiagnosticBuffer.h"
#include "clang/Frontend/TextDiagnosticPrinter.h"
+#include "clang/Frontend/CommandLineSourceLoc.h"
#include "clang/Frontend/Utils.h"
#include "clang/Analysis/PathDiagnostic.h"
#include "clang/CodeGen/ModuleBuilder.h"
@@ -79,85 +80,19 @@ using namespace clang;
// Source Location Parser
//===----------------------------------------------------------------------===//
-/// \brief A source location that has been parsed on the command line.
-struct ParsedSourceLocation {
- std::string FileName;
- unsigned Line;
- unsigned Column;
-
- /// \brief Try to resolve the file name of a parsed source location.
- ///
- /// \returns true if there was an error, false otherwise.
- bool ResolveLocation(FileManager &FileMgr, RequestedSourceLocation &Result);
-};
-
-bool
-ParsedSourceLocation::ResolveLocation(FileManager &FileMgr,
- RequestedSourceLocation &Result) {
- const FileEntry *File = FileMgr.getFile(FileName);
+static bool ResolveParsedLocation(ParsedSourceLocation &ParsedLoc,
+ FileManager &FileMgr,
+ RequestedSourceLocation &Result) {
+ const FileEntry *File = FileMgr.getFile(ParsedLoc.FileName);
if (!File)
return true;
Result.File = File;
- Result.Line = Line;
- Result.Column = Column;
+ Result.Line = ParsedLoc.Line;
+ Result.Column = ParsedLoc.Column;
return false;
}
-namespace llvm {
- namespace cl {
- /// \brief Command-line option parser that parses source locations.
- ///
- /// Source locations are of the form filename:line:column.
- template<>
- class parser<ParsedSourceLocation>
- : public basic_parser<ParsedSourceLocation> {
- public:
- bool parse(Option &O, const char *ArgName,
- const std::string &ArgValue,
- ParsedSourceLocation &Val);
- };
-
- bool
- parser<ParsedSourceLocation>::
- parse(Option &O, const char *ArgName, const std::string &ArgValue,
- ParsedSourceLocation &Val) {
- using namespace clang;
-
- const char *ExpectedFormat
- = "source location must be of the form filename:line:column";
- std::string::size_type SecondColon = ArgValue.rfind(':');
- if (SecondColon == std::string::npos) {
- std::fprintf(stderr, "%s\n", ExpectedFormat);
- return true;
- }
- char *EndPtr;
- long Column
- = std::strtol(ArgValue.c_str() + SecondColon + 1, &EndPtr, 10);
- if (EndPtr != ArgValue.c_str() + ArgValue.size()) {
- std::fprintf(stderr, "%s\n", ExpectedFormat);
- return true;
- }
-
- std::string::size_type FirstColon = ArgValue.rfind(':', SecondColon-1);
- if (FirstColon == std::string::npos) {
- std::fprintf(stderr, "%s\n", ExpectedFormat);
- return true;
- }
- long Line = std::strtol(ArgValue.c_str() + FirstColon + 1, &EndPtr, 10);
- if (EndPtr != ArgValue.c_str() + SecondColon) {
- std::fprintf(stderr, "%s\n", ExpectedFormat);
- return true;
- }
-
- Val.FileName = ArgValue.substr(0, FirstColon);
- Val.Line = Line;
- Val.Column = Column;
- return false;
- }
- }
-}
-
//===----------------------------------------------------------------------===//
// Global options.
//===----------------------------------------------------------------------===//
@@ -380,13 +315,15 @@ enum LangKind {
langkind_objc,
langkind_objc_cpp,
langkind_objcxx,
- langkind_objcxx_cpp
+ langkind_objcxx_cpp,
+ langkind_ocl
};
static llvm::cl::opt<LangKind>
BaseLang("x", llvm::cl::desc("Base language to compile"),
llvm::cl::init(langkind_unspecified),
llvm::cl::values(clEnumValN(langkind_c, "c", "C"),
+ clEnumValN(langkind_ocl, "cl", "OpenCL C"),
clEnumValN(langkind_cxx, "c++", "C++"),
clEnumValN(langkind_objc, "objective-c", "Objective C"),
clEnumValN(langkind_objcxx,"objective-c++","Objective C++"),
@@ -497,6 +434,8 @@ static LangKind GetLanguage(const std::string &Filename) {
else if (Ext == "C" || Ext == "cc" || Ext == "cpp" || Ext == "CPP" ||
Ext == "c++" || Ext == "cp" || Ext == "cxx")
return langkind_cxx;
+ else if (Ext == "cl")
+ return langkind_ocl;
else
return langkind_c;
}
@@ -545,6 +484,12 @@ static void InitializeLangOptions(LangOptions &Options, LangKind LK){
Options.ObjC1 = Options.ObjC2 = 1;
Options.CPlusPlus = 1;
break;
+ case langkind_ocl:
+ Options.OpenCL = 1;
+ Options.AltiVec = 1;
+ Options.CXXOperatorNames = 1;
+ Options.LaxVectorConversions = 1;
+ break;
}
if (ObjCExclusiveGC)
@@ -729,6 +674,9 @@ static void InitializeLanguageStandard(LangOptions &Options, LangKind LK,
// Based on the base language, pick one.
switch (LK) {
case lang_unspecified: assert(0 && "Unknown base language");
+ case langkind_ocl:
+ LangStd = lang_c99;
+ break;
case langkind_c:
case langkind_asm_cpp:
case langkind_c_cpp:
@@ -1687,7 +1635,7 @@ public:
PrintSourceRangeInfo,
PrintDiagnosticOption,
!NoDiagnosticsFixIt,
- MessageLength));
+ MessageLength));
}
virtual void setLangOptions(const LangOptions *LO) {
@@ -1979,8 +1927,8 @@ static void ProcessInputFile(Preprocessor &PP, PreprocessorFactory &PPF,
for (unsigned Idx = 0, Last = FixItAtLocations.size();
Idx != Last; ++Idx) {
RequestedSourceLocation Requested;
- if (FixItAtLocations[Idx].ResolveLocation(PP.getFileManager(),
- Requested)) {
+ if (ResolveParsedLocation(FixItAtLocations[Idx],
+ PP.getFileManager(), Requested)) {
fprintf(stderr, "FIX-IT could not find file \"%s\"\n",
FixItAtLocations[Idx].FileName.c_str());
} else {
diff --git a/tools/index-test/CMakeLists.txt b/tools/index-test/CMakeLists.txt
new file mode 100644
index 000000000000..09f4fc12c1dd
--- /dev/null
+++ b/tools/index-test/CMakeLists.txt
@@ -0,0 +1,17 @@
+set(LLVM_NO_RTTI 1)
+
+set( LLVM_USED_LIBS
+ clangFrontend
+ clangSema
+ clangAST
+ clangLex
+ clangBasic
+ )
+
+set( LLVM_LINK_COMPONENTS
+ bitreader
+ )
+
+add_clang_executable(index-test
+ index-test.cpp
+ )
diff --git a/tools/index-test/Makefile b/tools/index-test/Makefile
new file mode 100644
index 000000000000..4fbde291980a
--- /dev/null
+++ b/tools/index-test/Makefile
@@ -0,0 +1,23 @@
+##===- tools/index-test/Makefile ---------------------------*- Makefile -*-===##
+#
+# The LLVM Compiler Infrastructure
+#
+# This file is distributed under the University of Illinois Open Source
+# License. See LICENSE.TXT for details.
+#
+##===----------------------------------------------------------------------===##
+LEVEL = ../../../..
+
+TOOLNAME = index-test
+CPPFLAGS += -I$(PROJ_SRC_DIR)/../../include -I$(PROJ_OBJ_DIR)/../../include
+CXXFLAGS = -fno-rtti
+
+# No plugins, optimize startup time.
+TOOL_NO_EXPORTS = 1
+
+include $(LEVEL)/Makefile.config
+
+LINK_COMPONENTS := bitreader
+USEDLIBS = clangFrontend.a clangSema.a clangAST.a clangLex.a clangBasic.a
+
+include $(LLVM_SRC_ROOT)/Makefile.rules
diff --git a/tools/index-test/index-test.cpp b/tools/index-test/index-test.cpp
new file mode 100644
index 000000000000..5606e7576690
--- /dev/null
+++ b/tools/index-test/index-test.cpp
@@ -0,0 +1,150 @@
+//===--- index-test.cpp - Indexing test bed -------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This utility may be invoked in the following manner:
+// index-test --help - Output help info.
+// index-test [options] - Read from stdin.
+// index-test [options] file - Read from "file".
+// index-test [options] file1 file2 - Read these files.
+//
+// Files must be AST files.
+//
+//===----------------------------------------------------------------------===//
+//
+// -point-at [file:column:line]
+// Point at a declaration/statement/expression. If no other operation is
+// specified, prints some info about it.
+//
+//===----------------------------------------------------------------------===//
+
+#include "clang/Frontend/ASTUnit.h"
+#include "clang/Frontend/Utils.h"
+#include "clang/Frontend/CommandLineSourceLoc.h"
+#include "clang/AST/Decl.h"
+#include "clang/AST/Stmt.h"
+#include "clang/Basic/FileManager.h"
+#include "clang/Basic/SourceManager.h"
+#include "llvm/ADT/STLExtras.h"
+#include "llvm/Support/CommandLine.h"
+#include "llvm/Support/ManagedStatic.h"
+#include "llvm/Support/PrettyStackTrace.h"
+#include "llvm/Support/raw_ostream.h"
+#include "llvm/System/Signals.h"
+using namespace clang;
+
+
+static llvm::cl::list<ParsedSourceLocation>
+PointAtLocation("point-at", llvm::cl::Optional,
+ llvm::cl::value_desc("source-location"),
+ llvm::cl::desc("Point at the given source location of the first AST file"));
+
+static llvm::cl::opt<bool>
+DisableFree("disable-free",
+ llvm::cl::desc("Disable freeing of memory on exit"),
+ llvm::cl::init(false));
+
+static llvm::cl::list<std::string>
+InputFilenames(llvm::cl::Positional, llvm::cl::desc("<input AST files>"));
+
+int main(int argc, char **argv) {
+ llvm::sys::PrintStackTraceOnErrorSignal();
+ llvm::PrettyStackTraceProgram X(argc, argv);
+ llvm::cl::ParseCommandLineOptions(argc, argv,
+ "LLVM 'Clang' Indexing Test Bed: http://clang.llvm.org\n");
+
+ FileManager FileMgr;
+
+ // If no input was specified, read from stdin.
+ if (InputFilenames.empty())
+ InputFilenames.push_back("-");
+
+ // FIXME: Only the first AST file is used for now.
+
+ const std::string &InFile = InputFilenames[0];
+
+ std::string ErrMsg;
+ llvm::OwningPtr<ASTUnit> AST;
+
+ AST.reset(ASTUnit::LoadFromPCHFile(InFile, FileMgr, &ErrMsg));
+ if (!AST) {
+ llvm::errs() << "[" << InFile << "] Error: " << ErrMsg << '\n';
+ return 1;
+ }
+
+ struct ASTPoint {
+ Decl *D;
+ Stmt *Node;
+ ASTPoint() : D(0), Node(0) {}
+ };
+
+ ASTPoint Point;
+
+ if (!PointAtLocation.empty()) {
+ const std::string &Filename = PointAtLocation[0].FileName;
+ const FileEntry *File = FileMgr.getFile(Filename);
+
+ // Safety check. Using an out-of-date AST file will only lead to crashes
+ // or incorrect results.
+ // FIXME: Check all the source files that make up the AST file.
+ const FileEntry *ASTFile = FileMgr.getFile(InFile);
+ if (File->getModificationTime() > ASTFile->getModificationTime()) {
+ llvm::errs() << "[" << InFile << "] Error: " <<
+ "Pointing at a source file which was modified after creating "
+ "the AST file\n";
+ return 1;
+ }
+
+ if (File == 0) {
+ llvm::errs() << "File '" << Filename << "' does not exist\n";
+ return 1;
+ }
+ unsigned Line = PointAtLocation[0].Line;
+ unsigned Col = PointAtLocation[0].Column;
+
+ SourceLocation Loc = AST->getSourceManager().getLocation(File, Line, Col);
+ if (Loc.isInvalid()) {
+ llvm::errs() << "[" << InFile << "] Error: " <<
+ "Couldn't resolve source location (invalid location)\n";
+ return 1;
+ }
+
+ llvm::tie(Point.D, Point.Node) =
+ ResolveLocationInAST(AST->getASTContext(), Loc);
+ if (Point.D == 0) {
+ llvm::errs() << "[" << InFile << "] Error: " <<
+ "Couldn't resolve source location (no declaration found)\n";
+ return 1;
+ }
+ }
+
+ if (Point.D) {
+ llvm::raw_ostream &OS = llvm::outs();
+ assert(Point.D && "If no node was found we should have exited with error");
+ OS << "Declaration node at point: " << Point.D->getDeclKindName() << " ";
+ if (NamedDecl *ND = dyn_cast<NamedDecl>(Point.D))
+ OS << ND->getNameAsString();
+ OS << "\n";
+
+ if (Point.Node) {
+ OS << "Statement node at point: " << Point.Node->getStmtClassName()
+ << " ";
+ Point.Node->printPretty(OS, AST->getASTContext());
+ OS << "\n";
+ }
+ }
+
+ if (DisableFree)
+ AST.take();
+
+ // Managed static deconstruction. Useful for making things like
+ // -time-passes usable.
+ llvm::llvm_shutdown();
+
+ return 0;
+}
diff --git a/www/analyzer/annotations.html b/www/analyzer/annotations.html
index 129748e9b0cc..e49c327edd28 100644
--- a/www/analyzer/annotations.html
+++ b/www/analyzer/annotations.html
@@ -90,14 +90,13 @@ int foo(int *p, int *q) {
return !p ? bar(q, 2, p)
: bar(p, 2, q);
}
-
-<span class="command">$ clang --analyze test.m</span>
-test.m:4:16: warning: Null pointer passed as an argument to a 'nonnull' parameter
- return !p ? bar(q, 2, p)
- ^ ~
-1 diagnostic generated.
</pre>
+<p>Running <tt>scan-build</tt> over this source produces the following
+output:</p>
+
+<img src="images/example_attribute_nonnull.png">
+
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<h2 id="macosx">Mac OS X API Annotations</h2>
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
@@ -174,15 +173,12 @@ use 'cf_returns_retained'.</p>
return [[NSString alloc] initWithCString:"flag a leak"];
}
@end
-
-<span class="command">$ clang --analyze test.m</span>
-$ clang --analyze test.m
-test.m:21:10: warning: Potential leak of an object allocated on line 21
- return [[NSString alloc] initWithCString:"flag a leak"];
- ^
-1 diagnostic generated.
</pre>
+<p>Running <tt>scan-build</tt> on this source file produces the following output:</p>
+
+<img src="images/example_ns_returns_retained.png">
+
<h4 id="attr_cf_returns_retained">Attribute 'cf_returns_retained'
(Clang-specific)</h4>
@@ -262,22 +258,20 @@ CFDateRef returnsRetainedCFDate() {
return (NSDate*) returnsRetainedCFDate(); // Report a leak when using GC.
}
@end
+</pre>
-<span class="command">$ clang --analyze test.m</span>
-test.m:28:20: warning: Potential leak of an object allocated on line 28
- return (NSDate*) returnsRetainedCFDate(); // Always report a leak.
- ^
-1 diagnostic generated.
+<p>Running <tt>scan-build</tt> on this example produces the following output:</p>
-<span class="command">$ clang --analyze test.m <span class="code_highlight">-fobjc-gc-only</span></span>
-test.m:28:20: warning: Potential leak (when using garbage collection) of an object allocated on line 28
- return (NSDate*) returnsRetainedCFDate(); // Always report a leak.
- ^
-test.m:32:20: warning: Potential leak (when using garbage collection) of an object allocated on line 32
- return (NSDate*) returnsRetainedCFDate(); // Report a leak when using GC.
- ^
-2 diagnostics generated.
-</pre>
+<img src="images/example_cf_returns_retained.png">
+
+</p>When the above code is compiled using Objective-C garbage collection (i.e.,
+code is compiled with the flag <tt>-fobjc-gc</tt> or <tt>-fobjc-gc-only</tt>),
+<tt>scan-build</tt> produces both the above error (with slightly different text
+to indicate the code uses garbage collection) as well as the following warning,
+which indicates a leak that occurs <em>only</em> when using garbage
+collection:</p>
+
+<img src="images/example_cf_returns_retained_gc.png">
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<h2 id="custom_assertions">Custom Assertion Handlers</h2>
diff --git a/www/analyzer/images/example_attribute_nonnull.png b/www/analyzer/images/example_attribute_nonnull.png
new file mode 100644
index 000000000000..919af6174291
--- /dev/null
+++ b/www/analyzer/images/example_attribute_nonnull.png
Binary files differ
diff --git a/www/analyzer/images/example_cf_returns_retained.png b/www/analyzer/images/example_cf_returns_retained.png
new file mode 100644
index 000000000000..4bee49945ef1
--- /dev/null
+++ b/www/analyzer/images/example_cf_returns_retained.png
Binary files differ
diff --git a/www/analyzer/images/example_cf_returns_retained_gc.png b/www/analyzer/images/example_cf_returns_retained_gc.png
new file mode 100644
index 000000000000..023f1a2f20cb
--- /dev/null
+++ b/www/analyzer/images/example_cf_returns_retained_gc.png
Binary files differ
diff --git a/www/analyzer/images/example_ns_returns_retained.png b/www/analyzer/images/example_ns_returns_retained.png
new file mode 100644
index 000000000000..61316e19fee2
--- /dev/null
+++ b/www/analyzer/images/example_ns_returns_retained.png
Binary files differ
diff --git a/www/analyzer/scan-build.html b/www/analyzer/scan-build.html
index 5bd5319e8d0b..92a4c3e5e93b 100644
--- a/www/analyzer/scan-build.html
+++ b/www/analyzer/scan-build.html
@@ -32,16 +32,9 @@
<h1>Running the Analyzer</h1>
<p>While the static analyzer engine can be used as a library, many users will
-likely use the command-line interface to the analyzer to analyze projects. There
-are essentially two commands one can use the run the analyzer:</p>
-
-<ul>
-<li><b>scan-build</b>: The <tt>scan-build</tt> command can be used to analyze
-an entire project.</li>
-<li><b>clang</b>: The <tt>clang</tt> command is both Clang's compiler and
-static analysis driver. This can be used both to compile and analyze
-individual source files.
-</ul>
+likely use the command-line interface to the analyzer to analyze projects. This
+page documents <tt>scan-build</tt>, a program that users can use from the
+command line to analyze all the source files used to build a project.</p>
<h3>Contents</h3>
diff --git a/www/comparison.html b/www/comparison.html
index 0bfff127201b..f86ea7fbbd4f 100644
--- a/www/comparison.html
+++ b/www/comparison.html
@@ -136,9 +136,9 @@
<ul>
<li>The Elsa community is extremely small and major development work seems
- to have ceased in 2005, though it continues to be used by other small
- projects
- (e.g. Oink). Clang has a vibrant community including developers that
+ to have ceased in 2005. Work continued to be used by other small
+ projects (e.g. Oink), but Oink is apparently dead now too. Clang has a
+ vibrant community including developers that
are paid to work on it full time. In practice this means that you can
file bugs against Clang and they will often be fixed for you. If you
use Elsa, you are (mostly) on your own for bug fixes and feature
diff --git a/www/cxx_status.html b/www/cxx_status.html
index 5f924fc4873d..19d3a5c7dbe8 100644
--- a/www/cxx_status.html
+++ b/www/cxx_status.html
@@ -1328,17 +1328,17 @@ welcome!</p>
</tr>
<tr>
<td>&nbsp;&nbsp;9.8 [class.local]</td>
- <td class="complete" align="center"></td>
- <td class="medium"></td>
- <td class="broken"></td>
- <td class="broken"></td>
+ <td class="complete" align="center">&#x2713;</td>
+ <td class="complete" align="center">&#x2713;</td>
+ <td class="complete" align="center">&#x2713;</td>
+ <td class="na" align="center">N/A</td>
<td></td>
</tr>
<tr>
<td>&nbsp;&nbsp;9.9 [class.nested.type]</td>
- <td class="complete" align="center"></td>
- <td class="complete" align="center"></td>
- <td class="complete" align="center"></td>
+ <td class="complete" align="center">&#x2713;</td>
+ <td class="complete" align="center">&#x2713;</td>
+ <td class="complete" align="center">&#x2713;</td>
<td class="na" align="center">N/A</td>
<td></td>
</tr>
@@ -1917,17 +1917,17 @@ welcome!</p>
</tr>
<tr>
<td>&nbsp;&nbsp;&nbsp;&nbsp;14.5.5 [temp.fct]</td>
- <td class="basic" align="center"></td>
- <td class="broken" align="center"></td>
- <td class="broken" align="center"></td>
+ <td class="medium" align="center"></td>
+ <td class="medium" align="center"></td>
+ <td class="medium" align="center"></td>
<td class="broken" align="center"></td>
<td></td>
</tr>
<tr>
<td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;14.5.5.1 [temp.over.link]</td>
- <td class="broken" align="center"></td>
- <td class="broken" align="center"></td>
- <td class="broken" align="center"></td>
+ <td class="na" align="center"></td>
+ <td class="complete" align="center"></td>
+ <td class="medium" align="center"></td>
<td class="na" align="center">N/A</td>
<td></td>
</tr>
@@ -2014,10 +2014,10 @@ welcome!</p>
<tr>
<td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;14.6.4.1 [temp.point]</td>
<td class="na" align="center">N/A</td>
- <td class="broken" align="center"></td>
- <td class="broken" align="center"></td>
- <td class="na" align="center"></td>
- <td>Only class templates are instantiated</td>
+ <td class="basic" align="center"></td>
+ <td class="basic" align="center"></td>
+ <td class="basic" align="center"></td>
+ <td></td>
</tr>
<tr>
<td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;14.6.4.2 [temp.dep.candidate]</td>
@@ -2077,9 +2077,9 @@ welcome!</p>
</tr>
<tr>
<td>&nbsp;&nbsp;&nbsp;&nbsp;14.8.1 [temp.arg.explicit]</td>
- <td class="broken" align="center"></td>
- <td class="broken" align="center"></td>
- <td class="broken" align="center"></td>
+ <td class="basic" align="center"></td>
+ <td class="basic" align="center"></td>
+ <td class="basic" align="center"></td>
<td class="broken" align="center"></td>
<td></td>
</tr>
@@ -2094,9 +2094,9 @@ welcome!</p>
<tr>
<td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;14.8.2.1 [temp.deduct.call]</td>
<td class="broken" align="center"></td>
- <td class="broken" align="center"></td>
- <td class="broken" align="center"></td>
- <td class="broken" align="center"></td>
+ <td class="complete" align="center"></td>
+ <td class="basic" align="center"></td>
+ <td class="na" align="center"></td>
<td></td>
</tr>
<tr>
@@ -2320,6 +2320,14 @@ welcome!</p>
<td class="na">N/A</td>
<td></td>
</tr>
+<tr>
+ <td>Decltype (<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2343.pdf">N2343</a>)</td>
+ <td class="complete" align="center">&#x2713;</td>
+ <td class="complete" align="center">&#x2713;</td>
+ <td class="complete" align="center">&#x2713;</td>
+ <td class="na">N/A</td>
+ <td></td>
+</tr>
</table>
<br />
</div>
diff --git a/www/performance-2009-03-02.html b/www/performance-2009-03-02.html
new file mode 100644
index 000000000000..f76fc7a0094d
--- /dev/null
+++ b/www/performance-2009-03-02.html
@@ -0,0 +1,112 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+ "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head>
+ <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+ <title>Clang - Performance</title>
+ <link type="text/css" rel="stylesheet" href="menu.css" />
+ <link type="text/css" rel="stylesheet" href="content.css" />
+ <style type="text/css">
+</style>
+</head>
+<body>
+
+<!--#include virtual="menu.html.incl"-->
+
+<div id="content">
+
+<!--*************************************************************************-->
+<h1>Clang - Performance</h1>
+<!--*************************************************************************-->
+
+<p>This page shows the compile time performance of Clang on two
+interesting benchmarks:
+<ul>
+ <li><i>Sketch</i>: The Objective-C example application shipped on
+ Mac OS X as part of Xcode. <i>Sketch</i> is indicative of a
+ "typical" Objective-C app. The source itself has a relatively
+ small amount of code (~7,500 lines of source code), but it relies
+ on the extensive Cocoa APIs to build its functionality. Like many
+ Objective-C applications, it includes <tt>Cocoa/Cocoa.h</tt> in
+ all of its source files, which represents a significant stress
+ test of the front-end's performance on lexing, preprocessing,
+ parsing, and syntax analysis.</li>
+ <li><i>176.gcc</i>: This is the gcc-2.7.2.2 code base as present in
+ SPECINT 2000. In contrast to Sketch, <i>176.gcc</i> consists of a
+ large amount of C source code (~200,000 lines) with few system
+ dependencies. This stresses the back-end's performance on generating
+ assembly code and debug information.</li>
+</ul>
+</p>
+
+<p>
+For previous performance numbers, please
+go <a href="performance-2008-10-31.html">here</a>.
+</p>
+
+<!--*************************************************************************-->
+<h2><a name="experiments">Experiments</a></h2>
+<!--*************************************************************************-->
+
+<p>Measurements are done by running a full build (using xcodebuild or
+make for Sketch and 176.gcc respectively) using Clang and gcc 4.2 as
+compilers; gcc is run both with and without the new clang driver (ccc)
+in order to evaluate the overhead of the driver itself.</p>
+
+<p>In order to track the performance of various subsystems the timings
+have been broken down into separate stages where possible. This is
+done by over-riding the CC environment variable used during the build
+to point to one of a few simple shell scripts which may skip part of
+the build.
+
+<ul>
+ <li><tt>non-compiler</tt>: The overhead of the build system itself;
+ for Sketch this also includes the time to build/copy various
+ non-source code resource files.</li>
+ <li><tt>+ driver</tt>: Add execution of the driver, but do not execute any
+ commands (by using the -### driver option).</li>
+ <li><tt>+ pch gen</tt>: Add generation of PCH files.</li>
+ <li><tt>+ cpp</tt>: Add preprocessing of source files (this time is
+ include in syntax for gcc).</li>
+ <li><tt>+ parse</tt>: Add parsing of source files (this time is
+ include in syntax for gcc).</li>
+ <li><tt>+ syntax</tt>: Add semantic checking of source files (for
+ gcc, this includes preprocessing and parsing as well).</li>
+ <li><tt>+ IRgen</tt>: Add generation of LLVM IR (gcc has no
+ corresponding phase).</li>
+ <li><tt>+ codegen</tt>: Add generation of assembler files.</li>
+ <li><tt>+ assembler</tt>: Add assembler time to generate .o files.</li>
+ <li><tt>+ linker</tt>: Add linker time.</li>
+</ul>
+</p>
+
+<p>This set of stages is chosen to be approximately additive, that is
+each subsequent stage simply adds some additional processing. The
+timings measure the delta of the given stage from the previous
+one. For example, the timings for <tt>+ syntax</tt> below show the
+difference of running with <tt>+ syntax</tt> versus running with <tt>+
+parse</tt> (for clang) or <tt>+ driver</tt> with gcc. This amounts to
+a fairly accurate measure of only the time to perform semantic
+analysis (and preprocessing/parsing, in the case of gcc).</p>
+
+<!--*************************************************************************-->
+<h2><a name="timings">Timing Results</a></h2>
+<!--*************************************************************************-->
+
+<!--=======================================================================-->
+<h3><a name="2009-03-02">2009-03-02</a></h3>
+<!--=======================================================================-->
+
+<a href="timing-data/2009-03-02/sketch.pdf">
+<img class="img_slide"
+ src="timing-data/2009-03-02/sketch.png" alt="Sketch Timings"/>
+</a>
+
+<a href="timing-data/2009-03-02/176.gcc.pdf">
+<img class="img_slide"
+ src="timing-data/2009-03-02/176.gcc.png" alt="176.gcc Timings"/>
+</a>
+
+</div>
+</body>
+</html>
diff --git a/www/performance.html b/www/performance.html
index f76fc7a0094d..2bb8fe272f2d 100644
--- a/www/performance.html
+++ b/www/performance.html
@@ -41,7 +41,7 @@ interesting benchmarks:
<p>
For previous performance numbers, please
-go <a href="performance-2008-10-31.html">here</a>.
+go <a href="performance-2009-03-02.html">here</a>.
</p>
<!--*************************************************************************-->
@@ -50,8 +50,7 @@ go <a href="performance-2008-10-31.html">here</a>.
<p>Measurements are done by running a full build (using xcodebuild or
make for Sketch and 176.gcc respectively) using Clang and gcc 4.2 as
-compilers; gcc is run both with and without the new clang driver (ccc)
-in order to evaluate the overhead of the driver itself.</p>
+compilers.</p>
<p>In order to track the performance of various subsystems the timings
have been broken down into separate stages where possible. This is
@@ -65,13 +64,9 @@ the build.
non-source code resource files.</li>
<li><tt>+ driver</tt>: Add execution of the driver, but do not execute any
commands (by using the -### driver option).</li>
- <li><tt>+ pch gen</tt>: Add generation of PCH files.</li>
- <li><tt>+ cpp</tt>: Add preprocessing of source files (this time is
- include in syntax for gcc).</li>
- <li><tt>+ parse</tt>: Add parsing of source files (this time is
- include in syntax for gcc).</li>
- <li><tt>+ syntax</tt>: Add semantic checking of source files (for
- gcc, this includes preprocessing and parsing as well).</li>
+ <li><tt>+ pch gen</tt>: Add generation of PCH files (if used).</li>
+ <li><tt>+ syntax</tt>: Add preprocessing, parsing, and semantic checking of
+ source files.</li>
<li><tt>+ IRgen</tt>: Add generation of LLVM IR (gcc has no
corresponding phase).</li>
<li><tt>+ codegen</tt>: Add generation of assembler files.</li>
@@ -80,31 +75,30 @@ the build.
</ul>
</p>
-<p>This set of stages is chosen to be approximately additive, that is
-each subsequent stage simply adds some additional processing. The
-timings measure the delta of the given stage from the previous
-one. For example, the timings for <tt>+ syntax</tt> below show the
-difference of running with <tt>+ syntax</tt> versus running with <tt>+
-parse</tt> (for clang) or <tt>+ driver</tt> with gcc. This amounts to
-a fairly accurate measure of only the time to perform semantic
-analysis (and preprocessing/parsing, in the case of gcc).</p>
+<p>This set of stages is chosen to be approximately additive, that is each
+subsequent stage simply adds some additional processing. The timings measure the
+delta of the given stage from the previous one. For example, the timings
+for <tt>+ syntax</tt> below show the difference of running with <tt>+
+syntax</tt> versus the times for <tt>+ pch gen</tt>. This amounts to a fairly
+accurate measure of only the time to perform preprocessing, parsing, and
+semantic analysis after PCH generation is done.</p>
<!--*************************************************************************-->
<h2><a name="timings">Timing Results</a></h2>
<!--*************************************************************************-->
<!--=======================================================================-->
-<h3><a name="2009-03-02">2009-03-02</a></h3>
+<h3><a name="2009-06-26">2009-06-26</a></h3>
<!--=======================================================================-->
-<a href="timing-data/2009-03-02/sketch.pdf">
+<a href="timing-data/2009-06-26/sketch.pdf">
<img class="img_slide"
- src="timing-data/2009-03-02/sketch.png" alt="Sketch Timings"/>
+ src="timing-data/2009-06-26/sketch.png" alt="Sketch Timings"/>
</a>
-<a href="timing-data/2009-03-02/176.gcc.pdf">
+<a href="timing-data/2009-06-26/176.gcc.pdf">
<img class="img_slide"
- src="timing-data/2009-03-02/176.gcc.png" alt="176.gcc Timings"/>
+ src="timing-data/2009-06-26/176.gcc.png" alt="176.gcc Timings"/>
</a>
</div>
diff --git a/www/timing-data/2009-06-26/176.gcc.pdf b/www/timing-data/2009-06-26/176.gcc.pdf
new file mode 100644
index 000000000000..50a8bc355e6b
--- /dev/null
+++ b/www/timing-data/2009-06-26/176.gcc.pdf
Binary files differ
diff --git a/www/timing-data/2009-06-26/176.gcc.png b/www/timing-data/2009-06-26/176.gcc.png
new file mode 100644
index 000000000000..da10f11b66c2
--- /dev/null
+++ b/www/timing-data/2009-06-26/176.gcc.png
Binary files differ
diff --git a/www/timing-data/2009-06-26/176.gcc.txt b/www/timing-data/2009-06-26/176.gcc.txt
new file mode 100644
index 000000000000..e8b9c4468fe9
--- /dev/null
+++ b/www/timing-data/2009-06-26/176.gcc.txt
@@ -0,0 +1,699 @@
+start = """2009-06-26_10-19"""
+clang = """/Volumes/Data/ddunbar/llvm.install/bin/clang"""
+gcc = """/usr/bin/gcc-4.2"""
+clang_info = """
+clang version 1.0 (https://ddunbar@llvm.org/svn/llvm-project/cfe/trunk 70266M)
+Target: x86_64-apple-darwin10
+ "/Volumes/Data/ddunbar/llvm.install/bin/../libexec/clang-cc" "-triple" "x86_64-apple-darwin10" "-S" "-disable-free" "-main-file-name" "null" "--relocation-model" "pic" "-pic-level=1" "--disable-fp-elim" "--unwind-tables=1" "--fmath-errno=0" "-mmacosx-version-min=10.6.0" "-fdiagnostics-show-option" "-o" "/var/folders/cl/clrOX6SaG+moCeRKEI4PtU+++TI/-Tmp-/cc-CVKyzP.s" "-x" "c" "/dev/null"
+ "/usr/libexec/gcc/i686-apple-darwin10/4.2.1/as" "-arch" "x86_64" "-force_cpusubtype_ALL" "-o" "/var/folders/cl/clrOX6SaG+moCeRKEI4PtU+++TI/-Tmp-/cc-yeTCzJ.o" "/var/folders/cl/clrOX6SaG+moCeRKEI4PtU+++TI/-Tmp-/cc-CVKyzP.s"
+ "/usr/libexec/gcc/i686-apple-darwin10/4.2.1/ld" "-dynamic" "-arch" "x86_64" "-macosx_version_min" "10.6.0" "-weak_reference_mismatches" "non-weak" "-o" "a.out" "-lcrt1.10.6.o" "-L/usr/lib/gcc/i686-apple-darwin10/4.2.1/x86_64" "-L/usr/lib/gcc/i686-apple-darwin10/4.2.1/x86_64" "-L/usr/lib/i686-apple-darwin10/4.2.1" "-L/usr/lib/gcc/i686-apple-darwin10/4.2.1" "-L/usr/lib/gcc/i686-apple-darwin10/4.2.1" "-L/usr/lib/gcc/i686-apple-darwin10/4.2.1/../../../i686-apple-darwin10/4.2.1" "-L/usr/lib/gcc/i686-apple-darwin10/4.2.1/../../.." "/var/folders/cl/clrOX6SaG+moCeRKEI4PtU+++TI/-Tmp-/cc-yeTCzJ.o" "-lSystem" "-lgcc"
+"""
+gcc_info = """
+Using built-in specs.
+Target: i686-apple-darwin10
+Configured with: /var/tmp/gcc/gcc-5646~6/src/configure --disable-checking --enable-werror --prefix=/usr --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ --with-slibdir=/usr/lib --build=i686-apple-darwin10 --with-gxx-include-dir=/include/c++/4.2.1 --program-prefix=i686-apple-darwin10- --host=x86_64-apple-darwin10 --target=i686-apple-darwin10
+Thread model: posix
+gcc version 4.2.1 (Apple Inc. build 5646)
+ "/usr/libexec/gcc/i686-apple-darwin10/4.2.1/cc1" "-quiet" "-imultilib" "x86_64" "-D__DYNAMIC__" "/dev/null" "-fPIC" "-quiet" "-dumpbase" "null" "-mmacosx-version-min=10.6.0" "-m64" "-mtune=core2" "-auxbase" "null" "-o" "/var/folders/cl/clrOX6SaG+moCeRKEI4PtU+++TI/-Tmp-//cc1kQh9M.s"
+ "/usr/libexec/gcc/i686-apple-darwin10/4.2.1/as" "-arch" "x86_64" "-force_cpusubtype_ALL" "-o" "/var/folders/cl/clrOX6SaG+moCeRKEI4PtU+++TI/-Tmp-//ccQcv4DT.o" "/var/folders/cl/clrOX6SaG+moCeRKEI4PtU+++TI/-Tmp-//cc1kQh9M.s"
+ "/usr/libexec/gcc/i686-apple-darwin10/4.2.1/collect2" "-dynamic" "-arch" "x86_64" "-macosx_version_min" "10.6.0" "-weak_reference_mismatches" "non-weak" "-o" "a.out" "-lcrt1.10.6.o" "-L/usr/lib/gcc/i686-apple-darwin10/4.2.1/x86_64" "-L/usr/lib/gcc/i686-apple-darwin10/4.2.1/x86_64" "-L/usr/lib/i686-apple-darwin10/4.2.1" "-L/usr/lib/gcc/i686-apple-darwin10/4.2.1" "-L/usr/lib/gcc/i686-apple-darwin10/4.2.1" "-L/usr/lib/gcc/i686-apple-darwin10/4.2.1/../../../i686-apple-darwin10/4.2.1" "-L/usr/lib/gcc/i686-apple-darwin10/4.2.1/../../.." "/var/folders/cl/clrOX6SaG+moCeRKEI4PtU+++TI/-Tmp-//ccQcv4DT.o" "-lSystem" "-lgcc" "-lSystem"
+"""
+style = """make"""
+runs = []
+runs.append(( { 'cc':"clang_pch",
+ 'script':"null",
+ 'threads':"8",
+ 'pch':"no_pch" },
+{ 'version' : 0,
+ 'samples' : [
+ (0, 0.065445, 0.110578, 0.041286),
+ (1, 0.064915, 0.107837, 0.038992),
+ (2, 0.065191, 0.106475, 0.039233),
+ (3, 0.064924, 0.107004, 0.039142),
+ (4, 0.065260, 0.108901, 0.038903),
+]}
+))
+runs.append(( { 'cc':"gcc",
+ 'script':"null",
+ 'threads':"8",
+ 'pch':"no_pch" },
+{ 'version' : 0,
+ 'samples' : [
+ (0, 0.066126, 0.112036, 0.040769),
+ (1, 0.065207, 0.108471, 0.038945),
+ (2, 0.065186, 0.107970, 0.038926),
+ (3, 0.065149, 0.108577, 0.039189),
+ (4, 0.065456, 0.109348, 0.039253),
+]}
+))
+runs.append(( { 'cc':"clang_pch",
+ 'script':"###",
+ 'threads':"8",
+ 'pch':"no_pch" },
+{ 'version' : 0,
+ 'samples' : [
+ (0, 0.206667, 0.425607, 0.110976),
+ (1, 0.204719, 0.410080, 0.107065),
+ (2, 0.204989, 0.410953, 0.108714),
+ (3, 0.204985, 0.407392, 0.107438),
+ (4, 0.203424, 0.408111, 0.108717),
+]}
+))
+runs.append(( { 'cc':"gcc",
+ 'script':"###",
+ 'threads':"8",
+ 'pch':"no_pch" },
+{ 'version' : 0,
+ 'samples' : [
+ (0, 0.265631, 0.798950, 0.161461),
+ (1, 0.263615, 0.805888, 0.160308),
+ (2, 0.263824, 0.686335, 0.145542),
+ (3, 0.262625, 0.949966, 0.177774),
+ (4, 0.263458, 0.820937, 0.162473),
+]}
+))
+runs.append(( { 'cc':"clang_pch",
+ 'script':"syntax",
+ 'threads':"8",
+ 'pch':"no_pch" },
+{ 'version' : 0,
+ 'samples' : [
+ (0, 1.464727, 0.818916, 0.657338),
+ (1, 1.492318, 0.850179, 0.351025),
+ (2, 1.492530, 0.861113, 0.349530),
+ (3, 1.515402, 0.868510, 0.354163),
+ (4, 1.501033, 0.855415, 0.351763),
+]}
+))
+runs.append(( { 'cc':"gcc",
+ 'script':"syntax",
+ 'threads':"8",
+ 'pch':"no_pch" },
+{ 'version' : 0,
+ 'samples' : [
+ (0, 4.339387, 1.362012, 0.808105),
+ (1, 4.327148, 1.319992, 0.794006),
+ (2, 4.327374, 1.320020, 0.793893),
+ (3, 4.319876, 1.319808, 0.787893),
+ (4, 4.329951, 1.344321, 0.796930),
+]}
+))
+runs.append(( { 'cc':"clang_pch",
+ 'script':"irgen",
+ 'threads':"8",
+ 'pch':"no_pch" },
+{ 'version' : 0,
+ 'samples' : [
+ (0, 3.977307, 1.244670, 0.754129),
+ (1, 3.948981, 1.236009, 0.751078),
+ (2, 3.987417, 1.247336, 0.750608),
+ (3, 3.973621, 1.227822, 0.746016),
+ (4, 3.947019, 1.234332, 0.741703),
+]}
+))
+runs.append(( { 'cc':"clang_pch",
+ 'script':"only_asm",
+ 'threads':"8",
+ 'pch':"no_pch" },
+{ 'version' : 0,
+ 'samples' : [
+ (0, 6.749291, 1.404829, 1.149195),
+ (1, 6.750589, 1.434406, 1.151828),
+ (2, 6.744767, 1.415306, 1.146994),
+ (3, 6.738192, 1.425966, 1.147283),
+ (4, 6.755475, 1.410701, 1.147945),
+]}
+))
+runs.append(( { 'cc':"gcc",
+ 'script':"only_asm",
+ 'threads':"8",
+ 'pch':"no_pch" },
+{ 'version' : 0,
+ 'samples' : [
+ (0, 9.403397, 1.560103, 1.539962),
+ (1, 9.398348, 1.540148, 1.526404),
+ (2, 9.421496, 1.551876, 1.744563),
+ (3, 9.456310, 1.589165, 1.539901),
+ (4, 9.417963, 1.545186, 1.528347),
+]}
+))
+runs.append(( { 'cc':"clang_pch",
+ 'script':"only_compile",
+ 'threads':"8",
+ 'pch':"no_pch" },
+{ 'version' : 0,
+ 'samples' : [
+ (0, 8.032359, 1.747400, 1.467280),
+ (1, 7.962687, 1.720919, 1.391892),
+ (2, 7.986155, 1.694753, 1.426921),
+ (3, 7.978081, 1.695359, 1.416691),
+ (4, 7.977982, 1.687328, 1.419240),
+]}
+))
+runs.append(( { 'cc':"gcc",
+ 'script':"only_compile",
+ 'threads':"8",
+ 'pch':"no_pch" },
+{ 'version' : 0,
+ 'samples' : [
+ (0, 10.750102, 1.794398, 1.729777),
+ (1, 10.730841, 1.801150, 1.728536),
+ (2, 10.723943, 1.779271, 1.701177),
+ (3, 10.730824, 1.778987, 1.705904),
+ (4, 10.741052, 1.819326, 1.724089),
+]}
+))
+runs.append(( { 'cc':"clang_pch",
+ 'script':"all",
+ 'threads':"8",
+ 'pch':"no_pch" },
+{ 'version' : 0,
+ 'samples' : [
+ (0, 8.070440, 1.732707, 1.518658),
+ (1, 8.111095, 1.739793, 1.542162),
+ (2, 8.106386, 1.751412, 1.552584),
+ (3, 8.062847, 1.723786, 1.540230),
+ (4, 8.075670, 1.701288, 1.509957),
+]}
+))
+runs.append(( { 'cc':"gcc",
+ 'script':"all",
+ 'threads':"8",
+ 'pch':"no_pch" },
+{ 'version' : 0,
+ 'samples' : [
+ (0, 10.803240, 1.832409, 1.822466),
+ (1, 10.797956, 1.833142, 1.875121),
+ (2, 10.815192, 1.818826, 1.835845),
+ (3, 10.826268, 1.809307, 1.823997),
+ (4, 10.815709, 1.809185, 1.840403),
+]}
+))
+runs.append(( { 'cc':"clang_pch",
+ 'script':"null",
+ 'threads':"1",
+ 'pch':"no_pch" },
+{ 'version' : 0,
+ 'samples' : [
+ (0, 0.060892, 0.065833, 0.155946),
+ (1, 0.060517, 0.064263, 0.133922),
+ (2, 0.060487, 0.064208, 0.133807),
+ (3, 0.060484, 0.063849, 0.134039),
+ (4, 0.060465, 0.064026, 0.133506),
+]}
+))
+runs.append(( { 'cc':"gcc",
+ 'script':"null",
+ 'threads':"1",
+ 'pch':"no_pch" },
+{ 'version' : 0,
+ 'samples' : [
+ (0, 0.060780, 0.064833, 0.136229),
+ (1, 0.060581, 0.064090, 0.134156),
+ (2, 0.060534, 0.064191, 0.133656),
+ (3, 0.060524, 0.064027, 0.133635),
+ (4, 0.060523, 0.063964, 0.133708),
+]}
+))
+runs.append(( { 'cc':"clang_pch",
+ 'script':"###",
+ 'threads':"1",
+ 'pch':"no_pch" },
+{ 'version' : 0,
+ 'samples' : [
+ (0, 0.182177, 0.218261, 0.480256),
+ (1, 0.181253, 0.215086, 0.446808),
+ (2, 0.181503, 0.215725, 0.450776),
+ (3, 0.181187, 0.215330, 0.447765),
+ (4, 0.181176, 0.215050, 0.446595),
+]}
+))
+runs.append(( { 'cc':"gcc",
+ 'script':"###",
+ 'threads':"1",
+ 'pch':"no_pch" },
+{ 'version' : 0,
+ 'samples' : [
+ (0, 0.236347, 0.301491, 0.583495),
+ (1, 0.235946, 0.299452, 0.568506),
+ (2, 0.235676, 0.298048, 0.559954),
+ (3, 0.235782, 0.298448, 0.561808),
+ (4, 0.235882, 0.299948, 0.563575),
+]}
+))
+runs.append(( { 'cc':"clang_pch",
+ 'script':"syntax",
+ 'threads':"1",
+ 'pch':"no_pch" },
+{ 'version' : 0,
+ 'samples' : [
+ (0, 1.355242, 0.589876, 2.134110),
+ (1, 1.354939, 0.586215, 2.111487),
+ (2, 1.354329, 0.589784, 2.109410),
+ (3, 1.355080, 0.586192, 2.122027),
+ (4, 1.354042, 0.581133, 2.111260),
+]}
+))
+runs.append(( { 'cc':"gcc",
+ 'script':"syntax",
+ 'threads':"1",
+ 'pch':"no_pch" },
+{ 'version' : 0,
+ 'samples' : [
+ (0, 4.044141, 0.951252, 5.162733),
+ (1, 4.043237, 0.954487, 5.147568),
+ (2, 4.043888, 0.952179, 5.146153),
+ (3, 4.043125, 0.948038, 5.147289),
+ (4, 4.043883, 0.943084, 5.147096),
+]}
+))
+runs.append(( { 'cc':"clang_pch",
+ 'script':"irgen",
+ 'threads':"1",
+ 'pch':"no_pch" },
+{ 'version' : 0,
+ 'samples' : [
+ (0, 3.444049, 0.848918, 4.534581),
+ (1, 3.444084, 0.854620, 4.525171),
+ (2, 3.444498, 0.862757, 4.598576),
+ (3, 3.442347, 0.856215, 4.518719),
+ (4, 3.443622, 0.866269, 4.532286),
+]}
+))
+runs.append(( { 'cc':"clang_pch",
+ 'script':"only_asm",
+ 'threads':"1",
+ 'pch':"no_pch" },
+{ 'version' : 0,
+ 'samples' : [
+ (0, 6.065809, 1.034261, 7.390113),
+ (1, 6.064420, 1.027780, 7.396403),
+ (2, 6.065132, 1.030652, 7.471856),
+ (3, 6.060587, 1.031604, 7.337894),
+ (4, 6.064466, 1.050338, 7.360592),
+]}
+))
+runs.append(( { 'cc':"gcc",
+ 'script':"only_asm",
+ 'threads':"1",
+ 'pch':"no_pch" },
+{ 'version' : 0,
+ 'samples' : [
+ (0, 8.960646, 1.236906, 10.456741),
+ (1, 8.957264, 1.234577, 10.357447),
+ (2, 8.956407, 1.237590, 10.352680),
+ (3, 8.957027, 1.241364, 10.398440),
+ (4, 8.956120, 1.239588, 10.355988),
+]}
+))
+runs.append(( { 'cc':"clang_pch",
+ 'script':"only_compile",
+ 'threads':"1",
+ 'pch':"no_pch" },
+{ 'version' : 0,
+ 'samples' : [
+ (0, 7.277301, 1.238993, 8.973009),
+ (1, 7.277048, 1.246566, 9.027985),
+ (2, 7.277032, 1.226791, 8.944300),
+ (3, 7.277537, 1.242752, 8.970441),
+ (4, 7.278972, 1.238938, 8.989529),
+]}
+))
+runs.append(( { 'cc':"gcc",
+ 'script':"only_compile",
+ 'threads':"1",
+ 'pch':"no_pch" },
+{ 'version' : 0,
+ 'samples' : [
+ (0, 10.081783, 1.335714, 11.707981),
+ (1, 10.081742, 1.344538, 11.682596),
+ (2, 10.079740, 1.330281, 11.681210),
+ (3, 10.074737, 1.324856, 11.632253),
+ (4, 10.075030, 1.350316, 11.633475),
+]}
+))
+runs.append(( { 'cc':"clang_pch",
+ 'script':"all",
+ 'threads':"1",
+ 'pch':"no_pch" },
+{ 'version' : 0,
+ 'samples' : [
+ (0, 7.377028, 1.265309, 9.283505),
+ (1, 7.376723, 1.253489, 9.102278),
+ (2, 7.376104, 1.255404, 9.094650),
+ (3, 7.376589, 1.260461, 9.246790),
+ (4, 7.377455, 1.255013, 9.095294),
+]}
+))
+runs.append(( { 'cc':"gcc",
+ 'script':"all",
+ 'threads':"1",
+ 'pch':"no_pch" },
+{ 'version' : 0,
+ 'samples' : [
+ (0, 10.172422, 1.355756, 11.797816),
+ (1, 10.173442, 1.357210, 11.808185),
+ (2, 10.173484, 1.346743, 11.781768),
+ (3, 10.170524, 1.352371, 11.749764),
+ (4, 10.171428, 1.362057, 11.760581),
+]}
+))
+runs.append(( { 'cc':"clang_pch",
+ 'script':"null",
+ 'threads':"2",
+ 'pch':"no_pch" },
+{ 'version' : 0,
+ 'samples' : [
+ (0, 0.061930, 0.070826, 0.090142),
+ (1, 0.061012, 0.067330, 0.073687),
+ (2, 0.060994, 0.067246, 0.073681),
+ (3, 0.061099, 0.067234, 0.074369),
+ (4, 0.061022, 0.066989, 0.073428),
+]}
+))
+runs.append(( { 'cc':"gcc",
+ 'script':"null",
+ 'threads':"2",
+ 'pch':"no_pch" },
+{ 'version' : 0,
+ 'samples' : [
+ (0, 0.061591, 0.069558, 0.083641),
+ (1, 0.061059, 0.067184, 0.073565),
+ (2, 0.061076, 0.067165, 0.073724),
+ (3, 0.061096, 0.066990, 0.073567),
+ (4, 0.061062, 0.067199, 0.073221),
+]}
+))
+runs.append(( { 'cc':"clang_pch",
+ 'script':"###",
+ 'threads':"2",
+ 'pch':"no_pch" },
+{ 'version' : 0,
+ 'samples' : [
+ (0, 0.185243, 0.234231, 0.256557),
+ (1, 0.184673, 0.232841, 0.245015),
+ (2, 0.184453, 0.232130, 0.244661),
+ (3, 0.184370, 0.230836, 0.243152),
+ (4, 0.184320, 0.231212, 0.244266),
+]}
+))
+runs.append(( { 'cc':"gcc",
+ 'script':"###",
+ 'threads':"2",
+ 'pch':"no_pch" },
+{ 'version' : 0,
+ 'samples' : [
+ (0, 0.239474, 0.325816, 0.314883),
+ (1, 0.238393, 0.326431, 0.306354),
+ (2, 0.238299, 0.326449, 0.307918),
+ (3, 0.237867, 0.325013, 0.305753),
+ (4, 0.238329, 0.326355, 0.306446),
+]}
+))
+runs.append(( { 'cc':"clang_pch",
+ 'script':"syntax",
+ 'threads':"2",
+ 'pch':"no_pch" },
+{ 'version' : 0,
+ 'samples' : [
+ (0, 1.386532, 0.594929, 1.083410),
+ (1, 1.385214, 0.591925, 1.071299),
+ (2, 1.385670, 0.596527, 1.071159),
+ (3, 1.385205, 0.595489, 1.071494),
+ (4, 1.385904, 0.590797, 1.067600),
+]}
+))
+runs.append(( { 'cc':"gcc",
+ 'script':"syntax",
+ 'threads':"2",
+ 'pch':"no_pch" },
+{ 'version' : 0,
+ 'samples' : [
+ (0, 4.154845, 0.996239, 2.665919),
+ (1, 4.149680, 0.998786, 2.651533),
+ (2, 4.150974, 1.006984, 2.655142),
+ (3, 4.152007, 1.008280, 2.659809),
+ (4, 4.152938, 1.003288, 2.658114),
+]}
+))
+runs.append(( { 'cc':"clang_pch",
+ 'script':"irgen",
+ 'threads':"2",
+ 'pch':"no_pch" },
+{ 'version' : 0,
+ 'samples' : [
+ (0, 3.644865, 0.892229, 2.404722),
+ (1, 3.639556, 0.887595, 2.387664),
+ (2, 3.643246, 0.880541, 2.387287),
+ (3, 3.643391, 0.883751, 2.401062),
+ (4, 3.644145, 0.886052, 2.392286),
+]}
+))
+runs.append(( { 'cc':"clang_pch",
+ 'script':"only_asm",
+ 'threads':"2",
+ 'pch':"no_pch" },
+{ 'version' : 0,
+ 'samples' : [
+ (0, 6.307048, 1.072104, 3.873967),
+ (1, 6.313464, 1.064256, 3.870116),
+ (2, 6.307031, 1.064902, 3.865455),
+ (3, 6.309147, 1.070336, 3.900830),
+ (4, 6.307909, 1.066836, 3.868847),
+]}
+))
+runs.append(( { 'cc':"gcc",
+ 'script':"only_asm",
+ 'threads':"2",
+ 'pch':"no_pch" },
+{ 'version' : 0,
+ 'samples' : [
+ (0, 9.143474, 1.275600, 5.365390),
+ (1, 9.141933, 1.276966, 5.352204),
+ (2, 9.141995, 1.270270, 5.353590),
+ (3, 9.143375, 1.285837, 5.356607),
+ (4, 9.144897, 1.283080, 5.494642),
+]}
+))
+runs.append(( { 'cc':"clang_pch",
+ 'script':"only_compile",
+ 'threads':"2",
+ 'pch':"no_pch" },
+{ 'version' : 0,
+ 'samples' : [
+ (0, 7.533151, 1.293809, 4.718994),
+ (1, 7.528865, 1.295241, 4.726586),
+ (2, 7.528888, 1.303576, 4.729746),
+ (3, 7.525020, 1.295358, 4.716415),
+ (4, 7.528346, 1.289752, 4.721087),
+]}
+))
+runs.append(( { 'cc':"gcc",
+ 'script':"only_compile",
+ 'threads':"2",
+ 'pch':"no_pch" },
+{ 'version' : 0,
+ 'samples' : [
+ (0, 10.287174, 1.382953, 6.031426),
+ (1, 10.283068, 1.389433, 6.021822),
+ (2, 10.283543, 1.392869, 6.004187),
+ (3, 10.284358, 1.377433, 5.997940),
+ (4, 10.289169, 1.391765, 6.007507),
+]}
+))
+runs.append(( { 'cc':"clang_pch",
+ 'script':"all",
+ 'threads':"2",
+ 'pch':"no_pch" },
+{ 'version' : 0,
+ 'samples' : [
+ (0, 7.619409, 1.304847, 4.862155),
+ (1, 7.623702, 1.312795, 4.906194),
+ (2, 7.621269, 1.306275, 4.840736),
+ (3, 7.621495, 1.319364, 4.862966),
+ (4, 7.621999, 1.304611, 4.860783),
+]}
+))
+runs.append(( { 'cc':"gcc",
+ 'script':"all",
+ 'threads':"2",
+ 'pch':"no_pch" },
+{ 'version' : 0,
+ 'samples' : [
+ (0, 10.367482, 1.401449, 6.145377),
+ (1, 10.373043, 1.412685, 6.172106),
+ (2, 10.373049, 1.398992, 6.103300),
+ (3, 10.373781, 1.396096, 6.107375),
+ (4, 10.366926, 1.406716, 6.112696),
+]}
+))
+runs.append(( { 'cc':"clang_pch",
+ 'script':"null",
+ 'threads':"4",
+ 'pch':"no_pch" },
+{ 'version' : 0,
+ 'samples' : [
+ (0, 0.064425, 0.090165, 0.056533),
+ (1, 0.062985, 0.083843, 0.047935),
+ (2, 0.062983, 0.083616, 0.047921),
+ (3, 0.063039, 0.084145, 0.048157),
+ (4, 0.063026, 0.084462, 0.048349),
+]}
+))
+runs.append(( { 'cc':"gcc",
+ 'script':"null",
+ 'threads':"4",
+ 'pch':"no_pch" },
+{ 'version' : 0,
+ 'samples' : [
+ (0, 0.064141, 0.088108, 0.053766),
+ (1, 0.063195, 0.084658, 0.048108),
+ (2, 0.063350, 0.085147, 0.049666),
+ (3, 0.063052, 0.083725, 0.047925),
+ (4, 0.063048, 0.083896, 0.048249),
+]}
+))
+runs.append(( { 'cc':"clang_pch",
+ 'script':"###",
+ 'threads':"4",
+ 'pch':"no_pch" },
+{ 'version' : 0,
+ 'samples' : [
+ (0, 0.195147, 0.299573, 0.157355),
+ (1, 0.193085, 0.296310, 0.156304),
+ (2, 0.193189, 0.295669, 0.155085),
+ (3, 0.193301, 0.292950, 0.152589),
+ (4, 0.193210, 0.292226, 0.154638),
+]}
+))
+runs.append(( { 'cc':"gcc",
+ 'script':"###",
+ 'threads':"4",
+ 'pch':"no_pch" },
+{ 'version' : 0,
+ 'samples' : [
+ (0, 0.250242, 0.409797, 0.192336),
+ (1, 0.248762, 0.398072, 0.187157),
+ (2, 0.248680, 0.433130, 0.196985),
+ (3, 0.248853, 0.398547, 0.187603),
+ (4, 0.248648, 0.405913, 0.188482),
+]}
+))
+runs.append(( { 'cc':"clang_pch",
+ 'script':"syntax",
+ 'threads':"4",
+ 'pch':"no_pch" },
+{ 'version' : 0,
+ 'samples' : [
+ (0, 1.451387, 0.687142, 0.597211),
+ (1, 1.446637, 0.676693, 0.591064),
+ (2, 1.449276, 0.677468, 0.591800),
+ (3, 1.444318, 0.671687, 0.589322),
+ (4, 1.444476, 0.681194, 0.592248),
+]}
+))
+runs.append(( { 'cc':"gcc",
+ 'script':"syntax",
+ 'threads':"4",
+ 'pch':"no_pch" },
+{ 'version' : 0,
+ 'samples' : [
+ (0, 4.264736, 1.132651, 1.424788),
+ (1, 4.261695, 1.143089, 1.416857),
+ (2, 4.264731, 1.138831, 1.422684),
+ (3, 4.264711, 1.140477, 1.417779),
+ (4, 4.260991, 1.147619, 1.419141),
+]}
+))
+runs.append(( { 'cc':"clang_pch",
+ 'script':"irgen",
+ 'threads':"4",
+ 'pch':"no_pch" },
+{ 'version' : 0,
+ 'samples' : [
+ (0, 3.837203, 1.035623, 1.327415),
+ (1, 3.869828, 1.033702, 1.331966),
+ (2, 3.878679, 1.043199, 1.336928),
+ (3, 3.865577, 1.033086, 1.330496),
+ (4, 3.854501, 1.024146, 1.328011),
+]}
+))
+runs.append(( { 'cc':"clang_pch",
+ 'script':"only_asm",
+ 'threads':"4",
+ 'pch':"no_pch" },
+{ 'version' : 0,
+ 'samples' : [
+ (0, 6.576067, 1.224910, 2.082887),
+ (1, 6.555647, 1.214275, 2.066679),
+ (2, 6.564496, 1.225676, 2.082281),
+ (3, 6.563023, 1.202289, 2.074234),
+ (4, 6.574312, 1.203879, 2.075939),
+]}
+))
+runs.append(( { 'cc':"gcc",
+ 'script':"only_asm",
+ 'threads':"4",
+ 'pch':"no_pch" },
+{ 'version' : 0,
+ 'samples' : [
+ (0, 9.320291, 1.388042, 2.820785),
+ (1, 9.321238, 1.374025, 2.817582),
+ (2, 9.312721, 1.370752, 2.815972),
+ (3, 9.321560, 1.382464, 2.905396),
+ (4, 9.315155, 1.367614, 2.814303),
+]}
+))
+runs.append(( { 'cc':"clang_pch",
+ 'script':"only_compile",
+ 'threads':"4",
+ 'pch':"no_pch" },
+{ 'version' : 0,
+ 'samples' : [
+ (0, 7.799699, 1.445598, 2.532217),
+ (1, 7.793440, 1.427494, 2.537293),
+ (2, 7.794819, 1.451267, 2.540644),
+ (3, 7.802867, 1.449885, 2.537256),
+ (4, 7.811558, 1.454217, 2.549762),
+]}
+))
+runs.append(( { 'cc':"gcc",
+ 'script':"only_compile",
+ 'threads':"4",
+ 'pch':"no_pch" },
+{ 'version' : 0,
+ 'samples' : [
+ (0, 10.518288, 1.557086, 3.158364),
+ (1, 10.524251, 1.541390, 3.138438),
+ (2, 10.526541, 1.538375, 3.142480),
+ (3, 10.516332, 1.562218, 3.192590),
+ (4, 10.526898, 1.540009, 3.152245),
+]}
+))
+runs.append(( { 'cc':"clang_pch",
+ 'script':"all",
+ 'threads':"4",
+ 'pch':"no_pch" },
+{ 'version' : 0,
+ 'samples' : [
+ (0, 7.894470, 1.472428, 2.647063),
+ (1, 7.880948, 1.497803, 2.666059),
+ (2, 7.877924, 1.457295, 2.623934),
+ (3, 7.880090, 1.463151, 2.671976),
+ (4, 7.876586, 1.463586, 2.653038),
+]}
+))
+runs.append(( { 'cc':"gcc",
+ 'script':"all",
+ 'threads':"4",
+ 'pch':"no_pch" },
+{ 'version' : 0,
+ 'samples' : [
+ (0, 10.608510, 1.562882, 3.262625),
+ (1, 10.609805, 1.556848, 3.285292),
+ (2, 10.618056, 1.550407, 3.276770),
+ (3, 10.618343, 1.584988, 3.335703),
+ (4, 10.613029, 1.560418, 3.287023),
+]}
+))
+finished = """2009-06-26_10-31"""
diff --git a/www/timing-data/2009-06-26/sketch.pdf b/www/timing-data/2009-06-26/sketch.pdf
new file mode 100644
index 000000000000..0bcf4c3b47fc
--- /dev/null
+++ b/www/timing-data/2009-06-26/sketch.pdf
Binary files differ
diff --git a/www/timing-data/2009-06-26/sketch.png b/www/timing-data/2009-06-26/sketch.png
new file mode 100644
index 000000000000..02a63215191f
--- /dev/null
+++ b/www/timing-data/2009-06-26/sketch.png
Binary files differ
diff --git a/www/timing-data/2009-06-26/sketch.txt b/www/timing-data/2009-06-26/sketch.txt
new file mode 100644
index 000000000000..5e2331cdea07
--- /dev/null
+++ b/www/timing-data/2009-06-26/sketch.txt
@@ -0,0 +1,803 @@
+start = """2009-06-26_10-04"""
+clang = """/Volumes/Data/ddunbar/llvm.install/bin/clang"""
+gcc = """/usr/bin/gcc-4.2"""
+clang_info = """
+clang version 1.0 (https://ddunbar@llvm.org/svn/llvm-project/cfe/trunk 70266M)
+Target: x86_64-apple-darwin10
+ "/Volumes/Data/ddunbar/llvm.install/bin/../libexec/clang-cc" "-triple" "x86_64-apple-darwin10" "-S" "-disable-free" "-main-file-name" "null" "--relocation-model" "pic" "-pic-level=1" "--disable-fp-elim" "--unwind-tables=1" "--fmath-errno=0" "-mmacosx-version-min=10.6.0" "-fdiagnostics-show-option" "-o" "/var/folders/cl/clrOX6SaG+moCeRKEI4PtU+++TI/-Tmp-/cc-vpL9h3.s" "-x" "c" "/dev/null"
+ "/usr/libexec/gcc/i686-apple-darwin10/4.2.1/as" "-arch" "x86_64" "-force_cpusubtype_ALL" "-o" "/var/folders/cl/clrOX6SaG+moCeRKEI4PtU+++TI/-Tmp-/cc-qdRbcC.o" "/var/folders/cl/clrOX6SaG+moCeRKEI4PtU+++TI/-Tmp-/cc-vpL9h3.s"
+ "/usr/libexec/gcc/i686-apple-darwin10/4.2.1/ld" "-dynamic" "-arch" "x86_64" "-macosx_version_min" "10.6.0" "-weak_reference_mismatches" "non-weak" "-o" "a.out" "-lcrt1.10.6.o" "-L/usr/lib/gcc/i686-apple-darwin10/4.2.1/x86_64" "-L/usr/lib/gcc/i686-apple-darwin10/4.2.1/x86_64" "-L/usr/lib/i686-apple-darwin10/4.2.1" "-L/usr/lib/gcc/i686-apple-darwin10/4.2.1" "-L/usr/lib/gcc/i686-apple-darwin10/4.2.1" "-L/usr/lib/gcc/i686-apple-darwin10/4.2.1/../../../i686-apple-darwin10/4.2.1" "-L/usr/lib/gcc/i686-apple-darwin10/4.2.1/../../.." "/var/folders/cl/clrOX6SaG+moCeRKEI4PtU+++TI/-Tmp-/cc-qdRbcC.o" "-lSystem" "-lgcc"
+"""
+gcc_info = """
+Using built-in specs.
+Target: i686-apple-darwin10
+Configured with: /var/tmp/gcc/gcc-5646~6/src/configure --disable-checking --enable-werror --prefix=/usr --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ --with-slibdir=/usr/lib --build=i686-apple-darwin10 --with-gxx-include-dir=/include/c++/4.2.1 --program-prefix=i686-apple-darwin10- --host=x86_64-apple-darwin10 --target=i686-apple-darwin10
+Thread model: posix
+gcc version 4.2.1 (Apple Inc. build 5646)
+ "/usr/libexec/gcc/i686-apple-darwin10/4.2.1/cc1" "-quiet" "-imultilib" "x86_64" "-D__DYNAMIC__" "/dev/null" "-fPIC" "-quiet" "-dumpbase" "null" "-mmacosx-version-min=10.6.0" "-m64" "-mtune=core2" "-auxbase" "null" "-o" "/var/folders/cl/clrOX6SaG+moCeRKEI4PtU+++TI/-Tmp-//ccvaleXF.s"
+ "/usr/libexec/gcc/i686-apple-darwin10/4.2.1/as" "-arch" "x86_64" "-force_cpusubtype_ALL" "-o" "/var/folders/cl/clrOX6SaG+moCeRKEI4PtU+++TI/-Tmp-//ccV9sWHa.o" "/var/folders/cl/clrOX6SaG+moCeRKEI4PtU+++TI/-Tmp-//ccvaleXF.s"
+ "/usr/libexec/gcc/i686-apple-darwin10/4.2.1/collect2" "-dynamic" "-arch" "x86_64" "-macosx_version_min" "10.6.0" "-weak_reference_mismatches" "non-weak" "-o" "a.out" "-lcrt1.10.6.o" "-L/usr/lib/gcc/i686-apple-darwin10/4.2.1/x86_64" "-L/usr/lib/gcc/i686-apple-darwin10/4.2.1/x86_64" "-L/usr/lib/i686-apple-darwin10/4.2.1" "-L/usr/lib/gcc/i686-apple-darwin10/4.2.1" "-L/usr/lib/gcc/i686-apple-darwin10/4.2.1" "-L/usr/lib/gcc/i686-apple-darwin10/4.2.1/../../../i686-apple-darwin10/4.2.1" "-L/usr/lib/gcc/i686-apple-darwin10/4.2.1/../../.." "/var/folders/cl/clrOX6SaG+moCeRKEI4PtU+++TI/-Tmp-//ccV9sWHa.o" "-lSystem" "-lgcc" "-lSystem"
+"""
+style = """xcb"""
+runs = []
+runs.append(( { 'cc':"clang_pch",
+ 'script':"null",
+ 'threads':"8",
+ 'pch':"pch" },
+{ 'version' : 0,
+ 'samples' : [
+ (0, 0.454775, 0.429118, 0.894442),
+ (1, 0.456816, 0.263663, 0.473584),
+ (2, 0.455418, 0.263616, 0.471947),
+ (3, 0.457123, 0.264847, 0.476358),
+ (4, 0.455484, 0.265836, 0.472721),
+]}
+))
+runs.append(( { 'cc':"gcc",
+ 'script':"null",
+ 'threads':"8",
+ 'pch':"pch" },
+{ 'version' : 0,
+ 'samples' : [
+ (0, 0.456015, 0.267448, 0.475121),
+ (1, 0.457929, 0.266122, 0.474585),
+ (2, 0.457145, 0.265216, 0.474808),
+ (3, 0.458294, 0.263764, 0.475413),
+ (4, 0.457468, 0.262464, 0.475923),
+]}
+))
+runs.append(( { 'cc':"clang_pch",
+ 'script':"###",
+ 'threads':"8",
+ 'pch':"pch" },
+{ 'version' : 0,
+ 'samples' : [
+ (0, 0.486632, 0.345058, 0.560472),
+ (1, 0.493027, 0.344064, 0.516340),
+ (2, 0.492830, 0.342958, 0.515723),
+ (3, 0.490442, 0.345107, 0.516254),
+ (4, 0.496280, 0.343245, 0.518030),
+]}
+))
+runs.append(( { 'cc':"gcc",
+ 'script':"###",
+ 'threads':"8",
+ 'pch':"pch" },
+{ 'version' : 0,
+ 'samples' : [
+ (0, 0.514260, 0.372418, 0.544621),
+ (1, 0.513040, 0.372859, 0.536797),
+ (2, 0.512094, 0.370682, 0.534324),
+ (3, 0.512872, 0.373514,