diff --git a/clang.xcodeproj/project.pbxproj b/clang.xcodeproj/project.pbxproj new file mode 100644 index 00000000000..26be7bb0b71 --- /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 = ""; tabWidth = 2; }; + 03F50AC50D416EAA00B9CF60 /* Targets.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; path = Targets.cpp; sourceTree = ""; tabWidth = 2; }; + 1A14D3A60FD78A3F00DA2835 /* DeclPrinter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = DeclPrinter.cpp; path = lib/AST/DeclPrinter.cpp; sourceTree = ""; tabWidth = 2; }; + 1A2193CB0F45EEB700C0713D /* ABIInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = ABIInfo.h; path = lib/CodeGen/ABIInfo.h; sourceTree = ""; tabWidth = 2; }; + 1A2193CC0F45EEB700C0713D /* Mangle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = Mangle.cpp; path = lib/CodeGen/Mangle.cpp; sourceTree = ""; tabWidth = 2; }; + 1A2193CD0F45EEB700C0713D /* Mangle.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = Mangle.h; path = lib/CodeGen/Mangle.h; sourceTree = ""; tabWidth = 2; }; + 1A2A54A40FD1DD1C00F4CE45 /* AnalysisConsumer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AnalysisConsumer.cpp; path = lib/Frontend/AnalysisConsumer.cpp; sourceTree = ""; }; + 1A2A54A50FD1DD1C00F4CE45 /* ASTConsumers.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ASTConsumers.cpp; path = lib/Frontend/ASTConsumers.cpp; sourceTree = ""; }; + 1A2A54A60FD1DD1C00F4CE45 /* Backend.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Backend.cpp; path = lib/Frontend/Backend.cpp; sourceTree = ""; }; + 1A2A54A70FD1DD1C00F4CE45 /* CacheTokens.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CacheTokens.cpp; path = lib/Frontend/CacheTokens.cpp; sourceTree = ""; }; + 1A2A54A80FD1DD1C00F4CE45 /* DependencyFile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DependencyFile.cpp; path = lib/Frontend/DependencyFile.cpp; sourceTree = ""; }; + 1A2A54A90FD1DD1C00F4CE45 /* DiagChecker.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DiagChecker.cpp; path = lib/Frontend/DiagChecker.cpp; sourceTree = ""; }; + 1A2A54AA0FD1DD1C00F4CE45 /* DocumentXML.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DocumentXML.cpp; path = lib/Frontend/DocumentXML.cpp; sourceTree = ""; }; + 1A2A54AB0FD1DD1C00F4CE45 /* GeneratePCH.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = GeneratePCH.cpp; path = lib/Frontend/GeneratePCH.cpp; sourceTree = ""; }; + 1A2A54AC0FD1DD1C00F4CE45 /* HTMLPrint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = HTMLPrint.cpp; path = lib/Frontend/HTMLPrint.cpp; sourceTree = ""; }; + 1A2A54AD0FD1DD1C00F4CE45 /* PrintParserCallbacks.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PrintParserCallbacks.cpp; path = lib/Frontend/PrintParserCallbacks.cpp; sourceTree = ""; }; + 1A2A54AE0FD1DD1C00F4CE45 /* PrintPreprocessedOutput.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PrintPreprocessedOutput.cpp; path = lib/Frontend/PrintPreprocessedOutput.cpp; sourceTree = ""; }; + 1A2A54AF0FD1DD1C00F4CE45 /* RewriteBlocks.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RewriteBlocks.cpp; path = lib/Frontend/RewriteBlocks.cpp; sourceTree = ""; }; + 1A2A54B00FD1DD1C00F4CE45 /* RewriteMacros.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RewriteMacros.cpp; path = lib/Frontend/RewriteMacros.cpp; sourceTree = ""; }; + 1A2A54B10FD1DD1C00F4CE45 /* RewriteObjC.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RewriteObjC.cpp; path = lib/Frontend/RewriteObjC.cpp; sourceTree = ""; }; + 1A2A54B20FD1DD1C00F4CE45 /* RewriteTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RewriteTest.cpp; path = lib/Frontend/RewriteTest.cpp; sourceTree = ""; }; + 1A2A54B30FD1DD1C00F4CE45 /* StmtXML.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = StmtXML.cpp; path = lib/Frontend/StmtXML.cpp; sourceTree = ""; }; + 1A2A54B40FD1DD1C00F4CE45 /* Warnings.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Warnings.cpp; path = lib/Frontend/Warnings.cpp; sourceTree = ""; }; + 1A30A9E80B93A4C800201A91 /* ExprCXX.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = ExprCXX.h; path = clang/AST/ExprCXX.h; sourceTree = ""; tabWidth = 2; }; + 1A32C17E0E1C87AD00A6B483 /* ExprConstant.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = ExprConstant.cpp; path = lib/AST/ExprConstant.cpp; sourceTree = ""; tabWidth = 2; }; + 1A376A2C0D4AED9B002A1C52 /* CGExprConstant.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = CGExprConstant.cpp; path = lib/CodeGen/CGExprConstant.cpp; sourceTree = ""; tabWidth = 2; }; + 1A410F840FBCE51100351440 /* SemaTemplateInstantiateExpr.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = SemaTemplateInstantiateExpr.cpp; path = lib/Sema/SemaTemplateInstantiateExpr.cpp; sourceTree = ""; tabWidth = 2; }; + 1A471AB40F437BC500753CE8 /* CGBlocks.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = CGBlocks.cpp; path = lib/CodeGen/CGBlocks.cpp; sourceTree = ""; tabWidth = 2; }; + 1A5119C30FBDF71000A1FF22 /* SemaTemplateInstantiateStmt.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = SemaTemplateInstantiateStmt.cpp; path = lib/Sema/SemaTemplateInstantiateStmt.cpp; sourceTree = ""; tabWidth = 2; }; + 1A5D5E570E5E81010023C059 /* CGCXX.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = CGCXX.cpp; path = lib/CodeGen/CGCXX.cpp; sourceTree = ""; tabWidth = 2; }; + 1A649E1D0F9599D9005B965E /* CGBlocks.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CGBlocks.h; path = lib/CodeGen/CGBlocks.h; sourceTree = ""; }; + 1A649E1E0F9599DA005B965E /* CGCXX.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CGCXX.h; path = lib/CodeGen/CGCXX.h; sourceTree = ""; }; + 1A6FE7080FD6F85800E00CA9 /* CGCXXTemp.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = CGCXXTemp.cpp; path = lib/CodeGen/CGCXXTemp.cpp; sourceTree = ""; tabWidth = 2; }; + 1A7019E90F79BC1100FEC4D1 /* DiagnosticAnalysisKinds.td */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DiagnosticAnalysisKinds.td; sourceTree = ""; }; + 1A7019EA0F79BC1100FEC4D1 /* DiagnosticASTKinds.td */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DiagnosticASTKinds.td; sourceTree = ""; }; + 1A7019EB0F79BC1100FEC4D1 /* DiagnosticCommonKinds.td */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DiagnosticCommonKinds.td; sourceTree = ""; }; + 1A7019EC0F79BC1100FEC4D1 /* DiagnosticDriverKinds.td */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DiagnosticDriverKinds.td; sourceTree = ""; }; + 1A7019ED0F79BC1100FEC4D1 /* DiagnosticFrontendKinds.td */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DiagnosticFrontendKinds.td; sourceTree = ""; }; + 1A7019EE0F79BC1100FEC4D1 /* DiagnosticLexKinds.td */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DiagnosticLexKinds.td; sourceTree = ""; }; + 1A7019EF0F79BC1100FEC4D1 /* DiagnosticParseKinds.td */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DiagnosticParseKinds.td; sourceTree = ""; }; + 1A701A250F79CE1C00FEC4D1 /* DiagnosticSemaKinds.td */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DiagnosticSemaKinds.td; sourceTree = ""; }; + 1A701B630F7C8FE400FEC4D1 /* SemaAccess.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = SemaAccess.cpp; path = lib/Sema/SemaAccess.cpp; sourceTree = ""; tabWidth = 2; }; + 1A72BEAC0D641E9400B085E9 /* Attr.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = Attr.h; path = clang/AST/Attr.h; sourceTree = ""; tabWidth = 2; }; + 1A7342470C7B57D500122F56 /* CGObjC.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = CGObjC.cpp; path = lib/CodeGen/CGObjC.cpp; sourceTree = ""; tabWidth = 2; }; + 1A869A6E0BA2164C008DA07A /* LiteralSupport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LiteralSupport.h; sourceTree = ""; }; + 1A869AA70BA21ABA008DA07A /* LiteralSupport.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = LiteralSupport.cpp; sourceTree = ""; }; + 1ABC36930C7A4BDC006DB0AB /* CGBuiltin.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = CGBuiltin.cpp; path = lib/CodeGen/CGBuiltin.cpp; sourceTree = ""; tabWidth = 2; }; + 1ADF47AE0F782C3200E48A8A /* SemaTemplateInstantiateDecl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = SemaTemplateInstantiateDecl.cpp; path = lib/Sema/SemaTemplateInstantiateDecl.cpp; sourceTree = ""; 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 = ""; tabWidth = 2; }; + 3507E4C10E27FE2D00FB7B57 /* CheckObjCInstMethSignature.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CheckObjCInstMethSignature.cpp; path = lib/Analysis/CheckObjCInstMethSignature.cpp; sourceTree = ""; }; + 352246E10F5C6BE000D0D279 /* HTMLDiagnostics.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = HTMLDiagnostics.cpp; path = lib/Frontend/HTMLDiagnostics.cpp; sourceTree = ""; }; + 352246E20F5C6BE000D0D279 /* InitHeaderSearch.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = InitHeaderSearch.cpp; path = lib/Frontend/InitHeaderSearch.cpp; sourceTree = ""; }; + 352246E30F5C6BE000D0D279 /* ManagerRegistry.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ManagerRegistry.cpp; path = lib/Frontend/ManagerRegistry.cpp; sourceTree = ""; }; + 352246E40F5C6BE000D0D279 /* PlistDiagnostics.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PlistDiagnostics.cpp; path = lib/Frontend/PlistDiagnostics.cpp; sourceTree = ""; }; + 352246E50F5C6BE000D0D279 /* TextDiagnosticBuffer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TextDiagnosticBuffer.cpp; path = lib/Frontend/TextDiagnosticBuffer.cpp; sourceTree = ""; }; + 352246E60F5C6BE000D0D279 /* TextDiagnosticPrinter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TextDiagnosticPrinter.cpp; path = lib/Frontend/TextDiagnosticPrinter.cpp; sourceTree = ""; }; + 35260CA40C7F75C000D66CE9 /* ExprCXX.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = ExprCXX.cpp; path = lib/AST/ExprCXX.cpp; sourceTree = ""; tabWidth = 2; }; + 3527124F0DAFE54700C76352 /* IdentifierResolver.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = IdentifierResolver.h; path = lib/Sema/IdentifierResolver.h; sourceTree = ""; tabWidth = 2; }; + 352712500DAFE54700C76352 /* IdentifierResolver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = IdentifierResolver.cpp; path = lib/Sema/IdentifierResolver.cpp; sourceTree = ""; tabWidth = 2; }; + 352C19DC0CA321C80045DB98 /* CFGRecStmtDeclVisitor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CFGRecStmtDeclVisitor.h; path = clang/Analysis/Visitors/CFGRecStmtDeclVisitor.h; sourceTree = ""; }; + 352C19DD0CA321C80045DB98 /* CFGRecStmtVisitor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CFGRecStmtVisitor.h; path = clang/Analysis/Visitors/CFGRecStmtVisitor.h; sourceTree = ""; }; + 352C19DE0CA321C80045DB98 /* CFGStmtVisitor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CFGStmtVisitor.h; path = clang/Analysis/Visitors/CFGStmtVisitor.h; sourceTree = ""; }; + 352C19DF0CA321C80045DB98 /* CFGVarDeclVisitor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CFGVarDeclVisitor.h; path = clang/Analysis/Visitors/CFGVarDeclVisitor.h; sourceTree = ""; }; + 3534A01C0E129849002709B2 /* ParseCXXInlineMethods.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = ParseCXXInlineMethods.cpp; path = lib/Parse/ParseCXXInlineMethods.cpp; sourceTree = ""; tabWidth = 2; }; + 3536456A0E23EBF7009C6509 /* Environment.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Environment.cpp; path = lib/Analysis/Environment.cpp; sourceTree = ""; }; + 3536457C0E2406B0009C6509 /* Environment.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Environment.h; path = clang/Analysis/PathSensitive/Environment.h; sourceTree = ""; }; + 3537AA0C0ECD088F008F7CDC /* BlkExprDeclBitVector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BlkExprDeclBitVector.h; path = clang/Analysis/Support/BlkExprDeclBitVector.h; sourceTree = ""; }; + 3537AA0D0ECD08A4008F7CDC /* PreprocessorLexer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PreprocessorLexer.cpp; sourceTree = ""; }; + 3538FDB60ED24A2C005EC283 /* DeclarationName.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = DeclarationName.h; path = clang/AST/DeclarationName.h; sourceTree = ""; tabWidth = 2; }; + 3538FDB70ED24A4E005EC283 /* DeclarationName.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DeclarationName.cpp; path = lib/AST/DeclarationName.cpp; sourceTree = ""; }; + 353959D40EE5F88A00E82461 /* ParseTemplate.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = ParseTemplate.cpp; path = lib/Parse/ParseTemplate.cpp; sourceTree = ""; tabWidth = 2; }; + 3547129D0C88881300B3E1D5 /* PrettyPrinter.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = PrettyPrinter.h; path = clang/AST/PrettyPrinter.h; sourceTree = ""; tabWidth = 2; }; + 35475B1F0E79973F0000BFE4 /* CGCall.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = CGCall.cpp; path = lib/CodeGen/CGCall.cpp; sourceTree = ""; tabWidth = 2; }; + 35475B220E7997680000BFE4 /* CGCall.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = CGCall.h; path = lib/CodeGen/CGCall.h; sourceTree = ""; tabWidth = 2; }; + 35475B230E7997680000BFE4 /* CGValue.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = CGValue.h; path = lib/CodeGen/CGValue.h; sourceTree = ""; tabWidth = 2; }; + 355106850E9A8507006A4E44 /* MemRegion.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = MemRegion.cpp; path = lib/Analysis/MemRegion.cpp; sourceTree = ""; }; + 355106880E9A851B006A4E44 /* MemRegion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MemRegion.h; path = clang/Analysis/PathSensitive/MemRegion.h; sourceTree = ""; }; + 3551068A0E9A8546006A4E44 /* ParsePragma.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = ParsePragma.cpp; path = lib/Parse/ParsePragma.cpp; sourceTree = ""; tabWidth = 2; }; + 3551068B0E9A8546006A4E44 /* ParseTentative.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = ParseTentative.cpp; path = lib/Parse/ParseTentative.cpp; sourceTree = ""; tabWidth = 2; }; + 3551068E0E9A855F006A4E44 /* AccessSpecifier.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = AccessSpecifier.h; path = clang/Parse/AccessSpecifier.h; sourceTree = ""; tabWidth = 2; }; + 3551068F0E9A857C006A4E44 /* ParsePragma.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = ParsePragma.h; path = lib/Parse/ParsePragma.h; sourceTree = ""; tabWidth = 2; }; + 3552E7540E520D80003A8CA5 /* PPCaching.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PPCaching.cpp; sourceTree = ""; }; + 3552E7580E520DD7003A8CA5 /* CGObjCMac.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = CGObjCMac.cpp; path = lib/CodeGen/CGObjCMac.cpp; sourceTree = ""; tabWidth = 2; }; + 3553EB9A0E5F7089007D7359 /* GRStateTrait.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GRStateTrait.h; path = clang/Analysis/PathSensitive/GRStateTrait.h; sourceTree = ""; }; + 35544B850F5C7FD700D92AA9 /* RangeConstraintManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RangeConstraintManager.cpp; path = lib/Analysis/RangeConstraintManager.cpp; sourceTree = ""; }; + 35544B860F5C7FD700D92AA9 /* SimpleConstraintManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SimpleConstraintManager.cpp; path = lib/Analysis/SimpleConstraintManager.cpp; sourceTree = ""; }; + 35544B870F5C7FD700D92AA9 /* SimpleConstraintManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SimpleConstraintManager.h; path = lib/Analysis/SimpleConstraintManager.h; sourceTree = ""; }; + 35544B8B0F5C803200D92AA9 /* SemaTemplateInstantiate.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = SemaTemplateInstantiate.cpp; path = lib/Sema/SemaTemplateInstantiate.cpp; sourceTree = ""; tabWidth = 2; }; + 3557D1A80EB136B100C59739 /* InheritViz.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = InheritViz.cpp; path = lib/AST/InheritViz.cpp; sourceTree = ""; tabWidth = 2; }; + 3557D1EF0EB13BB700C59739 /* SemaInherit.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = SemaInherit.cpp; path = lib/Sema/SemaInherit.cpp; sourceTree = ""; tabWidth = 2; }; + 35585DBD0EAFBC4500D0A97A /* CXXFieldCollector.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = CXXFieldCollector.h; path = lib/Sema/CXXFieldCollector.h; sourceTree = ""; tabWidth = 2; }; + 35585DBE0EAFBC4500D0A97A /* SemaOverload.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = SemaOverload.cpp; path = lib/Sema/SemaOverload.cpp; sourceTree = ""; tabWidth = 2; }; + 35585DBF0EAFBC4500D0A97A /* SemaOverload.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = SemaOverload.h; path = lib/Sema/SemaOverload.h; sourceTree = ""; tabWidth = 2; }; + 3558F76C0E267C8300A5B0DF /* BasicStore.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = BasicStore.cpp; path = lib/Analysis/BasicStore.cpp; sourceTree = ""; }; + 3558F76F0E267C9A00A5B0DF /* Store.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Store.h; path = clang/Analysis/PathSensitive/Store.h; sourceTree = ""; }; + 355CF6820C90A8B600A08AA3 /* LocalCheckers.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LocalCheckers.h; path = clang/Analysis/LocalCheckers.h; sourceTree = ""; }; + 356B89760D9BFDC100CBEBE9 /* BasicObjCFoundationChecks.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BasicObjCFoundationChecks.h; path = lib/Analysis/BasicObjCFoundationChecks.h; sourceTree = ""; }; + 356EF9B40C8F7DDF006650F5 /* LiveVariables.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LiveVariables.cpp; path = lib/Analysis/LiveVariables.cpp; sourceTree = ""; }; + 35707EFD0CD0F5CC000B2204 /* SourceLocation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; path = SourceLocation.cpp; sourceTree = ""; tabWidth = 2; }; + 357EA27C0F2526F300439B60 /* SemaLookup.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = SemaLookup.cpp; path = lib/Sema/SemaLookup.cpp; sourceTree = ""; tabWidth = 2; }; + 35847BE30CC7DB9000C40FFF /* StmtIterator.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = StmtIterator.h; path = clang/AST/StmtIterator.h; sourceTree = ""; tabWidth = 2; }; + 35847BE40CC7DBAF00C40FFF /* StmtIterator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = StmtIterator.cpp; path = lib/AST/StmtIterator.cpp; sourceTree = ""; tabWidth = 2; }; + 35862B0C0E3628CB0009F542 /* CheckDeadStores.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CheckDeadStores.cpp; path = lib/Analysis/CheckDeadStores.cpp; sourceTree = ""; }; + 35862B110E3629850009F542 /* GRExprEngineInternalChecks.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = GRExprEngineInternalChecks.cpp; path = lib/Analysis/GRExprEngineInternalChecks.cpp; sourceTree = ""; }; + 358CFBB70E65AB04002A8E19 /* BasicConstraintManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = BasicConstraintManager.cpp; path = lib/Analysis/BasicConstraintManager.cpp; sourceTree = ""; }; + 358D23090E8BEB850003DDCC /* DeclGroup.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = DeclGroup.h; path = clang/AST/DeclGroup.h; sourceTree = ""; tabWidth = 2; }; + 358D230A0E8BEB9D0003DDCC /* DeclGroup.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = DeclGroup.cpp; path = lib/AST/DeclGroup.cpp; sourceTree = ""; tabWidth = 2; }; + 358F514F0E529A87007F2102 /* GRState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GRState.h; path = clang/Analysis/PathSensitive/GRState.h; sourceTree = ""; }; + 358F51510E529AA4007F2102 /* GRState.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = GRState.cpp; path = lib/Analysis/GRState.cpp; sourceTree = ""; }; + 3591853E0EFB1088000039AF /* SemaTemplate.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = SemaTemplate.cpp; path = lib/Sema/SemaTemplate.cpp; sourceTree = ""; tabWidth = 2; }; + 359378FF0DA486490043B19C /* BugReporter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BugReporter.h; path = clang/Analysis/PathSensitive/BugReporter.h; sourceTree = ""; }; + 359379090DA48ABA0043B19C /* BugReporter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = BugReporter.cpp; path = lib/Analysis/BugReporter.cpp; sourceTree = ""; }; + 3595AFB70E1C8D62004CDF09 /* CheckObjCDealloc.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CheckObjCDealloc.cpp; path = lib/Analysis/CheckObjCDealloc.cpp; sourceTree = ""; }; + 3598EBEB0EDE23EF0070CA16 /* PTHManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PTHManager.h; sourceTree = ""; }; + 3599299A0DE2425300A8A33E /* SemaInit.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = SemaInit.cpp; path = lib/Sema/SemaInit.cpp; sourceTree = ""; tabWidth = 2; }; + 35A057D20EAE2D2B0069249F /* SVals.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SVals.h; path = clang/Analysis/PathSensitive/SVals.h; sourceTree = ""; }; + 35A057E00EAE2D950069249F /* RegionStore.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegionStore.cpp; path = lib/Analysis/RegionStore.cpp; sourceTree = ""; }; + 35A057E10EAE2D950069249F /* SVals.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SVals.cpp; path = lib/Analysis/SVals.cpp; sourceTree = ""; }; + 35A3E7000DD3874400757F74 /* CGDebugInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = CGDebugInfo.cpp; path = lib/CodeGen/CGDebugInfo.cpp; sourceTree = ""; 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 = ""; tabWidth = 2; }; + 35A8FCF60D9B4ADD001C2F97 /* ProgramPoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ProgramPoint.h; path = clang/Analysis/ProgramPoint.h; sourceTree = ""; }; + 35A8FCF70D9B4ADD001C2F97 /* PathDiagnostic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PathDiagnostic.h; path = clang/Analysis/PathDiagnostic.h; sourceTree = ""; }; + 35A8FCF80D9B4B29001C2F97 /* PathDiagnostic.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PathDiagnostic.cpp; path = lib/Analysis/PathDiagnostic.cpp; sourceTree = ""; }; + 35B820740ECB811A0020BEC0 /* PreprocessorLexer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PreprocessorLexer.h; sourceTree = ""; }; + 35BAC1E70E82C5B7003FB76F /* CheckNSError.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CheckNSError.cpp; path = lib/Analysis/CheckNSError.cpp; sourceTree = ""; }; + 35BB2D7E0D19954000944DB5 /* ASTConsumer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = ASTConsumer.cpp; path = lib/AST/ASTConsumer.cpp; sourceTree = ""; tabWidth = 2; }; + 35BFBD2B0C9EDE1E006CB644 /* ASTConsumer.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = ASTConsumer.h; path = clang/AST/ASTConsumer.h; sourceTree = ""; tabWidth = 2; }; + 35CEA05A0DF9E82700A41296 /* ExprObjC.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = ExprObjC.h; path = clang/AST/ExprObjC.h; sourceTree = ""; tabWidth = 2; }; + 35CFFDFF0CA1CBCB00E6F2BE /* StmtViz.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = StmtViz.cpp; path = lib/AST/StmtViz.cpp; sourceTree = ""; tabWidth = 2; }; + 35CFFE010CA1CBDD00E6F2BE /* StmtGraphTraits.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = StmtGraphTraits.h; path = clang/AST/StmtGraphTraits.h; sourceTree = ""; tabWidth = 2; }; + 35D1DDD10CA9C6D50096E967 /* DataflowSolver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DataflowSolver.h; path = clang/Analysis/FlowSensitive/DataflowSolver.h; sourceTree = ""; }; + 35D1DDD20CA9C6D50096E967 /* DataflowValues.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DataflowValues.h; path = clang/Analysis/FlowSensitive/DataflowValues.h; sourceTree = ""; }; + 35D55B240D81D8C60092E734 /* BasicValueFactory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = BasicValueFactory.cpp; path = lib/Analysis/BasicValueFactory.cpp; sourceTree = ""; }; + 35D55B250D81D8C60092E734 /* CFRefCount.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CFRefCount.cpp; path = lib/Analysis/CFRefCount.cpp; sourceTree = ""; }; + 35D55B290D81D8E50092E734 /* BasicValueFactory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BasicValueFactory.h; path = clang/Analysis/PathSensitive/BasicValueFactory.h; sourceTree = ""; }; + 35E194670ECB82FB00F21733 /* SemaCXXScopeSpec.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = SemaCXXScopeSpec.cpp; path = lib/Sema/SemaCXXScopeSpec.cpp; sourceTree = ""; tabWidth = 2; }; + 35E194680ECB82FB00F21733 /* SemaNamedCast.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = SemaNamedCast.cpp; path = lib/Sema/SemaNamedCast.cpp; sourceTree = ""; tabWidth = 2; }; + 35E1946C0ECB83C100F21733 /* PTHLexer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PTHLexer.cpp; sourceTree = ""; }; + 35EE48AD0E0C4CB200715C54 /* DeclCXX.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = DeclCXX.h; path = clang/AST/DeclCXX.h; sourceTree = ""; tabWidth = 2; }; + 35EE48AE0E0C4CB200715C54 /* ParentMap.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = ParentMap.h; path = clang/AST/ParentMap.h; sourceTree = ""; tabWidth = 2; }; + 35EE48AF0E0C4CCA00715C54 /* DeclCXX.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = DeclCXX.cpp; path = lib/AST/DeclCXX.cpp; sourceTree = ""; tabWidth = 2; }; + 35EE48B00E0C4CCA00715C54 /* ParentMap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = ParentMap.cpp; path = lib/AST/ParentMap.cpp; sourceTree = ""; tabWidth = 2; }; + 35EF676F0DAD1D2C00B19414 /* SemaDeclCXX.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = SemaDeclCXX.cpp; path = lib/Sema/SemaDeclCXX.cpp; sourceTree = ""; tabWidth = 2; }; + 35EFEFB50DB67ED60020783D /* GRTransferFuncs.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = GRTransferFuncs.cpp; path = lib/Analysis/GRTransferFuncs.cpp; sourceTree = ""; }; + 35F1ACE60E66166C001F4532 /* ConstraintManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ConstraintManager.h; path = clang/Analysis/PathSensitive/ConstraintManager.h; sourceTree = ""; }; + 35F2A01D0E36AFF100D17527 /* CheckObjCUnusedIVars.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CheckObjCUnusedIVars.cpp; path = lib/Analysis/CheckObjCUnusedIVars.cpp; sourceTree = ""; }; + 35F2BE7B0DAC2963006E7668 /* HTMLRewrite.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HTMLRewrite.h; path = clang/Rewrite/HTMLRewrite.h; sourceTree = ""; }; + 35F8D0CA0D9B7E8200D91C5E /* GRSimpleAPICheck.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GRSimpleAPICheck.h; path = clang/Analysis/PathSensitive/GRSimpleAPICheck.h; sourceTree = ""; }; + 35F8D0CB0D9B7E8200D91C5E /* GRAuditor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GRAuditor.h; path = clang/Analysis/PathSensitive/GRAuditor.h; sourceTree = ""; }; + 35F8D0D50D9B82CD00D91C5E /* BasicObjCFoundationChecks.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = BasicObjCFoundationChecks.cpp; path = lib/Analysis/BasicObjCFoundationChecks.cpp; sourceTree = ""; }; + 35F9B1550D1C6B2E00DDFDAE /* LiveVariables.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LiveVariables.h; path = clang/Analysis/Analyses/LiveVariables.h; sourceTree = ""; }; + 35F9B1560D1C6B2E00DDFDAE /* UninitializedValues.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = UninitializedValues.h; path = clang/Analysis/Analyses/UninitializedValues.h; sourceTree = ""; }; + 35FE6BCE0DF6EE1F00739712 /* DeclBase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = DeclBase.cpp; path = lib/AST/DeclBase.cpp; sourceTree = ""; tabWidth = 2; }; + 72D16C1E0D9975C400E6DA4A /* HTMLRewrite.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = HTMLRewrite.cpp; path = lib/Rewrite/HTMLRewrite.cpp; sourceTree = ""; }; + 84AF36A00CB17A3B00C820A5 /* DeclObjC.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = DeclObjC.h; path = clang/AST/DeclObjC.h; sourceTree = ""; tabWidth = 2; }; + 84D9A8870C1A57E100AC7ABC /* AttributeList.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = AttributeList.cpp; path = lib/Parse/AttributeList.cpp; sourceTree = ""; tabWidth = 2; }; + 84D9A88B0C1A581300AC7ABC /* AttributeList.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = AttributeList.h; path = clang/Parse/AttributeList.h; sourceTree = ""; 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 = ""; }; + 9063F2220F9E8BDF002F7251 /* SemaConsumer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SemaConsumer.h; path = clang/Sema/SemaConsumer.h; sourceTree = ""; }; + 9063F2280F9E911F002F7251 /* OnDiskHashTable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OnDiskHashTable.h; sourceTree = ""; }; + 9063F2290F9E911F002F7251 /* SourceManagerInternals.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SourceManagerInternals.h; sourceTree = ""; }; + 9063F22A0F9E911F002F7251 /* TemplateKinds.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TemplateKinds.h; sourceTree = ""; }; + 906BF4AE0F83BA16001071FA /* ConvertUTF.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ConvertUTF.h; sourceTree = ""; }; + 906BF4AF0F83BA2E001071FA /* ConvertUTF.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ConvertUTF.c; sourceTree = ""; }; + 90FB99DE0F98FB1D008F9415 /* DeclContextInternals.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DeclContextInternals.h; path = clang/AST/DeclContextInternals.h; sourceTree = ""; }; + 90FB99DF0F98FB1D008F9415 /* DeclVisitor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DeclVisitor.h; path = clang/AST/DeclVisitor.h; sourceTree = ""; }; + 90FB99E00F98FB1D008F9415 /* ExternalASTSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ExternalASTSource.h; path = clang/AST/ExternalASTSource.h; sourceTree = ""; }; + BDF87CF60FD746F300BBF872 /* SemaTemplateDeduction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = SemaTemplateDeduction.cpp; path = lib/Sema/SemaTemplateDeduction.cpp; sourceTree = ""; tabWidth = 2; }; + DE01DA480B12ADA300AC22CE /* PPCallbacks.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = PPCallbacks.h; sourceTree = ""; }; + DE06756B0C051CFE00EBBFD8 /* ParseExprCXX.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = ParseExprCXX.cpp; path = lib/Parse/ParseExprCXX.cpp; sourceTree = ""; tabWidth = 2; }; + DE06B73D0A8307640050E87E /* LangOptions.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.c.h; path = LangOptions.h; sourceTree = ""; tabWidth = 2; }; + DE06BECA0A854E4B0050E87E /* Scope.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = Scope.h; path = clang/Parse/Scope.h; sourceTree = ""; tabWidth = 2; }; + DE06D42F0A8BB52D0050E87E /* Parser.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = Parser.cpp; path = lib/Parse/Parser.cpp; sourceTree = ""; tabWidth = 2; }; + DE06E8130A8FF9330050E87E /* Action.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = Action.h; path = clang/Parse/Action.h; sourceTree = ""; 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 = ""; tabWidth = 2; }; + DE0FCB330A9C21F100248FD5 /* Expr.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = Expr.cpp; path = lib/AST/Expr.cpp; sourceTree = ""; tabWidth = 2; }; + DE1263C20EF2341900F56D2B /* Ownership.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = Ownership.h; path = clang/Parse/Ownership.h; sourceTree = ""; tabWidth = 2; }; + DE1732FF0B068B700080B521 /* ASTContext.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = ASTContext.cpp; path = lib/AST/ASTContext.cpp; sourceTree = ""; tabWidth = 2; }; + DE17336D0B068DC20080B521 /* DeclSpec.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = DeclSpec.cpp; path = lib/Parse/DeclSpec.cpp; sourceTree = ""; tabWidth = 2; }; + DE17336F0B068DC60080B521 /* DeclSpec.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = DeclSpec.h; path = clang/Parse/DeclSpec.h; sourceTree = ""; tabWidth = 2; }; + DE1F22020A7D852A00FBF588 /* Parser.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = Parser.h; path = clang/Parse/Parser.h; sourceTree = ""; tabWidth = 2; }; + DE224FF70C7AA98800D370A5 /* CGExprComplex.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = CGExprComplex.cpp; path = lib/CodeGen/CGExprComplex.cpp; sourceTree = ""; tabWidth = 2; }; + DE22526F0C7E82D000D370A5 /* CGExprScalar.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = CGExprScalar.cpp; path = lib/CodeGen/CGExprScalar.cpp; sourceTree = ""; tabWidth = 2; }; + DE2255FB0C8004E600D370A5 /* ParseDeclCXX.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = ParseDeclCXX.cpp; path = lib/Parse/ParseDeclCXX.cpp; sourceTree = ""; tabWidth = 2; }; + DE22BCF10E14197E0094DC60 /* SemaDeclAttr.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = SemaDeclAttr.cpp; path = lib/Sema/SemaDeclAttr.cpp; sourceTree = ""; tabWidth = 2; }; + DE344AB70AE5DF6D00DBC861 /* HeaderSearch.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = HeaderSearch.h; sourceTree = ""; }; + DE344B530AE5E46C00DBC861 /* HeaderSearch.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = HeaderSearch.cpp; sourceTree = ""; }; + DE3450D60AEB543100DBC861 /* DirectoryLookup.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DirectoryLookup.h; sourceTree = ""; }; + DE3452400AEF1A2D00DBC861 /* Stmt.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = Stmt.cpp; path = lib/AST/Stmt.cpp; sourceTree = ""; tabWidth = 2; }; + DE3452800AEF1B1800DBC861 /* Stmt.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = Stmt.h; path = clang/AST/Stmt.h; sourceTree = ""; tabWidth = 2; }; + DE345C190AFC658B00DBC861 /* StmtVisitor.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = StmtVisitor.h; path = clang/AST/StmtVisitor.h; sourceTree = ""; tabWidth = 2; }; + DE345F210AFD347900DBC861 /* StmtNodes.def */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = text; name = StmtNodes.def; path = clang/AST/StmtNodes.def; sourceTree = ""; tabWidth = 2; }; + DE345FFF0AFDCC1900DBC861 /* ParseObjc.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = ParseObjc.cpp; path = lib/Parse/ParseObjc.cpp; sourceTree = ""; tabWidth = 2; }; + DE3460040AFDCC6500DBC861 /* ParseInit.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = ParseInit.cpp; path = lib/Parse/ParseInit.cpp; sourceTree = ""; tabWidth = 2; }; + DE34600A0AFDCCBF00DBC861 /* ParseStmt.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = ParseStmt.cpp; path = lib/Parse/ParseStmt.cpp; sourceTree = ""; tabWidth = 2; }; + DE34600E0AFDCCCE00DBC861 /* ParseDecl.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = ParseDecl.cpp; path = lib/Parse/ParseDecl.cpp; sourceTree = ""; tabWidth = 2; }; + DE3460120AFDCCDA00DBC861 /* ParseExpr.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = ParseExpr.cpp; path = lib/Parse/ParseExpr.cpp; sourceTree = ""; tabWidth = 2; }; + DE3461260AFE68BE00DBC861 /* MinimalAction.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = MinimalAction.cpp; path = lib/Parse/MinimalAction.cpp; sourceTree = ""; tabWidth = 2; }; + DE34621C0AFEB19B00DBC861 /* StmtPrinter.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = StmtPrinter.cpp; path = lib/AST/StmtPrinter.cpp; sourceTree = ""; tabWidth = 2; }; + DE3464210B03040900DBC861 /* Type.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = Type.h; path = clang/AST/Type.h; sourceTree = ""; tabWidth = 2; }; + DE37251C0FE4818000CF2CC2 /* Builtins.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Builtins.h; sourceTree = ""; }; + DE37252A0FE4818F00CF2CC2 /* Builtins.def */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Builtins.def; sourceTree = ""; }; + DE37252D0FE481AD00CF2CC2 /* Builtins.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Builtins.cpp; sourceTree = ""; }; + DE3725310FE4822800CF2CC2 /* TargetBuiltins.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TargetBuiltins.h; sourceTree = ""; }; + DE3725320FE4826C00CF2CC2 /* BuiltinsX86.def */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = BuiltinsX86.def; sourceTree = ""; }; + DE3725330FE4827200CF2CC2 /* BuiltinsPPC.def */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = BuiltinsPPC.def; sourceTree = ""; }; + DE38CD4E0D794CF900A273B6 /* CGObjCRuntime.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = CGObjCRuntime.h; path = lib/CodeGen/CGObjCRuntime.h; sourceTree = ""; tabWidth = 2; }; + DE38CD4F0D794D0100A273B6 /* CGObjCGNU.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = CGObjCGNU.cpp; path = lib/CodeGen/CGObjCGNU.cpp; sourceTree = ""; tabWidth = 2; }; + DE38CF260D8C9E6C00A273B6 /* DeclObjC.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = DeclObjC.cpp; path = lib/AST/DeclObjC.cpp; sourceTree = ""; tabWidth = 2; }; + DE3986EF0CB8D4B300223765 /* IdentifierTable.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.c.h; path = IdentifierTable.h; sourceTree = ""; tabWidth = 2; }; + DE3986F30CB8D50C00223765 /* IdentifierTable.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; path = IdentifierTable.cpp; sourceTree = ""; tabWidth = 2; }; + DE3B90DE0EAC5EF200D01046 /* ExtensionRAIIObject.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = ExtensionRAIIObject.h; path = lib/Parse/ExtensionRAIIObject.h; sourceTree = ""; tabWidth = 2; }; + DE3B921C0EB1A81400D01046 /* SemaInherit.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = SemaInherit.h; path = lib/Sema/SemaInherit.h; sourceTree = ""; tabWidth = 2; }; + DE3B92230EB5152000D01046 /* Designator.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = Designator.h; path = clang/Parse/Designator.h; sourceTree = ""; tabWidth = 2; }; + DE41211D0D7F1BBE0080F80A /* GRWorkList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GRWorkList.h; path = clang/Analysis/PathSensitive/GRWorkList.h; sourceTree = ""; }; + DE41211E0D7F1BBE0080F80A /* SymbolManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SymbolManager.h; path = clang/Analysis/PathSensitive/SymbolManager.h; sourceTree = ""; }; + DE41211F0D7F1BBE0080F80A /* GRBlockCounter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GRBlockCounter.h; path = clang/Analysis/PathSensitive/GRBlockCounter.h; sourceTree = ""; }; + DE4121200D7F1BBE0080F80A /* ExplodedGraph.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ExplodedGraph.h; path = clang/Analysis/PathSensitive/ExplodedGraph.h; sourceTree = ""; }; + DE4121210D7F1BBE0080F80A /* GRExprEngine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GRExprEngine.h; path = clang/Analysis/PathSensitive/GRExprEngine.h; sourceTree = ""; }; + DE4121220D7F1BBE0080F80A /* GRTransferFuncs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GRTransferFuncs.h; path = clang/Analysis/PathSensitive/GRTransferFuncs.h; sourceTree = ""; }; + DE4121230D7F1BBE0080F80A /* GRCoreEngine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GRCoreEngine.h; path = clang/Analysis/PathSensitive/GRCoreEngine.h; sourceTree = ""; }; + DE4121270D7F1C1C0080F80A /* SymbolManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SymbolManager.cpp; path = lib/Analysis/SymbolManager.cpp; sourceTree = ""; }; + DE4121280D7F1C1C0080F80A /* ExplodedGraph.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ExplodedGraph.cpp; path = lib/Analysis/ExplodedGraph.cpp; sourceTree = ""; }; + DE4121290D7F1C1C0080F80A /* UninitializedValues.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = UninitializedValues.cpp; path = lib/Analysis/UninitializedValues.cpp; sourceTree = ""; }; + DE41212A0D7F1C1C0080F80A /* GRCoreEngine.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = GRCoreEngine.cpp; path = lib/Analysis/GRCoreEngine.cpp; sourceTree = ""; }; + DE41212C0D7F1C1C0080F80A /* GRSimpleVals.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GRSimpleVals.h; path = lib/Analysis/GRSimpleVals.h; sourceTree = ""; }; + DE41212F0D7F1C1C0080F80A /* GRSimpleVals.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = GRSimpleVals.cpp; path = lib/Analysis/GRSimpleVals.cpp; sourceTree = ""; }; + DE4121300D7F1C1C0080F80A /* GRBlockCounter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = GRBlockCounter.cpp; path = lib/Analysis/GRBlockCounter.cpp; sourceTree = ""; }; + DE4121310D7F1C1C0080F80A /* GRExprEngine.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = GRExprEngine.cpp; path = lib/Analysis/GRExprEngine.cpp; sourceTree = ""; }; + DE4264FB0C113592005A861D /* CGDecl.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = CGDecl.cpp; path = lib/CodeGen/CGDecl.cpp; sourceTree = ""; tabWidth = 2; }; + DE46BF270AE0A82D00CC047C /* TargetInfo.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.c.h; path = TargetInfo.h; sourceTree = ""; tabWidth = 2; }; + DE4772F90C10EAE5002239E8 /* CGStmt.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = CGStmt.cpp; path = lib/CodeGen/CGStmt.cpp; sourceTree = ""; tabWidth = 2; }; + DE4772FB0C10EAEC002239E8 /* CGExpr.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = CGExpr.cpp; path = lib/CodeGen/CGExpr.cpp; sourceTree = ""; tabWidth = 2; }; + DE47999B0D2EBE1A00706D2D /* SemaExprObjC.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = SemaExprObjC.cpp; path = lib/Sema/SemaExprObjC.cpp; sourceTree = ""; tabWidth = 2; }; + DE4DC7980EA1BE4400069E5A /* TokenRewriter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TokenRewriter.h; path = clang/Rewrite/TokenRewriter.h; sourceTree = ""; }; + DE4DC7A20EA1C33E00069E5A /* TokenRewriter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TokenRewriter.cpp; path = lib/Rewrite/TokenRewriter.cpp; sourceTree = ""; }; + DE53370B0CE2D96F00D9A028 /* RewriteRope.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RewriteRope.h; path = clang/Rewrite/RewriteRope.h; sourceTree = ""; }; + DE613EF30E0E148D00B05B79 /* APValue.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = APValue.h; path = clang/AST/APValue.h; sourceTree = ""; tabWidth = 2; }; + DE67E70A0C020EC500F66BC5 /* SemaType.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = SemaType.cpp; path = lib/Sema/SemaType.cpp; sourceTree = ""; tabWidth = 2; }; + DE67E70C0C020ECA00F66BC5 /* SemaStmt.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = SemaStmt.cpp; path = lib/Sema/SemaStmt.cpp; sourceTree = ""; tabWidth = 2; }; + DE67E70E0C020ECF00F66BC5 /* SemaExprCXX.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = SemaExprCXX.cpp; path = lib/Sema/SemaExprCXX.cpp; sourceTree = ""; tabWidth = 2; }; + DE67E7100C020ED400F66BC5 /* SemaExpr.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = SemaExpr.cpp; path = lib/Sema/SemaExpr.cpp; sourceTree = ""; tabWidth = 2; }; + DE67E7120C020ED900F66BC5 /* SemaDecl.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = SemaDecl.cpp; path = lib/Sema/SemaDecl.cpp; sourceTree = ""; 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 = ""; tabWidth = 2; }; + DE67E7160C020EE400F66BC5 /* Sema.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = Sema.cpp; path = lib/Sema/Sema.cpp; sourceTree = ""; tabWidth = 2; }; + DE67E7190C020F4F00F66BC5 /* ParseAST.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = ParseAST.cpp; path = lib/Sema/ParseAST.cpp; sourceTree = ""; tabWidth = 2; }; + DE67E7270C02109800F66BC5 /* ParseAST.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = ParseAST.h; path = clang/Sema/ParseAST.h; sourceTree = ""; }; + DE6951C60C4D1F5D00A5826B /* RecordLayout.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = RecordLayout.h; path = clang/AST/RecordLayout.h; sourceTree = ""; tabWidth = 2; }; + DE6954630C5121BD00A5826B /* Token.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Token.h; sourceTree = ""; }; + DE704B250D0FBEBE009C7762 /* SemaDeclObjC.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = SemaDeclObjC.cpp; path = lib/Sema/SemaDeclObjC.cpp; sourceTree = ""; tabWidth = 2; }; + DE704BD10D1647E7009C7762 /* HeaderMap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HeaderMap.h; sourceTree = ""; }; + DE704DD10D1668A4009C7762 /* HeaderMap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HeaderMap.cpp; sourceTree = ""; }; + DE75ED280B044DC90020CF81 /* ASTContext.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = ASTContext.h; path = clang/AST/ASTContext.h; sourceTree = ""; tabWidth = 2; }; + DE75EDF00B06880E0020CF81 /* Type.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = Type.cpp; path = lib/AST/Type.cpp; sourceTree = ""; tabWidth = 2; }; + DE85CD800D8380B10070E26E /* TokenLexer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TokenLexer.cpp; sourceTree = ""; }; + DE85CD840D8380F20070E26E /* TokenLexer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TokenLexer.h; sourceTree = ""; }; + DE85CD9E0D8382DD0070E26E /* MacroArgs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MacroArgs.h; sourceTree = ""; }; + DE85CDA20D8383B20070E26E /* MacroArgs.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MacroArgs.cpp; sourceTree = ""; }; + DE85CDAB0D838C120070E26E /* PPMacroExpansion.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PPMacroExpansion.cpp; sourceTree = ""; }; + DE85CDAF0D838C390070E26E /* PPDirectives.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PPDirectives.cpp; sourceTree = ""; }; + DE85CDB50D839BAE0070E26E /* PPLexerChange.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PPLexerChange.cpp; sourceTree = ""; }; + DE8822350EC80C0A00CBC30A /* CGBuilder.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = CGBuilder.h; path = lib/CodeGen/CGBuilder.h; sourceTree = ""; tabWidth = 2; }; + DE8823CA0ED0046600CBC30A /* APValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = APValue.cpp; path = lib/AST/APValue.cpp; sourceTree = ""; }; + DE8823DE0ED0B78600CBC30A /* PTHLexer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PTHLexer.h; sourceTree = ""; }; + DE8824530ED1243E00CBC30A /* OperatorKinds.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OperatorKinds.h; sourceTree = ""; }; + DE8824560ED1244600CBC30A /* OperatorKinds.def */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = OperatorKinds.def; sourceTree = ""; }; + DE928B120C05659200231DA4 /* ModuleBuilder.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = ModuleBuilder.cpp; path = lib/CodeGen/ModuleBuilder.cpp; sourceTree = ""; tabWidth = 2; }; + DE928B1F0C0565B000231DA4 /* ModuleBuilder.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = ModuleBuilder.h; path = clang/CodeGen/ModuleBuilder.h; sourceTree = ""; }; + DE928B7C0C0A615100231DA4 /* CodeGenModule.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = CodeGenModule.h; path = lib/CodeGen/CodeGenModule.h; sourceTree = ""; tabWidth = 2; }; + DE928B7E0C0A615600231DA4 /* CodeGenModule.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = CodeGenModule.cpp; path = lib/CodeGen/CodeGenModule.cpp; sourceTree = ""; tabWidth = 2; }; + DE928B800C0A615B00231DA4 /* CodeGenFunction.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = CodeGenFunction.h; path = lib/CodeGen/CodeGenFunction.h; sourceTree = ""; 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 = ""; tabWidth = 2; }; + DEA09A6E0F31756F000C2258 /* ASTDiagnostic.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = ASTDiagnostic.h; path = clang/AST/ASTDiagnostic.h; sourceTree = ""; tabWidth = 2; }; + DEA09A830F3175BF000C2258 /* LexDiagnostic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LexDiagnostic.h; sourceTree = ""; }; + DEA09A860F3175CA000C2258 /* ParseDiagnostic.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = ParseDiagnostic.h; path = clang/Parse/ParseDiagnostic.h; sourceTree = ""; tabWidth = 2; }; + DEA09A890F3175D9000C2258 /* SemaDiagnostic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SemaDiagnostic.h; path = clang/Sema/SemaDiagnostic.h; sourceTree = ""; }; + DEAABDF70F5F477C0098928A /* PrettyStackTrace.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PrettyStackTrace.h; sourceTree = ""; }; + DEAEE98A0A5A2B970045101B /* MultipleIncludeOpt.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = MultipleIncludeOpt.h; sourceTree = ""; }; + DEAEED4A0A5AF89A0045101B /* NOTES.txt */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = NOTES.txt; sourceTree = ""; }; + DEB076C90F3A221200F5A2BE /* DeclTemplate.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = DeclTemplate.h; path = clang/AST/DeclTemplate.h; sourceTree = ""; tabWidth = 2; }; + DEB076CE0F3A222200F5A2BE /* DeclTemplate.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = DeclTemplate.cpp; path = lib/AST/DeclTemplate.cpp; sourceTree = ""; tabWidth = 2; }; + DEB077930F44F96000F5A2BE /* TokenConcatenation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TokenConcatenation.h; sourceTree = ""; }; + DEB077980F44F97800F5A2BE /* TokenConcatenation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TokenConcatenation.cpp; sourceTree = ""; }; + DEB07AC70F4A427E00F5A2BE /* SemaAttr.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = SemaAttr.cpp; path = lib/Sema/SemaAttr.cpp; sourceTree = ""; tabWidth = 2; }; + DEB089EE0F12F1D900522C07 /* TypeTraits.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TypeTraits.h; sourceTree = ""; }; + DEC63B190C7B940200DBF169 /* CFG.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = CFG.cpp; path = lib/AST/CFG.cpp; sourceTree = ""; tabWidth = 2; }; + DEC63B1B0C7B940600DBF169 /* CFG.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = CFG.h; path = clang/AST/CFG.h; sourceTree = ""; tabWidth = 2; }; + DEC8D9900A9433CD00353FCA /* Decl.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = Decl.h; path = clang/AST/Decl.h; sourceTree = ""; tabWidth = 2; }; + DEC8D9A30A94346E00353FCA /* AST.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = AST.h; path = clang/AST/AST.h; sourceTree = ""; tabWidth = 2; }; + DECAB0CF0DB3C84200E13CCB /* RewriteRope.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RewriteRope.cpp; path = lib/Rewrite/RewriteRope.cpp; sourceTree = ""; }; + DECB6D640F9AE26600F5FBC7 /* JumpDiagnostics.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = JumpDiagnostics.cpp; path = lib/Sema/JumpDiagnostics.cpp; sourceTree = ""; tabWidth = 2; }; + DECB6F030F9D939A00F5FBC7 /* InitPreprocessor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = InitPreprocessor.h; path = clang/Frontend/InitPreprocessor.h; sourceTree = ""; }; + DECB6F060F9D93A800F5FBC7 /* InitPreprocessor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = InitPreprocessor.cpp; path = lib/Frontend/InitPreprocessor.cpp; sourceTree = ""; }; + DECB734E0FA3ED8400F5FBC7 /* StmtObjC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = StmtObjC.h; path = clang/AST/StmtObjC.h; sourceTree = ""; }; + DECB73550FA3EE5A00F5FBC7 /* StmtCXX.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = StmtCXX.h; path = clang/AST/StmtCXX.h; sourceTree = ""; }; + DECB77120FA5752300F5FBC7 /* PCHReaderStmt.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PCHReaderStmt.cpp; path = lib/Frontend/PCHReaderStmt.cpp; sourceTree = ""; }; + DECB77780FA579B000F5FBC7 /* PCHReaderDecl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PCHReaderDecl.cpp; path = lib/Frontend/PCHReaderDecl.cpp; sourceTree = ""; }; + DECB77F60FA5850200F5FBC7 /* PCHWriterDecl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PCHWriterDecl.cpp; path = lib/Frontend/PCHWriterDecl.cpp; sourceTree = ""; }; + DECB78160FA5882F00F5FBC7 /* PCHWriterStmt.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PCHWriterStmt.cpp; path = lib/Frontend/PCHWriterStmt.cpp; sourceTree = ""; }; + DECB78540FA58F5500F5FBC7 /* AccessSpecifier.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AccessSpecifier.h; path = clang/Parse/AccessSpecifier.h; sourceTree = ""; }; + DED626C80AE0C065001E80A4 /* TargetInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; path = TargetInfo.cpp; sourceTree = ""; tabWidth = 2; }; + DED62ABA0AE2EDF1001E80A4 /* Decl.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = Decl.cpp; path = lib/AST/Decl.cpp; sourceTree = ""; tabWidth = 2; usesTabs = 0; }; + DED7D7310A524295003AD0FB /* Diagnostic.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.c.h; path = Diagnostic.h; sourceTree = ""; tabWidth = 2; }; + DED7D7330A524295003AD0FB /* FileManager.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.c.h; path = FileManager.h; sourceTree = ""; tabWidth = 2; }; + DED7D7350A524295003AD0FB /* SourceLocation.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.c.h; path = SourceLocation.h; sourceTree = ""; tabWidth = 2; }; + DED7D7360A524295003AD0FB /* SourceManager.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.c.h; path = SourceManager.h; sourceTree = ""; tabWidth = 2; }; + DED7D7370A524295003AD0FB /* TokenKinds.def */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = text; path = TokenKinds.def; sourceTree = ""; tabWidth = 2; }; + DED7D7380A524295003AD0FB /* TokenKinds.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.c.h; path = TokenKinds.h; sourceTree = ""; tabWidth = 2; }; + DED7D73B0A524295003AD0FB /* Lexer.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Lexer.h; sourceTree = ""; }; + DED7D73E0A524295003AD0FB /* MacroInfo.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = MacroInfo.h; sourceTree = ""; }; + DED7D73F0A524295003AD0FB /* Pragma.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Pragma.h; sourceTree = ""; }; + DED7D7400A524295003AD0FB /* Preprocessor.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Preprocessor.h; sourceTree = ""; }; + DED7D75D0A5242C7003AD0FB /* Diagnostic.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; path = Diagnostic.cpp; sourceTree = ""; tabWidth = 2; }; + DED7D75E0A5242C7003AD0FB /* FileManager.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; path = FileManager.cpp; sourceTree = ""; tabWidth = 2; }; + DED7D76D0A5242C7003AD0FB /* SourceManager.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; path = SourceManager.cpp; sourceTree = ""; tabWidth = 2; }; + DED7D76E0A5242C7003AD0FB /* TokenKinds.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; path = TokenKinds.cpp; sourceTree = ""; tabWidth = 2; }; + DED7D79E0A5242E6003AD0FB /* Lexer.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Lexer.cpp; sourceTree = ""; }; + DED7D7A00A5242E6003AD0FB /* MacroInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = MacroInfo.cpp; sourceTree = ""; }; + DED7D7A20A5242E6003AD0FB /* PPExpressions.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = PPExpressions.cpp; sourceTree = ""; }; + DED7D7A30A5242E6003AD0FB /* Pragma.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Pragma.cpp; sourceTree = ""; }; + DED7D7A40A5242E6003AD0FB /* Preprocessor.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Preprocessor.cpp; sourceTree = ""; }; + DED7D7D70A524302003AD0FB /* README.txt */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = README.txt; sourceTree = ""; }; + DED7D9170A52518C003AD0FB /* ScratchBuffer.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ScratchBuffer.h; sourceTree = ""; }; + DED7D9E40A5257F6003AD0FB /* ScratchBuffer.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = ScratchBuffer.cpp; sourceTree = ""; }; + DEDFE5270F63A9230035BD10 /* DeclNodes.def */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = text; name = DeclNodes.def; path = clang/AST/DeclNodes.def; sourceTree = ""; tabWidth = 2; }; + DEDFE5CB0F7206CC0035BD10 /* NestedNameSpecifier.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NestedNameSpecifier.h; path = clang/AST/NestedNameSpecifier.h; sourceTree = ""; }; + DEDFE5CE0F7206E40035BD10 /* NestedNameSpecifier.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = NestedNameSpecifier.cpp; path = lib/AST/NestedNameSpecifier.cpp; sourceTree = ""; }; + DEDFE6450F7B3B4E0035BD10 /* driver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = driver.cpp; path = tools/driver/driver.cpp; sourceTree = ""; }; + DEDFE6480F7B3B830035BD10 /* Types.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Types.cpp; path = lib/Driver/Types.cpp; sourceTree = ""; }; + DEDFE6490F7B3B830035BD10 /* Tools.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Tools.h; path = lib/Driver/Tools.h; sourceTree = ""; }; + DEDFE64A0F7B3B830035BD10 /* Tools.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Tools.cpp; path = lib/Driver/Tools.cpp; sourceTree = ""; }; + DEDFE64B0F7B3B830035BD10 /* ToolChains.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ToolChains.h; path = lib/Driver/ToolChains.h; sourceTree = ""; }; + DEDFE64C0F7B3B830035BD10 /* Compilation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Compilation.cpp; path = lib/Driver/Compilation.cpp; sourceTree = ""; }; + DEDFE64D0F7B3B830035BD10 /* ArgList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ArgList.cpp; path = lib/Driver/ArgList.cpp; sourceTree = ""; }; + DEDFE64E0F7B3B830035BD10 /* Arg.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Arg.cpp; path = lib/Driver/Arg.cpp; sourceTree = ""; }; + DEDFE64F0F7B3B830035BD10 /* Action.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Action.cpp; path = lib/Driver/Action.cpp; sourceTree = ""; }; + DEDFE6500F7B3B830035BD10 /* Phases.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Phases.cpp; path = lib/Driver/Phases.cpp; sourceTree = ""; }; + DEDFE6510F7B3B830035BD10 /* OptTable.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OptTable.cpp; path = lib/Driver/OptTable.cpp; sourceTree = ""; }; + DEDFE6520F7B3B830035BD10 /* Option.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Option.cpp; path = lib/Driver/Option.cpp; sourceTree = ""; }; + DEDFE6530F7B3B830035BD10 /* Job.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Job.cpp; path = lib/Driver/Job.cpp; sourceTree = ""; }; + DEDFE6540F7B3B830035BD10 /* InputInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = InputInfo.h; path = lib/Driver/InputInfo.h; sourceTree = ""; }; + DEDFE6550F7B3B830035BD10 /* ToolChains.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ToolChains.cpp; path = lib/Driver/ToolChains.cpp; sourceTree = ""; }; + DEDFE6560F7B3B830035BD10 /* ToolChain.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ToolChain.cpp; path = lib/Driver/ToolChain.cpp; sourceTree = ""; }; + DEDFE6570F7B3B830035BD10 /* Tool.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Tool.cpp; path = lib/Driver/Tool.cpp; sourceTree = ""; }; + DEDFE6580F7B3B830035BD10 /* HostInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = HostInfo.cpp; path = lib/Driver/HostInfo.cpp; sourceTree = ""; }; + DEDFE6590F7B3B830035BD10 /* Driver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Driver.cpp; path = lib/Driver/Driver.cpp; sourceTree = ""; }; + DEDFF87F0F848CE30035BD10 /* TemplateName.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TemplateName.h; path = clang/AST/TemplateName.h; sourceTree = ""; }; + DEDFF8870F848CF80035BD10 /* TemplateName.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TemplateName.cpp; path = lib/AST/TemplateName.cpp; sourceTree = ""; }; + DEDFFF070F959EE60035BD10 /* Diagnostic.td */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Diagnostic.td; sourceTree = ""; }; + DEDFFF530F9704580035BD10 /* DiagnosticGroups.td */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DiagnosticGroups.td; sourceTree = ""; }; + DEEBBD430C19C5D200A9FE82 /* TODO.txt */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = TODO.txt; sourceTree = ""; }; + DEEBC3B90C2363B800A9FE82 /* CodeGenTypes.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = CodeGenTypes.h; path = lib/CodeGen/CodeGenTypes.h; sourceTree = ""; tabWidth = 2; }; + DEEBC3BB0C2363BC00A9FE82 /* CodeGenTypes.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = CodeGenTypes.cpp; path = lib/CodeGen/CodeGenTypes.cpp; sourceTree = ""; tabWidth = 2; }; + DEF1615E0F65C81C0098507F /* InitHeaderSearch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = InitHeaderSearch.h; path = clang/Frontend/InitHeaderSearch.h; sourceTree = ""; }; + DEF1615F0F65C81C0098507F /* ManagerRegistry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ManagerRegistry.h; path = clang/Frontend/ManagerRegistry.h; sourceTree = ""; }; + DEF161600F65C81C0098507F /* TextDiagnosticBuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TextDiagnosticBuffer.h; path = clang/Frontend/TextDiagnosticBuffer.h; sourceTree = ""; }; + DEF161610F65C81C0098507F /* PathDiagnosticClients.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PathDiagnosticClients.h; path = clang/Frontend/PathDiagnosticClients.h; sourceTree = ""; }; + DEF161620F65C81C0098507F /* CompileOptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CompileOptions.h; path = clang/Frontend/CompileOptions.h; sourceTree = ""; }; + DEF161630F65C81C0098507F /* TextDiagnosticPrinter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TextDiagnosticPrinter.h; path = clang/Frontend/TextDiagnosticPrinter.h; sourceTree = ""; }; + DEF165140F8D46980098507F /* Tool.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Tool.h; path = clang/Driver/Tool.h; sourceTree = ""; }; + DEF165150F8D46980098507F /* Types.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Types.h; path = clang/Driver/Types.h; sourceTree = ""; }; + DEF165160F8D46980098507F /* Action.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Action.h; path = clang/Driver/Action.h; sourceTree = ""; }; + DEF165170F8D46980098507F /* Compilation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Compilation.h; path = clang/Driver/Compilation.h; sourceTree = ""; }; + DEF165180F8D46980098507F /* Options.def */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = Options.def; path = clang/Driver/Options.def; sourceTree = ""; }; + DEF165190F8D46980098507F /* Option.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Option.h; path = clang/Driver/Option.h; sourceTree = ""; }; + DEF1651A0F8D46980098507F /* Types.def */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = Types.def; path = clang/Driver/Types.def; sourceTree = ""; }; + DEF1651B0F8D46980098507F /* ToolChain.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ToolChain.h; path = clang/Driver/ToolChain.h; sourceTree = ""; }; + DEF1651C0F8D46980098507F /* Options.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Options.h; path = clang/Driver/Options.h; sourceTree = ""; }; + DEF1651D0F8D46980098507F /* ArgList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ArgList.h; path = clang/Driver/ArgList.h; sourceTree = ""; }; + DEF1651E0F8D46980098507F /* Arg.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Arg.h; path = clang/Driver/Arg.h; sourceTree = ""; }; + DEF1651F0F8D46980098507F /* HostInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HostInfo.h; path = clang/Driver/HostInfo.h; sourceTree = ""; }; + DEF165200F8D46980098507F /* Driver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Driver.h; path = clang/Driver/Driver.h; sourceTree = ""; }; + DEF165210F8D46980098507F /* Job.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Job.h; path = clang/Driver/Job.h; sourceTree = ""; }; + DEF165220F8D46980098507F /* Util.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Util.h; path = clang/Driver/Util.h; sourceTree = ""; }; + DEF165230F8D46980098507F /* Phases.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Phases.h; path = clang/Driver/Phases.h; sourceTree = ""; }; + DEF165240F8D46980098507F /* DriverDiagnostic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DriverDiagnostic.h; path = clang/Driver/DriverDiagnostic.h; sourceTree = ""; }; + DEF165700F8FB34D0098507F /* PCHWriter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = PCHWriter.cpp; path = lib/Frontend/PCHWriter.cpp; sourceTree = ""; tabWidth = 2; }; + DEF165740F8FB3510098507F /* PCHReader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = PCHReader.cpp; path = lib/Frontend/PCHReader.cpp; sourceTree = ""; tabWidth = 2; }; + DEF165780F8FB3690098507F /* PCHWriter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PCHWriter.h; path = clang/Frontend/PCHWriter.h; sourceTree = ""; }; + DEF1657B0F8FB36E0098507F /* PCHReader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PCHReader.h; path = clang/Frontend/PCHReader.h; sourceTree = ""; }; + DEF1657E0F8FB3730098507F /* PCHBitCodes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PCHBitCodes.h; path = clang/Frontend/PCHBitCodes.h; sourceTree = ""; }; + DEF1683F0F9548DC0098507F /* FixItRewriter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FixItRewriter.cpp; path = lib/Frontend/FixItRewriter.cpp; sourceTree = ""; }; + DEF168620F9549250098507F /* FixItRewriter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FixItRewriter.h; path = clang/Frontend/FixItRewriter.h; sourceTree = ""; }; + DEF169220F9645960098507F /* FrontendDiagnostic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FrontendDiagnostic.h; path = clang/Frontend/FrontendDiagnostic.h; sourceTree = ""; }; + DEF1692C0F9645BF0098507F /* AnalysisDiagnostic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AnalysisDiagnostic.h; path = clang/Analysis/AnalysisDiagnostic.h; sourceTree = ""; }; + DEF16BE40FA13A5B0098507F /* TypeNodes.def */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = TypeNodes.def; path = clang/AST/TypeNodes.def; sourceTree = ""; }; + DEF16BE50FA13A650098507F /* TypeOrdering.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TypeOrdering.h; path = clang/AST/TypeOrdering.h; sourceTree = ""; }; + DEF2E95E0C5FBD74000C4259 /* InternalsManual.html */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.html; name = InternalsManual.html; path = docs/InternalsManual.html; sourceTree = ""; }; + DEF2EDA60C6A4252000C4259 /* StmtDumper.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = StmtDumper.cpp; path = lib/AST/StmtDumper.cpp; sourceTree = ""; tabWidth = 2; }; + DEF2EFF20C6CDD74000C4259 /* CGExprAgg.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = CGExprAgg.cpp; path = lib/CodeGen/CGExprAgg.cpp; sourceTree = ""; tabWidth = 2; }; + DEF2F00F0C6CFED5000C4259 /* SemaChecking.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = SemaChecking.cpp; path = lib/Sema/SemaChecking.cpp; sourceTree = ""; tabWidth = 2; }; + DEF7D9F60C9C8B1A0001F598 /* Rewriter.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = Rewriter.h; path = clang/Rewrite/Rewriter.h; sourceTree = ""; }; + DEF7D9F80C9C8B1D0001F598 /* Rewriter.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = Rewriter.cpp; path = lib/Rewrite/Rewriter.cpp; sourceTree = ""; }; + DEFFECA30DB093D100B4E7C3 /* DeltaTree.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DeltaTree.h; path = clang/Rewrite/DeltaTree.h; sourceTree = ""; }; + DEFFECA60DB1546600B4E7C3 /* DeltaTree.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DeltaTree.cpp; path = lib/Rewrite/DeltaTree.cpp; sourceTree = ""; }; +/* 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 = ""; + }; + 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 = ""; + }; + 1AB674ADFE9D54B511CA2CBB /* Products */ = { + isa = PBXGroup; + children = ( + 8DD76F6C0486A84900D96B5E /* clang */, + ); + name = Products; + sourceTree = ""; + }; + 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 = ""; + }; + 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 = ""; + }; + 3507E4C90E27FE9000FB7B57 /* Bug Reporting */ = { + isa = PBXGroup; + children = ( + 35A8FCF80D9B4B29001C2F97 /* PathDiagnostic.cpp */, + 359379090DA48ABA0043B19C /* BugReporter.cpp */, + ); + name = "Bug Reporting"; + sourceTree = ""; + }; + 3507E4CC0E27FEB900FB7B57 /* Flow-Sensitive Analyses */ = { + isa = PBXGroup; + children = ( + 356EF9B40C8F7DDF006650F5 /* LiveVariables.cpp */, + ); + name = "Flow-Sensitive Analyses"; + sourceTree = ""; + }; + 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 = ""; + }; + 352C19DB0CA321AC0045DB98 /* Visitors */ = { + isa = PBXGroup; + children = ( + 352C19DC0CA321C80045DB98 /* CFGRecStmtDeclVisitor.h */, + 352C19DD0CA321C80045DB98 /* CFGRecStmtVisitor.h */, + 352C19DE0CA321C80045DB98 /* CFGStmtVisitor.h */, + 352C19DF0CA321C80045DB98 /* CFGVarDeclVisitor.h */, + ); + name = Visitors; + sourceTree = ""; + }; + 35544B820F5C7F6600D92AA9 /* StoreManagers */ = { + isa = PBXGroup; + children = ( + 35A057E00EAE2D950069249F /* RegionStore.cpp */, + 3558F76C0E267C8300A5B0DF /* BasicStore.cpp */, + ); + name = StoreManagers; + sourceTree = ""; + }; + 35544B830F5C7F8900D92AA9 /* ConstraintManagers */ = { + isa = PBXGroup; + children = ( + 35544B870F5C7FD700D92AA9 /* SimpleConstraintManager.h */, + 35544B860F5C7FD700D92AA9 /* SimpleConstraintManager.cpp */, + 358CFBB70E65AB04002A8E19 /* BasicConstraintManager.cpp */, + 35544B850F5C7FD700D92AA9 /* RangeConstraintManager.cpp */, + ); + name = ConstraintManagers; + sourceTree = ""; + }; + 35544B840F5C7F9D00D92AA9 /* Path-Sensitive */ = { + isa = PBXGroup; + children = ( + 3507E4C60E27FE5500FB7B57 /* Core */, + 35544B820F5C7F6600D92AA9 /* StoreManagers */, + 35862B130E3629BC0009F542 /* Transfer Function Analyses */, + 35544B830F5C7F8900D92AA9 /* ConstraintManagers */, + ); + name = "Path-Sensitive"; + sourceTree = ""; + }; + 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 = ""; + }; + 356EF9B30C8F7DCA006650F5 /* Analysis */ = { + isa = PBXGroup; + children = ( + 35544B840F5C7F9D00D92AA9 /* Path-Sensitive */, + 3507E4CC0E27FEB900FB7B57 /* Flow-Sensitive Analyses */, + 3507E4C30E27FE3800FB7B57 /* Checks */, + 3507E4C90E27FE9000FB7B57 /* Bug Reporting */, + ); + name = Analysis; + sourceTree = ""; + }; + 35862B130E3629BC0009F542 /* Transfer Function Analyses */ = { + isa = PBXGroup; + children = ( + 35D55B250D81D8C60092E734 /* CFRefCount.cpp */, + DE41212F0D7F1C1C0080F80A /* GRSimpleVals.cpp */, + DE41212C0D7F1C1C0080F80A /* GRSimpleVals.h */, + ); + name = "Transfer Function Analyses"; + sourceTree = ""; + }; + 35D1DDCF0CA9C6BE0096E967 /* FlowSensitive */ = { + isa = PBXGroup; + children = ( + 35D1DDD10CA9C6D50096E967 /* DataflowSolver.h */, + 35D1DDD20CA9C6D50096E967 /* DataflowValues.h */, + ); + name = FlowSensitive; + sourceTree = ""; + }; + 35F9B1520D1C6ACB00DDFDAE /* Support */ = { + isa = PBXGroup; + children = ( + 3537AA0C0ECD088F008F7CDC /* BlkExprDeclBitVector.h */, + ); + name = Support; + sourceTree = ""; + }; + 35F9B1540D1C6AFC00DDFDAE /* Analyses */ = { + isa = PBXGroup; + children = ( + 35F9B1550D1C6B2E00DDFDAE /* LiveVariables.h */, + 35F9B1560D1C6B2E00DDFDAE /* UninitializedValues.h */, + ); + name = Analyses; + sourceTree = ""; + }; + C6859E8C029090F304C91782 /* Documentation */ = { + isa = PBXGroup; + children = ( + DEAEED4A0A5AF89A0045101B /* NOTES.txt */, + DED7D7D70A524302003AD0FB /* README.txt */, + DEEBBD430C19C5D200A9FE82 /* TODO.txt */, + DEF2E95E0C5FBD74000C4259 /* InternalsManual.html */, + ); + name = Documentation; + sourceTree = ""; + }; + 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 = ""; + }; + 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 = ""; + }; + 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 = ""; + }; + 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 = ""; + }; + DE67E7260C02108300F66BC5 /* Sema */ = { + isa = PBXGroup; + children = ( + 9063F2210F9E8BDF002F7251 /* ExternalSemaSource.h */, + 9063F2220F9E8BDF002F7251 /* SemaConsumer.h */, + DE67E7270C02109800F66BC5 /* ParseAST.h */, + DEA09A890F3175D9000C2258 /* SemaDiagnostic.h */, + ); + name = Sema; + sourceTree = ""; + }; + 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 = ""; + }; + DE928B140C05659A00231DA4 /* CodeGen */ = { + isa = PBXGroup; + children = ( + DE928B1F0C0565B000231DA4 /* ModuleBuilder.h */, + ); + name = CodeGen; + sourceTree = ""; + }; + 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 = ""; + }; + 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 = ""; + }; + 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 = ""; + }; + 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 = ""; + }; + 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 = ""; + }; + 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 = ""; + }; + 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 = ""; + }; + DEDFE61F0F7B3AE10035BD10 /* Tools */ = { + isa = PBXGroup; + children = ( + DEDFE6200F7B3AE90035BD10 /* clang-cc */, + DEDFE6210F7B3AF10035BD10 /* clang */, + ); + name = Tools; + sourceTree = ""; + }; + DEDFE6200F7B3AE90035BD10 /* clang-cc */ = { + isa = PBXGroup; + children = ( + 1AFEF4050F8A6B2300476F2B /* clang-cc.cpp */, + ); + name = "clang-cc"; + sourceTree = ""; + }; + DEDFE6210F7B3AF10035BD10 /* clang */ = { + isa = PBXGroup; + children = ( + DEDFE6450F7B3B4E0035BD10 /* driver.cpp */, + ); + name = clang; + sourceTree = ""; + }; + 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 = ""; + }; + 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 = ""; + }; + 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 = ""; + }; + DEF7D9F40C9C8B020001F598 /* Rewrite */ = { + isa = PBXGroup; + children = ( + DEFFECA30DB093D100B4E7C3 /* DeltaTree.h */, + 35F2BE7B0DAC2963006E7668 /* HTMLRewrite.h */, + DEF7D9F60C9C8B1A0001F598 /* Rewriter.h */, + DE53370B0CE2D96F00D9A028 /* RewriteRope.h */, + DE4DC7980EA1BE4400069E5A /* TokenRewriter.h */, + ); + name = Rewrite; + sourceTree = ""; + }; + DEF7D9F50C9C8B0C0001F598 /* Rewrite */ = { + isa = PBXGroup; + children = ( + DEFFECA60DB1546600B4E7C3 /* DeltaTree.cpp */, + 72D16C1E0D9975C400E6DA4A /* HTMLRewrite.cpp */, + DEF7D9F80C9C8B1D0001F598 /* Rewriter.cpp */, + DECAB0CF0DB3C84200E13CCB /* RewriteRope.cpp */, + DE4DC7A20EA1C33E00069E5A /* TokenRewriter.cpp */, + ); + name = Rewrite; + sourceTree = ""; + }; +/* 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 b686b0edd30..aa01b7fdf06 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 a5b7ad4ca38..7d3009b0112 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 f594db27bc8..3de01f3baeb 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(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 - 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 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::A is required, it will be instantiated from the /// declaration returned by getInstantiatedFromMemberFunction(). FunctionDecl *getInstantiatedFromMemberFunction() const { - return TemplateOrInstantiation.dyn_cast(); + return TemplateOrSpecialization.dyn_cast(); } /// \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(); + return TemplateOrSpecialization.dyn_cast(); } 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()) { + 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()) { + 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 a75eecd0222..c959b05473f 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 52ed0ec8535..a2fe24e8310 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 { + typedef ::clang::NamedDecl* SimpleType; + static SimpleType getSimplifiedValue(const ::clang::AnyFunctionDecl &Val) { + return Val; + } + }; + template<> struct simplify_type< ::clang::AnyFunctionDecl> + : public simplify_type {}; +} // 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 Functions; + llvm::SmallVector Functions; // FIXME: This should go away when we stop using // OverloadedFunctionDecl to store conversions in CXXRecordDecl. friend class CXXRecordDecl; public: - typedef llvm::SmallVector::iterator function_iterator; - typedef llvm::SmallVector::const_iterator + typedef llvm::SmallVector::iterator function_iterator; + typedef llvm::SmallVector::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(getDeclContext())) + return RD->isLocalClass(); + + return dyn_cast(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 2608dd9d315..aad19a63ef0 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(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 ca55ea670b2..321b1f204fc 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 5555a9b0ae7..64a09d80027 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 23610f9a2d9..9ff3f52f89a 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 eb519e0e743..689bebb450f 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 5db666c4b83..f05bc680a7e 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 SVator; + /// EntryNode - The immediate predecessor node. NodeTy* EntryNode; @@ -603,41 +607,32 @@ protected: return X; if (isa(X)) - return getTF().EvalCast(*this, cast(X), CastT); + return SVator->EvalCast(cast(X), CastT); else - return getTF().EvalCast(*this, cast(X), CastT); + return SVator->EvalCast(cast(X), CastT); } - SVal EvalMinus(UnaryOperator* U, SVal X) { - return X.isValid() ? getTF().EvalMinus(*this, U, cast(X)) : X; + SVal EvalMinus(SVal X) { + return X.isValid() ? SVator->EvalMinus(cast(X)) : X; } SVal EvalComplement(SVal X) { - return X.isValid() ? getTF().EvalComplement(*this, cast(X)) : X; + return X.isValid() ? SVator->EvalComplement(cast(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(R), T) : R; + SVal EvalBinOp(BinaryOperator::Opcode op, NonLoc L, SVal R, QualType T) { + return R.isValid() ? SVator->EvalBinOpNN(op, L, cast(R), T) : R; } - void EvalBinOp(ExplodedNodeSet& Dst, Expr* Ex, - BinaryOperator::Opcode Op, NonLoc L, NonLoc R, - ExplodedNode* 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 98f1242ad81..0da8f5243e9 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 @@ -198,6 +198,14 @@ public: const GRState *assumeInBound(SVal idx, SVal upperBound, 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(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 c2f8f5aae0e..db23f81e2d6 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& 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& Dst, @@ -108,8 +74,7 @@ public: ReturnStmt* S, ExplodedNode* 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 de74dbdb17b..36137fb117b 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 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 00000000000..490c04e5978 --- /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 0c5df2e98e1..5aa53507fd1 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 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 d074e30333d..f32a7e3481d 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 d8e557f7603..de318a0f03e 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 9c439851b18..815ae8d7000 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 79a9efac855..4ba1083089e 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 7c578e32f81..543a0fff8e7 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 bcfb83b8942..249ca89f717 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_iterator fileinfo_iterator; diff --git a/include/clang/Basic/TokenKinds.def b/include/clang/Basic/TokenKinds.def index 497b1884a3d..ed0270acd0d 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 3492d09c10a..ad799c3a8b2 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 00000000000..1eaa958995f --- /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 + +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 + : public basic_parser { + public: + bool parse(Option &O, const char *ArgName, + const std::string &ArgValue, + clang::ParsedSourceLocation &Val); + }; + + bool + parser:: + 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 e546a12c49e..63222725d52 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 41eb31a0fc3..77df60cd721 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 pair. +/// Pointing at '++foo' will return a pair. +/// +std::pair ResolveLocationInAST(ASTContext &Ctx, + SourceLocation Loc); + } // end namespace clang #endif diff --git a/include/clang/Parse/Action.h b/include/clang/Parse/Action.h index 8c85ba60ac2..bfb74748c5f 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 26cebf0915b..50ca88acbce 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 a0b9b1e7cc2..300602e5147 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 75587936065..e5f62ec683e 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 b80142fef30..12f75ae863a 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(T)->getUnderlyingType().getTypePtr()); + case Type::Decltype: + return getTypeInfo(cast(T)->getUnderlyingExpr()->getType() + .getTypePtr()); + case Type::QualifiedName: return getTypeInfo(cast(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(e)) { + if (const ValueDecl *VD = dyn_cast(DRE->getDecl())) + return VD->getType(); + } + if (const MemberExpr *ME = dyn_cast(e)) { + if (const FieldDecl *FD = dyn_cast(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(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" 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 9f2f2079a09..d7a830726fa 100644 --- a/lib/AST/CFG.cpp +++ b/lib/AST/CFG.cpp @@ -22,9 +22,6 @@ #include "llvm/Support/Compiler.h" #include #include -#include -#include -#include using namespace clang; @@ -1887,7 +1884,8 @@ void CFG::viewCFG() const { namespace llvm { template<> struct DOTGraphTraits : 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 71e88a9efc4..5382ab52ab5 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(this)) + if (const FunctionTemplateDecl *OldFunctionTemplate + = dyn_cast(OldD)) + return FunctionTemplate->getTemplatedDecl() + ->declarationReplaces(OldFunctionTemplate->getTemplatedDecl()); + // For method declarations, we keep track of redeclarations. if (isa(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(ND)) + ND = UD->getTargetDecl(); + else if (ObjCCompatibleAliasDecl *AD + = dyn_cast(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()) + 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(); + 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 02e71d7a868..5815d820aef 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(this)) + return UD->getTargetDecl()->isFunctionOrFunctionTemplate(); + + return isa(this) || isa(this); +} + //===----------------------------------------------------------------------===// // PrettyStackTraceDecl Implementation //===----------------------------------------------------------------------===// diff --git a/lib/AST/DeclCXX.cpp b/lib/AST/DeclCXX.cpp index 25e4d196177..752218db042 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 4a3ad2641ef..fce88cc0da2 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 &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 4815ae5c3b9..9d765924e02 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(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 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 1316d3551d9..96b5218ba2f 100644 --- a/lib/AST/StmtViz.cpp +++ b/lib/AST/StmtViz.cpp @@ -31,7 +31,8 @@ void Stmt::viewAST() const { namespace llvm { template<> struct DOTGraphTraits : 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 7b45b21e5d0..41536612fec 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(this)) return TOT->getUnderlyingType().getDesugaredType(); + if (const DecltypeType *DTT = dyn_cast(this)) + return DTT->getUnderlyingExpr()->getType().getDesugaredType(); if (const TemplateSpecializationType *Spec = dyn_cast(this)) { if (ForDisplay) @@ -962,6 +964,7 @@ const char *BuiltinType::getName(bool CPlusPlus) const { case NullPtr: return "nullptr_t"; case Overload: return ""; case Dependent: return ""; + case UndeducedAuto: return ""; } } @@ -1052,6 +1055,13 @@ TypeOfExprType::TypeOfExprType(Expr *E, QualType can) assert(!isa(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(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 ffa8a8625bd..cb89d306510 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(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 6b346cd5255..8fbce528fa9 100644 --- a/lib/Analysis/BasicStore.cpp +++ b/lib/Analysis/BasicStore.cpp @@ -112,7 +112,8 @@ public: return BindingsTy(static_cast(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(VD) || isa(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 9c9029cfff3..38ea458a659 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 46333a74f27..f4a28e0c19f 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 #include 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(); @@ -2790,10 +2789,7 @@ void CFRefCount::EvalSummary(ExplodedNodeSet& 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& 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& Dst, if (Expr* Receiver = ME->getReceiver()) { SVal X = St->getSValAsScalarOrLoc(Receiver); if (loc::MemRegionVal* L = dyn_cast(&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 e064e3c71a8..7d6a619736e 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 92c50e2a918..21dc658dfa1 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 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 7d56d108deb..8b4f5c8f11c 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 #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(location), Val); + newState = state->bindLoc(cast(location), Val); } // The next thing to do is check if the GRTransferFuncs object wants to @@ -1296,9 +1295,8 @@ static bool EvalOSAtomicCompareAndSwap(ExplodedNodeSet& 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(V))); + state = state->bindExpr(U, EvalMinus(cast(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(V)) { Loc X = ValMgr.makeNull(); - SVal Result = EvalBinOp(state,BinaryOperator::EQ, cast(V), X, - U->getType()); - state = state->bindExpr(U, Result); + Result = EvalBinOp(state, BinaryOperator::EQ, cast(V), X, + U->getType()); } else { nonloc::ConcreteInt X(getBasicVals().getValue(0, Ex->getType())); -#if 0 - SVal Result = EvalBinOp(BinaryOperator::EQ, cast(V), X); - state = SetSVal(state, U, Result); -#else - EvalBinOp(Dst, U, BinaryOperator::EQ, cast(V), X, *I, - U->getType()); - continue; -#endif + Result = EvalBinOp(BinaryOperator::EQ, cast(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& Dst, Expr* Ex, - BinaryOperator::Opcode Op, - NonLoc L, NonLoc R, - ExplodedNode* 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(L)) { if (isa(R)) - return getTF().EvalBinOp(*this, Op, cast(L), cast(R)); + return SVator->EvalBinOpLL(Op, cast(L), cast(R), T); else - return getTF().EvalBinOp(*this, state, Op, cast(L), cast(R)); + return SVator->EvalBinOpLN(state, Op, cast(L), cast(R), T); } if (isa(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(R), cast(L)); + return SVator->EvalBinOpLN(state, Op, cast(R), cast(L), T); } else - return getTF().DetermEvalBinOpNN(*this, Op, cast(L), - cast(R), T); + return SVator->EvalBinOpNN(Op, cast(L), cast(R), T); } //===----------------------------------------------------------------------===// @@ -3156,8 +3128,11 @@ struct VISIBILITY_HIDDEN DOTGraphTraits : 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 : 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 : 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 : if (Label) { if (CaseStmt* C = dyn_cast(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 13df89ebbfd..76d26dd9f02 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 *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 480612113d1..00000000000 --- 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 - -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(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(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(X)) - return Eng.getValueManager().makeLocAsInteger(X, BitWidth); - - llvm::APSInt V = cast(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(X).EvalMinus(Eng.getBasicVals(), U); - - default: - return UnknownVal(); - } -} - -SVal GRSimpleVals::EvalComplement(GRExprEngine& Eng, NonLoc X) { - - switch (X.getSubKind()) { - - case nonloc::ConcreteIntKind: - return cast(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(L).getLoc(); - - switch (R.getSubKind()) { - case nonloc::LocAsIntegerKind: - return EvalBinOp(Eng, Op, LL, - cast(R).getLoc()); - - case nonloc::ConcreteIntKind: { - // Transform the integer into a location and compare. - ASTContext& Ctx = Eng.getContext(); - llvm::APSInt V = cast(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(L).getSymbolicExpression(); - - // Only handle ($sym op constant) for now. - if (const SymIntExpr *E = dyn_cast(&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(R)) { - const nonloc::ConcreteInt& L_CI = cast(L); - const nonloc::ConcreteInt& R_CI = cast(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(R)) { - ValueManager &ValMgr = Eng.getValueManager(); - return ValMgr.makeNonLoc(cast(L).getSymbol(), Op, - cast(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(&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(R)) { - bool b = cast(L).getValue() == - cast(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(L).getValue(), - Eng.getContext().IntTy); - return nonloc::SymExprVal(SE); - } - - break; - - case loc::MemRegionKind: { - if (SymbolRef LSym = L.getAsLocSymbol()) { - if (isa(R)) { - const SymIntExpr *SE = - Eng.getSymbolManager().getSymIntExpr(LSym, - isEqual ? BinaryOperator::EQ - : BinaryOperator::NE, - cast(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& Dst, - GRExprEngine& Eng, - GRStmtNodeBuilder& Builder, - CallExpr* CE, SVal L, - ExplodedNode* 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(V)) { - const MemRegion *R = cast(V).getRegion(); - if (R->isBoundable()) - St = StateMgr.BindLoc(St, cast(V), UnknownVal()); - } else if (isa(V)) - St = StateMgr.BindLoc(St, cast(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& Dst, - GRExprEngine& Eng, - GRStmtNodeBuilder& Builder, - ObjCMessageExpr* ME, - ExplodedNode* 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(V)) - St = St->bindLoc(cast(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 6ef49dcdd22..00000000000 --- 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& Dst, - GRExprEngine& Engine, - GRStmtNodeBuilder& Builder, - CallExpr* CE, SVal L, - ExplodedNode* Pred); - - virtual void EvalObjCMessageExpr(ExplodedNodeSet& Dst, - GRExprEngine& Engine, - GRStmtNodeBuilder& Builder, - ObjCMessageExpr* ME, - ExplodedNode* Pred); - - - - static void GeneratePathDiagnostic(PathDiagnostic& PD, ASTContext& Ctx, - ExplodedNode* 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 a64b2d7f5f4..493edc37bac 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(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 3c14ee9ab5c..00000000000 --- 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 ec96329852d..a608ce0d588 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 + using namespace clang; using llvm::dyn_cast; using llvm::isa; diff --git a/lib/Analysis/RangeConstraintManager.cpp b/lib/Analysis/RangeConstraintManager.cpp index 73c68bcaea0..079462e8d19 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(); @@ -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 77f5b7cb39b..d45048de1a4 100644 --- a/lib/Analysis/RegionStore.cpp +++ b/lib/Analysis/RegionStore.cpp @@ -102,25 +102,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 - : public GRStatePartialTrait< llvm::ImmutableSet > { - 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(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(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(MR); assert(R && "bad region"); + if (const FieldRegion* FR = dyn_cast(R)) + return RetrieveField(state, FR); + + if (const ElementRegion* ER = dyn_cast(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(R)) - return UnknownVal(); - - // Check if the region is an element region of a string literal. - if (const ElementRegion *ER = dyn_cast(R)) { - if (const StringRegion *StrR=dyn_cast(ER->getSuperRegion())) { - const StringLiteral *Str = StrR->getStringLiteral(); - SVal Idx = ER->getIndex(); - if (nonloc::ConcreteInt *CI = dyn_cast(&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(R) || isa(R)) { - const MemRegion* SuperR = cast(R)->getSuperRegion(); - GRStateTrait::lookup_type D = - state->get(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(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(R->getSuperRegion())) { + const StringLiteral *Str = StrR->getStringLiteral(); + SVal Idx = R->getIndex(); + if (nonloc::ConcreteInt *CI = dyn_cast(&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(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(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(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(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(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(R)->set(R, UnknownVal()); - Store store = state->getStore(); - RegionBindingsTy B = GetRegionBindings(store); + // Set the default value of the struct region to "unknown". + state = state->set(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(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 dd9490bebb9..7d1850d7309 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 00000000000..76a8bc782eb --- /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(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(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(val)) + return ValMgr.makeLocAsInteger(val, BitWidth); + + llvm::APSInt i = cast(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(val).evalMinus(ValMgr); + default: + return UnknownVal(); + } +} + +SVal SimpleSValuator::EvalComplement(NonLoc X) { + switch (X.getSubKind()) { + case nonloc::ConcreteIntKind: + return cast(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(lhs).getValue(), + resultTy); + break; + } + case loc::MemRegionKind: { + if (SymbolRef lSym = lhs.getAsLocSymbol()) { + if (isa(rhs)) { + return ValMgr.makeNonLoc(lSym, + isEqual ? BinaryOperator::EQ + : BinaryOperator::NE, + cast(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(lhs).getLoc(); + switch (rhs.getSubKind()) { + case nonloc::LocAsIntegerKind: + return EvalBinOpLL(op, lhsL, cast(rhs).getLoc(), + resultTy); + case nonloc::ConcreteIntKind: { + // Transform the integer into a location and compare. + ASTContext& Ctx = ValMgr.getContext(); + llvm::APSInt i = cast(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(lhs).getSymbolicExpression(); + + // Only handle ($sym op constant) for now. + if (const SymIntExpr *symIntExpr = dyn_cast(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(rhs)) { + const nonloc::ConcreteInt& lhsInt = cast(lhs); + return lhsInt.evalBinOp(ValMgr, op, cast(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(rhs)) { + return ValMgr.makeNonLoc(cast(lhs).getSymbol(), op, + cast(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(&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 4e38a3492c7..275f30a2963 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 cf78da98692..d13ffa38213 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 23a01c953a4..6640c61ff3b 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 LOffs = getDecomposedLoc(LHS); + std::pair 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 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::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 1d69e4e96ef..9910e28fcda 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 a2b8d13e3c9..5e872c290df 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 = ""; 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(Ty)->getUnderlyingType(), Unit); + case Type::Decltype: + return Slot = getOrCreateType(cast(Ty)->getUnderlyingExpr() + ->getType(), Unit); } return Slot; diff --git a/lib/CodeGen/CGDebugInfo.h b/lib/CodeGen/CGDebugInfo.h index 8f3368e4ebf..de655800fa0 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 4e603c34b40..f97c62f9d14 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 51c5b3d7dde..a21140765c2 100644 --- a/lib/CodeGen/CGExpr.cpp +++ b/lib/CodeGen/CGExpr.cpp @@ -606,11 +606,12 @@ void CodeGenFunction::EmitStoreThroughExtVectorComponentLValue(RValue Src, cast(Vec->getType())->getNumElements(); if (NumDstElts == NumSrcElts) { // Use shuffle vector is the src and destination are the same number - // of elements - llvm::SmallVector Mask; + // of elements and restore the vector mask since it is on the side + // it will be stored. + llvm::SmallVector 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 912479f0b0e..4f96b8baec0 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 &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 &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 6ffca8134af..865e8c240be 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 &UsedArray); + public: CGObjCCommonMac(CodeGen::CodeGenModule &cgm) : CGM(cgm) { } @@ -3426,6 +3428,16 @@ void CGObjCCommonMac::GetNameForMethod(const ObjCMethodDecl *D, NameOut += ']'; } +void CGObjCCommonMac::MergeMetadataGlobals( + std::vector &UsedArray) { + llvm::Type *i8PTy = llvm::PointerType::getUnqual(llvm::Type::Int8Ty); + for (std::vector::iterator i = UsedGlobals.begin(), + e = UsedGlobals.end(); i != e; ++i) { + UsedArray.push_back(llvm::ConstantExpr::getBitCast(cast(*i), + i8PTy)); + } +} + void CGObjCMac::FinishModule() { EmitModuleInfo(); @@ -3447,22 +3459,6 @@ void CGObjCMac::FinishModule() { Values)); } - std::vector Used; - for (std::vector::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 Used; - - for (std::vector::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 b8cf026b35a..0f9cf0606d3 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 &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 f926c05a998..0a531e9b21a 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 UsedArray; @@ -420,6 +421,12 @@ void CodeGenModule::EmitLLVMUsed() { llvm::ConstantExpr::getBitCast(cast(&*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 24e441a2963..b5ad5acc016 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 a7fbcda8fc2..8143263ca2f 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 ae90594a409..d8fa141d8cb 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 4ba39c95942..f8d09dbee89 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 96f21f11286..765655b01dd 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(GetDecl(Record[0]))); diff --git a/lib/Frontend/PCHReaderDecl.cpp b/lib/Frontend/PCHReaderDecl.cpp index 3dd84c7b08a..3f6ae354dc3 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 3b1eb080f22..e93219e01d5 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(Attr)->getNumParams()); break; + + case Attr::ReqdWorkGroupSize: + Record.push_back(cast(Attr)->getXDim()); + Record.push_back(cast(Attr)->getYDim()); + Record.push_back(cast(Attr)->getZDim()); + break; case Attr::Section: AddString(cast(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 00000000000..a5f0d1f1636 --- /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 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 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 { +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 { +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 +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 318685a8994..57d7ee5cdd8 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 3fb6f950efc..5ee668a3172 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 d8c6986f9ea..8b3b2851c1e 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 9ded366b29f..648e2da54bf 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 426f56f4380..ff602e8ba79 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 "" as a synonym for // "id". 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 44f231a6678..225f9261ef8 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 2be44a4e77a..d89f1e172ff 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 cb7fe58807a..013e26b891e 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 eabe10f1450..57a09fbc737 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 f31855b751f..02687a216c7 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 a2a66f9255d..29d1d8792e1 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 8604fe56a27..2d27ccc7783 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 &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 &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 a2ceafad303..f6d6623f9a2 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(E); @@ -766,6 +768,25 @@ bool Sema::SemaCheckStringLiteral(const Expr *E, const CallExpr *TheCall, return false; } + case Stmt::CallExprClass: { + const CallExpr *CE = cast(E); + if (const ImplicitCastExpr *ICE + = dyn_cast(CE->getCallee())) { + if (const DeclRefExpr *DRE = dyn_cast(ICE->getSubExpr())) { + if (const FunctionDecl *FD = dyn_cast(DRE->getDecl())) { + if (const FormatArgAttr *FA = FD->getAttr(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 eba1d58d602..13162d8e8ea 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(D) && - AllowOverloadingOfFunction(D, Context)) { - // We are pushing the name of a function, which might be an - // overloaded name. - FunctionDecl *FD = cast(D); + } else if ((isa(D) && + AllowOverloadingOfFunction(D, Context)) || + isa(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(OldD); + FunctionDecl *Old = 0; + if (FunctionTemplateDecl *OldFunctionTemplate + = dyn_cast(OldD)) + Old = OldFunctionTemplate->getTemplatedDecl(); + else + Old = dyn_cast(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(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(*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(OldDecl)); + if (FunctionTemplateDecl *OldTemplateDecl + = dyn_cast(OldDecl)) + NewFD->setPreviousDeclaration(OldTemplateDecl->getTemplatedDecl()); + else + NewFD->setPreviousDeclaration(cast(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(D.getAs()); CurFunctionNeedsScopeChecking = false; @@ -3219,7 +3286,7 @@ NamedDecl *Sema::ImplicitlyDefineFunction(SourceLocation Loc, CurContext = Context.getTranslationUnitDecl(); FunctionDecl *FD = - dyn_cast(ActOnDeclarator(TUScope, D, DeclPtrTy()).getAs()); + dyn_cast(ActOnDeclarator(TUScope, D).getAs()); FD->setImplicit(); CurContext = PrevDC; diff --git a/lib/Sema/SemaDeclAttr.cpp b/lib/Sema/SemaDeclAttr.cpp index d57630e6af7..f7dd9303cb4 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(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 c9c662671c1..cf0dab5cf29 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(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(NS)) { @@ -1890,10 +1897,8 @@ void Sema::DefineImplicitDefaultConstructor(SourceLocation CurrentLocation, = cast(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(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(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(Base->getType()->getAsRecordType()->getDecl()); + if (!BaseClassDecl->hasTrivialDestructor()) { + if (CXXDestructorDecl *BaseDtor = + const_cast(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(FieldClassType->getDecl()); + if (!FieldClassDecl->hasTrivialDestructor()) { + if (CXXDestructorDecl *FieldDtor = + const_cast( + 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(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(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(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 LHS(this, new (Context) DeclRefExpr(ParmDecl, + LHSType, + SourceLocation())); + ExprOwningPtr 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(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(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(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(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( + DeclInitType->getAsRecordType()->getDecl()); + if (!ClassDecl->hasTrivialDestructor()) + if (CXXDestructorDecl *Destructor = + const_cast(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 56d3bfe690b..383edeca07a 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(D)) { + if (const CXXMethodDecl *MD = dyn_cast(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(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(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(D)) - return Owned(BuildDeclRefExpr(Template, Context.OverloadTy, Loc, - false, false, SS)); + return BuildDeclRefExpr(Template, Context.OverloadTy, Loc, + false, false, SS); ValueDecl *VD = cast(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(Fn->IgnoreParens())) - if (isa(MemExpr->getMemberDecl()) || - isa(MemExpr->getMemberDecl())) + if (MemberExpr *MemExpr = dyn_cast(Fn->IgnoreParens())) { + NamedDecl *MemDecl = MemExpr->getMemberDecl(); + if (isa(MemDecl) || + isa(MemDecl) || + (isa(MemDecl) && + isa( + cast(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(DRExpr->getDecl()); + if ((FunctionTemplate = dyn_cast(DRExpr->getDecl()))) + FDecl = FunctionTemplate->getTemplatedDecl(); + else + FDecl = dyn_cast(DRExpr->getDecl()); Ovl = dyn_cast(DRExpr->getDecl()); NDecl = dyn_cast(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(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(D)) { + if (Destructor->isImplicit() && !Destructor->isUsed()) + DefineImplicitDestructor(Loc, Destructor); + + } else if (CXXMethodDecl *MethodDecl = dyn_cast(D)) { + if (MethodDecl->isImplicit() && MethodDecl->isOverloadedOperator() && + MethodDecl->getOverloadedOperator() == OO_Equal) { + if (!MethodDecl->isUsed()) + DefineImplicitOverloadedAssign(Loc, MethodDecl); + } + } if (FunctionDecl *Function = dyn_cast(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 a567218eaa8..bc8fc4eae50 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 45085962d48..6b812e1968d 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 37e1df3a197..cc9e783f616 100644 --- a/lib/Sema/SemaLookup.cpp +++ b/lib/Sema/SemaLookup.cpp @@ -125,21 +125,32 @@ MaybeConstructOverloadSet(ASTContext &Context, assert(!isa(*I) && "Cannot have an overloaded function"); - if (isa(*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(*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(*I)); + NamedDecl *ND = (*I)->getUnderlyingDecl(); + if (isa(ND)) + Ovl->addOverload(cast(ND)); + else + Ovl->addOverload(cast(ND)); } - Ovl->addOverload(cast(*Last)); + + NamedDecl *ND = (*Last)->getUnderlyingDecl(); + if (isa(ND)) + Ovl->addOverload(cast(ND)); + else + Ovl->addOverload(cast(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(ND)) { TagFound = Context.getCanonicalDecl(TD); TagNames += FoundDecls.insert(TagFound)? 1 : 0; - } else if (isa(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(D)) - D = Alias->getClassInterface(); - + if (D) + D = D->getUnderlyingDecl(); + LookupResult Result; Result.StoredKind = (D && isa(D))? OverloadedDeclSingleDecl : SingleDecl; @@ -334,10 +345,10 @@ Sema::LookupResult::CreateLookupResult(ASTContext &Context, LookupResult Result; Result.Context = &Context; - if (F != L && isa(*F)) { + if (F != L && (*F)->isFunctionOrFunctionTemplate()) { IdentifierResolver::iterator Next = F; ++Next; - if (Next != L && isa(*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(D)) - D = Alias->getClassInterface(); - + NamedDecl *D = *F; + if (D) + D = D->getUnderlyingDecl(); + Result.StoredKind = SingleDecl; Result.First = reinterpret_cast(D); Result.Last = 0; @@ -363,10 +373,10 @@ Sema::LookupResult::CreateLookupResult(ASTContext &Context, LookupResult Result; Result.Context = &Context; - if (F != L && isa(*F)) { + if (F != L && (*F)->isFunctionOrFunctionTemplate()) { DeclContext::lookup_iterator Next = F; ++Next; - if (Next != L && isa(*Next)) { + if (Next != L && (*Next)->isFunctionOrFunctionTemplate()) { Result.StoredKind = OverloadedDeclFromDeclContext; Result.First = reinterpret_cast(F); Result.Last = reinterpret_cast(L); @@ -374,10 +384,9 @@ Sema::LookupResult::CreateLookupResult(ASTContext &Context, } } - Decl *D = *F; - if (ObjCCompatibleAliasDecl *Alias - = dyn_cast_or_null(D)) - D = Alias->getClassInterface(); + NamedDecl *D = *F; + if (D) + D = D->getUnderlyingDecl(); Result.StoredKind = SingleDecl; Result.First = reinterpret_cast(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(*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(Ctx)) AssociatedClasses.insert(EnclosingClass); - // Add the associated namespace for this class. while (Ctx->isRecord()) Ctx = Ctx->getParent(); if (NamespaceDecl *EnclosingNamespace = dyn_cast(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(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(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(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(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(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(*Func); + FunctionDecl *FDecl = dyn_cast(*Func); + if (!FDecl) + FDecl = cast(*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(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(*I); + if (!Func) + break; + + Functions.insert(Func); + } + } } diff --git a/lib/Sema/SemaOverload.cpp b/lib/Sema/SemaOverload.cpp index 11cd5107fc6..fcc155750cd 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(OldD)) { + } else if (FunctionTemplateDecl *Old = dyn_cast(OldD)) + return IsOverload(New, Old->getTemplatedDecl(), MatchedDecl); + else if (FunctionDecl* Old = dyn_cast(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(NewQType.getTypePtr())) return false; - FunctionProtoType* OldType = cast(OldQType.getTypePtr()); - FunctionProtoType* NewType = cast(NewQType.getTypePtr()); + FunctionProtoType* OldType = cast(OldQType); + FunctionProtoType* NewType = cast(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(Function) && "Use AddConversionCandidate for conversion functions"); - + assert(!Function->getDescribedFunctionTemplate() && + "Use AddTemplateOverloadCandidate for function templates"); + if (CXXMethodDecl *Method = dyn_cast(Function)) { if (!isa(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(*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(*Func)) { + AddOverloadCandidate(FunDecl, Args, NumArgs, CandidateSet); + Ctx = FunDecl->getDeclContext(); + } else { + FunctionTemplateDecl *FunTmpl = cast(*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(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(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 e98ebb13f81..cd985c536c7 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(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(*F)) { TemplateResult = TemplateTy::make(Ovl); return TNK_Function_template; } @@ -1808,8 +1809,8 @@ bool Sema::CheckTemplateArgument(TemplateTemplateParmDecl *Param, !isa(Template)) { assert(isa(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; + 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) + << IsTemplateTemplateParm; } - Diag((*NewParm)->getLocation(), NextDiag) - << IsTemplateTemplateParm; - 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(DP.getAs()); + 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 de3e52df376..3d909bb26a7 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 &Deduced) { + llvm::SmallVectorImpl &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(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(Param)->getPointeeType(), PointerArg->getPointeeType(), - Info, Deduced); + Info, Deduced, SubTDF); } // T & @@ -256,7 +314,7 @@ DeduceTemplateArguments(ASTContext &Context, return DeduceTemplateArguments(Context, TemplateParams, cast(Param)->getPointeeType(), ReferenceArg->getPointeeType(), - Info, Deduced); + Info, Deduced, 0); } // T && [C++0x] @@ -268,7 +326,7 @@ DeduceTemplateArguments(ASTContext &Context, return DeduceTemplateArguments(Context, TemplateParams, cast(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 (wheretemplate-name refers to a class template) + // template-name (where template-name refers to a class template) // template-name // TT (TODO) // TT (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(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(D)) + return TemplateParameter(TTP); + else if (NonTypeTemplateParmDecl *NTTP = dyn_cast(D)) + return TemplateParameter(NTTP); + + return TemplateParameter(cast(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,27 +807,44 @@ Sema::DeduceTemplateArguments(ClassTemplatePartialSpecializationDecl *Partial, for (unsigned I = 0, N = PartialTemplateArgs.flat_size(); I != N; ++I) { Decl *Param = const_cast( ClassTemplate->getTemplateParameters()->getParam(I)); - if (TemplateTypeParmDecl *TTP = dyn_cast(Param)) { - TemplateArgument InstArg = Instantiate(PartialTemplateArgs[I], - *DeducedArgumentList); - if (InstArg.getKind() != TemplateArgument::Type) { - Info.Param = TTP; - Info.FirstArg = PartialTemplateArgs[I]; - return TDK_SubstitutionFailure; - } - - if (Context.getCanonicalType(InstArg.getAsType()) - != Context.getCanonicalType(TemplateArgs[I].getAsType())) { - Info.Param = TTP; - Info.FirstArg = TemplateArgs[I]; - Info.SecondArg = InstArg; - return TDK_NonDeducedMismatch; - } - - continue; + 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(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(Param)) { + // FIXME: template template arguments should really resolve to decls + DeclRefExpr *DRE = dyn_cast(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; } - - // FIXME: Check template template arguments? } if (Trap.hasErrorOccurred()) @@ -717,6 +853,200 @@ Sema::DeduceTemplateArguments(ClassTemplatePartialSpecializationDecl *Partial, return TDK_Success; } +/// \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 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(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(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(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. + } + + 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(TemplateParams->getParam(I)); + if (TemplateTypeParmDecl *TTP = dyn_cast(Param)) + Info.Param = TTP; + else if (NonTypeTemplateParmDecl *NTTP + = dyn_cast(Param)) + Info.Param = NTTP; + else + Info.Param = cast(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( + 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; +} + static void MarkDeducedTemplateParameters(Sema &SemaRef, const TemplateArgument &TemplateArg, diff --git a/lib/Sema/SemaTemplateInstantiate.cpp b/lib/Sema/SemaTemplateInstantiate.cpp index 1c4e907d4d6..aed348966a4 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(D)) return Spec->getTemplateArgs(); + // Template arguments for a function template specialization. + if (FunctionDecl *Function = dyn_cast(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(EnclosingTemplateCtx)) { assert(!EnclosingTemplateCtx->isFileContext() && @@ -158,8 +166,11 @@ void Sema::PrintInstantiationStack() { << Active->InstantiationRange; } else { FunctionDecl *Function = cast(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( 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()); +} + QualType -TemplateTypeInstantiator::InstantiateRecordType(const RecordType *T, - unsigned Quals) const { +TemplateTypeInstantiator::InstantiateRecordType(const RecordType *T) const { RecordDecl *Record = cast_or_null(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(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 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(T.getTypePtr()), \ - T.getCVRQualifiers()); + Result = Instantiate##Class##Type(cast(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 ece71bc0d32..a05095fa57a 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 &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 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 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 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 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 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(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 749fb589487..65a35f92f7c 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(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(*F)); // Add any functions found via argument-dependent lookup. DeclarationName OpName diff --git a/lib/Sema/SemaType.cpp b/lib/Sema/SemaType.cpp index 967f650d13b..c6bcdc36f13 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(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(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 a43f99bdd79..5f5ce281a79 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 7787a1d6ecd..3ad256914a4 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 0ad7ae7e828..438e1ccf476 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 f29fc70c494..cef624577a6 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 c100344adf6..6d3b7e6f540 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 10328e69efa..2bdaad423a3 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 08842b1b8db..c309349ab3a 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 a018d0afc1c..2b4e7b0db07 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 09b9c2ffa3b..6e2074146c3 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 #include diff --git a/test/Analysis/outofbound.c b/test/Analysis/outofbound.c index 953075fe03d..527a311d2b7 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 34840c7b7c5..4f2c7d9edb0 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 fdc740488a2..64d3fcd57b2 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 4bc9a7def2c..2f7a4bdf740 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 161ab8041de..5ec878ea3c3 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 6f3762ee10b..32f787db4ae 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 00000000000..8a84f5dbed8 --- /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 00000000000..854415fe307 --- /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 00000000000..d888a6d9363 --- /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 00000000000..40702ad9689 --- /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 00000000000..33bf4b4473e --- /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 00000000000..fa3101c6736 --- /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 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 00000000000..d97f2b83d1a --- /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 +struct is_same { + static const bool value = false; +}; + +template +struct is_same { + static const bool value = true; +}; + +const int&& foo(); +int i; +struct A { double x; }; +const A* a = new A(); + +static_assert(is_same::value, ""); +static_assert(is_same::value, ""); +static_assert(is_samex), double>::value, ""); +static_assert(is_samex)), 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 00000000000..9d855349f29 --- /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 00000000000..b482955818c --- /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 void f0(T) { } // expected-note{{previous}} +template void f0(U) { } // expected-error{{redefinition}} + +template void f0() { } // expected-note{{previous}} +template void f0() { } // expected-error{{redefinition}} + +typedef int INT; + +template class X> + void f0() { } // expected-note{{previous}} +template class> + void f0() { } // expected-error{{redefinition}} + +template +struct MetaFun; + +template + typename MetaFun::type f0(const T&) { } // expected-note{{previous}} +template + typename MetaFun::type f0(const U&) { } // expected-error{{redefinition}} + +// FIXME: We need canonicalization of expressions for this to work +// template struct A { }; +// template void f0(A) { } // Xpected-note{{previous}} +// template void f0(A) { } // 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 00000000000..de1a883bcd7 --- /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 void f0(T) { } +template void f0(T) { } +template void f0(U) { } +void f0(); +template void f0(T*); +void f0(int); +template void f0(); +template 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 00000000000..beb6aad2c08 --- /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 struct A { }; + +template A f0(T*); + +void test_f0(int *ip, float const *cfp) { + A a0 = f0(ip); + A a1 = f0(cfp); +} + +template void f1(T*, int); + +void test_f1(int *ip, float fv) { + f1(ip, fv); +} + +template 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 00000000000..6f27d363689 --- /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 struct A { }; + +// bullet 1 +template A f0(T* ptr); + +void test_f0_bullet1() { + int arr0[6]; + A a0 = f0(arr0); + const int arr1[] = { 1, 2, 3, 4, 5 }; + A a1 = f0(arr1); +} + +// bullet 2 +int g0(int, int); +float g1(float); + +void test_f0_bullet2() { + A a0 = f0(g0); + A a1 = f0(g1); +} + +// bullet 3 +struct X { }; +const X get_X(); + +template A f1(T); + +void test_f1_bullet3() { + A 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 00000000000..c014c663598 --- /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 struct A { }; + +// Top-level cv-qualifiers of P's type are ignored for type deduction. +template A f0(const T); + +void test_f0(int i, const int ci) { + A a0 = f0(i); + A a1 = f0(ci); +} + +// If P is a reference type, the type referred to by P is used for type +// deduction. +template A f1(T&); + +void test_f1(int i, const int ci, volatile int vi) { + A a0 = f1(i); + A a1 = f1(ci); + A a2 = f1(vi); +} + +template struct B { }; +template B g0(T (&array)[N]); + +void test_g0() { + int array0[5]; + B b0 = g0(array0); + const int array1[] = { 1, 2, 3}; + B b1 = g0(array1); +} + +template B g1(const A&); + +void test_g1(A af) { + B b0 = g1(af); + B b1 = g1(A()); +} + +// - 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 A f2(const T&); + +void test_f2(int i, const int ci, volatile int vi) { + A a0 = f2(i); + A a1 = f2(ci); + A 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 A f3(T * * const * const); + +void test_f3(int ***ip, volatile int ***vip) { + A a0 = f3(ip); + A 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 b28f63a1c58..e69de29bb2d 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 4189d06812a..e69de29bb2d 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 00000000000..444cf766f7d --- /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 6144f2fb98a..e3db1668d83 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 00000000000..d04b79b024e --- /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 f4aa430cde1..af1b7a8b714 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 75b26a98e44..69550187909 100644 --- a/test/Parser/cxx-template-decl.cpp +++ b/test/Parser/cxx-template-decl.cpp @@ -33,11 +33,11 @@ template class X2; // Forward declarations w/template template parameters template