diff options
author | John McCall <rjmccall@apple.com> | 2010-08-26 23:41:50 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2010-08-26 23:41:50 +0000 |
commit | f312b1ea179f1c44371f9ee0cd0bc006f612de11 (patch) | |
tree | 41c3e6944395d783ebe193409578392f9e37d4d1 /lib | |
parent | 468e8fbda71a02eba31b4d8282fc1d509b552fbe (diff) |
One who seeks knowledge learns something new every day.
One who seeks the Tao unlearns something new every day.
Less and less remains until you arrive at non-action.
When you arrive at non-action,
nothing will be left undone.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112244 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
30 files changed, 537 insertions, 584 deletions
diff --git a/lib/Parse/ParseCXXInlineMethods.cpp b/lib/Parse/ParseCXXInlineMethods.cpp index 61c4d3ebba..d327db485c 100644 --- a/lib/Parse/ParseCXXInlineMethods.cpp +++ b/lib/Parse/ParseCXXInlineMethods.cpp @@ -27,7 +27,7 @@ Decl *Parser::ParseCXXInlineMethodDef(AccessSpecifier AS, Declarator &D, assert((Tok.is(tok::l_brace) || Tok.is(tok::colon) || Tok.is(tok::kw_try)) && "Current token not a '{', ':' or 'try'!"); - Action::MultiTemplateParamsArg TemplateParams(Actions, + MultiTemplateParamsArg TemplateParams(Actions, TemplateInfo.TemplateParams ? TemplateInfo.TemplateParams->data() : 0, TemplateInfo.TemplateParams ? TemplateInfo.TemplateParams->size() : 0); diff --git a/lib/Parse/ParseDecl.cpp b/lib/Parse/ParseDecl.cpp index 8db4964e3d..0cc9103c05 100644 --- a/lib/Parse/ParseDecl.cpp +++ b/lib/Parse/ParseDecl.cpp @@ -15,6 +15,7 @@ #include "clang/Parse/ParseDiagnostic.h" #include "clang/Sema/Scope.h" #include "clang/Sema/ParsedTemplate.h" +#include "clang/Sema/PrettyDeclStackTrace.h" #include "RAIIObjectsForParser.h" #include "llvm/ADT/SmallSet.h" using namespace clang; @@ -28,7 +29,7 @@ using namespace clang; /// specifier-qualifier-list abstract-declarator[opt] /// /// Called type-id in C++. -Action::TypeResult Parser::ParseTypeName(SourceRange *Range) { +TypeResult Parser::ParseTypeName(SourceRange *Range) { // Parse the common declaration-specifiers piece. DeclSpec DS; ParseSpecifierQualifierList(DS); @@ -541,7 +542,7 @@ Decl *Parser::ParseDeclarationAfterDeclarator(Declarator &D, case ParsedTemplateInfo::Template: case ParsedTemplateInfo::ExplicitSpecialization: ThisDecl = Actions.ActOnTemplateDeclarator(getCurScope(), - Action::MultiTemplateParamsArg(Actions, + MultiTemplateParamsArg(Actions, TemplateInfo.TemplateParams->data(), TemplateInfo.TemplateParams->size()), D); @@ -870,7 +871,7 @@ void Parser::ParseDeclarationSpecifiers(DeclSpec &DS, return; case tok::code_completion: { - Action::ParserCompletionContext CCC = Action::PCC_Namespace; + Sema::ParserCompletionContext CCC = Sema::PCC_Namespace; if (DS.hasTypeSpecifier()) { bool AllowNonIdentifiers = (getCurScope()->getFlags() & (Scope::ControlScope | @@ -889,12 +890,12 @@ void Parser::ParseDeclarationSpecifiers(DeclSpec &DS, } if (TemplateInfo.Kind != ParsedTemplateInfo::NonTemplate) - CCC = DSContext == DSC_class? Action::PCC_MemberTemplate - : Action::PCC_Template; + CCC = DSContext == DSC_class? Sema::PCC_MemberTemplate + : Sema::PCC_Template; else if (DSContext == DSC_class) - CCC = Action::PCC_Class; + CCC = Sema::PCC_Class; else if (ObjCImpDecl) - CCC = Action::PCC_ObjCImplementation; + CCC = Sema::PCC_ObjCImplementation; Actions.CodeCompleteOrdinaryName(getCurScope(), CCC); ConsumeCodeCompletionToken(); @@ -1798,9 +1799,8 @@ ParseStructDeclaration(DeclSpec &DS, FieldCallback &Fields) { /// void Parser::ParseStructUnionBody(SourceLocation RecordLoc, unsigned TagType, Decl *TagDecl) { - PrettyStackTraceActionsDecl CrashInfo(TagDecl, RecordLoc, Actions, - PP.getSourceManager(), - "parsing struct/union body"); + PrettyDeclStackTraceEntry CrashInfo(Actions, TagDecl, RecordLoc, + "parsing struct/union body"); SourceLocation LBraceLoc = ConsumeBrace(); @@ -1972,18 +1972,18 @@ void Parser::ParseEnumSpecifier(SourceLocation StartLoc, DeclSpec &DS, // enum foo {..}; void bar() { enum foo; } <- new foo in bar. // enum foo {..}; void bar() { enum foo x; } <- use of old foo. // - Action::TagUseKind TUK; + Sema::TagUseKind TUK; if (Tok.is(tok::l_brace)) - TUK = Action::TUK_Definition; + TUK = Sema::TUK_Definition; else if (Tok.is(tok::semi)) - TUK = Action::TUK_Declaration; + TUK = Sema::TUK_Declaration; else - TUK = Action::TUK_Reference; + TUK = Sema::TUK_Reference; // enums cannot be templates, although they can be referenced from a // template. if (TemplateInfo.Kind != ParsedTemplateInfo::NonTemplate && - TUK != Action::TUK_Reference) { + TUK != Sema::TUK_Reference) { Diag(Tok, diag::err_enum_template); // Skip the rest of this declarator, up until the comma or semicolon. @@ -1999,7 +1999,7 @@ void Parser::ParseEnumSpecifier(SourceLocation StartLoc, DeclSpec &DS, Decl *TagDecl = Actions.ActOnTag(getCurScope(), DeclSpec::TST_enum, TUK, StartLoc, SS, Name, NameLoc, Attr.get(), AS, - Action::MultiTemplateParamsArg(Actions), + MultiTemplateParamsArg(Actions), Owned, IsDependent); if (IsDependent) { // This enum has a dependent nested-name-specifier. Handle it as a diff --git a/lib/Parse/ParseDeclCXX.cpp b/lib/Parse/ParseDeclCXX.cpp index d80410c9ee..df707b22e1 100644 --- a/lib/Parse/ParseDeclCXX.cpp +++ b/lib/Parse/ParseDeclCXX.cpp @@ -17,6 +17,7 @@ #include "clang/Sema/DeclSpec.h" #include "clang/Sema/Scope.h" #include "clang/Sema/ParsedTemplate.h" +#include "clang/Sema/PrettyDeclStackTrace.h" #include "RAIIObjectsForParser.h" using namespace clang; @@ -102,9 +103,8 @@ Decl *Parser::ParseNamespace(unsigned Context, Actions.ActOnStartNamespaceDef(getCurScope(), IdentLoc, Ident, LBrace, AttrList.get()); - PrettyStackTraceActionsDecl CrashInfo(NamespcDecl, NamespaceLoc, Actions, - PP.getSourceManager(), - "parsing namespace"); + PrettyDeclStackTraceEntry CrashInfo(Actions, NamespcDecl, NamespaceLoc, + "parsing namespace"); while (Tok.isNot(tok::r_brace) && Tok.isNot(tok::eof)) { CXX0XAttributeList Attr; @@ -439,7 +439,7 @@ void Parser::ParseDecltypeSpecifier(DeclSpec &DS) { // C++0x [dcl.type.simple]p4: // The operand of the decltype specifier is an unevaluated operand. EnterExpressionEvaluationContext Unevaluated(Actions, - Action::Unevaluated); + Sema::Unevaluated); ExprResult Result = ParseExpression(); if (Result.isInvalid()) { SkipUntil(tok::r_paren); @@ -784,9 +784,9 @@ void Parser::ParseClassSpecifier(tok::TokenKind TagTokKind, // or // &T::operator struct s; // For these, SuppressDeclarations is true. - Action::TagUseKind TUK; + Sema::TagUseKind TUK; if (SuppressDeclarations) - TUK = Action::TUK_Reference; + TUK = Sema::TUK_Reference; else if (Tok.is(tok::l_brace) || (getLang().CPlusPlus && Tok.is(tok::colon))){ if (DS.isFriendSpecified()) { // C++ [class.friend]p2: @@ -797,18 +797,18 @@ void Parser::ParseClassSpecifier(tok::TokenKind TagTokKind, // Skip everything up to the semicolon, so that this looks like a proper // friend class (or template thereof) declaration. SkipUntil(tok::semi, true, true); - TUK = Action::TUK_Friend; + TUK = Sema::TUK_Friend; } else { // Okay, this is a class definition. - TUK = Action::TUK_Definition; + TUK = Sema::TUK_Definition; } } else if (Tok.is(tok::semi)) - TUK = DS.isFriendSpecified() ? Action::TUK_Friend : Action::TUK_Declaration; + TUK = DS.isFriendSpecified() ? Sema::TUK_Friend : Sema::TUK_Declaration; else - TUK = Action::TUK_Reference; + TUK = Sema::TUK_Reference; if (!Name && !TemplateId && (DS.getTypeSpecType() == DeclSpec::TST_error || - TUK != Action::TUK_Definition)) { + TUK != Sema::TUK_Definition)) { if (DS.getTypeSpecType() != DeclSpec::TST_error) { // We have a declaration or reference to an anonymous class. Diag(StartLoc, diag::err_anon_type_definition) @@ -834,7 +834,7 @@ void Parser::ParseClassSpecifier(tok::TokenKind TagTokKind, TemplateId->getTemplateArgs(), TemplateId->NumArgs); if (TemplateInfo.Kind == ParsedTemplateInfo::ExplicitInstantiation && - TUK == Action::TUK_Declaration) { + TUK == Sema::TUK_Declaration) { // This is an explicit instantiation of a class template. TagOrTempResult = Actions.ActOnExplicitInstantiation(getCurScope(), @@ -854,8 +854,8 @@ void Parser::ParseClassSpecifier(tok::TokenKind TagTokKind, // they have template headers, in which case they're ill-formed // (FIXME: "template <class T> friend class A<T>::B<int>;"). // We diagnose this error in ActOnClassTemplateSpecialization. - } else if (TUK == Action::TUK_Reference || - (TUK == Action::TUK_Friend && + } else if (TUK == Sema::TUK_Reference || + (TUK == Sema::TUK_Friend && TemplateInfo.Kind == ParsedTemplateInfo::NonTemplate)) { TypeResult = Actions.ActOnTemplateIdType(TemplateId->Template, @@ -880,7 +880,7 @@ void Parser::ParseClassSpecifier(tok::TokenKind TagTokKind, // but it actually has a definition. Most likely, this was // meant to be an explicit specialization, but the user forgot // the '<>' after 'template'. - assert(TUK == Action::TUK_Definition && "Expected a definition here"); + assert(TUK == Sema::TUK_Definition && "Expected a definition here"); SourceLocation LAngleLoc = PP.getLocForEndOfToken(TemplateInfo.TemplateLoc); @@ -911,13 +911,13 @@ void Parser::ParseClassSpecifier(tok::TokenKind TagTokKind, TemplateArgsPtr, TemplateId->RAngleLoc, AttrList, - Action::MultiTemplateParamsArg(Actions, + MultiTemplateParamsArg(Actions, TemplateParams? &(*TemplateParams)[0] : 0, TemplateParams? TemplateParams->size() : 0)); } TemplateId->Destroy(); } else if (TemplateInfo.Kind == ParsedTemplateInfo::ExplicitInstantiation && - TUK == Action::TUK_Declaration) { + TUK == Sema::TUK_Declaration) { // Explicit instantiation of a member of a class template // specialization, e.g., // @@ -931,7 +931,7 @@ void Parser::ParseClassSpecifier(tok::TokenKind TagTokKind, NameLoc, AttrList); } else { if (TemplateInfo.Kind == ParsedTemplateInfo::ExplicitInstantiation && - TUK == Action::TUK_Definition) { + TUK == Sema::TUK_Definition) { // FIXME: Diagnose this particular error. } @@ -940,7 +940,7 @@ void Parser::ParseClassSpecifier(tok::TokenKind TagTokKind, // Declaration or definition of a class type TagOrTempResult = Actions.ActOnTag(getCurScope(), TagType, TUK, StartLoc, SS, Name, NameLoc, AttrList, AS, - Action::MultiTemplateParamsArg(Actions, + MultiTemplateParamsArg(Actions, TemplateParams? &(*TemplateParams)[0] : 0, TemplateParams? TemplateParams->size() : 0), Owned, IsDependent); @@ -953,7 +953,7 @@ void Parser::ParseClassSpecifier(tok::TokenKind TagTokKind, } // If there is a body, parse it and inform the actions module. - if (TUK == Action::TUK_Definition) { + if (TUK == Sema::TUK_Definition) { assert(Tok.is(tok::l_brace) || (getLang().CPlusPlus && Tok.is(tok::colon))); if (getLang().CPlusPlus) @@ -990,7 +990,7 @@ void Parser::ParseClassSpecifier(tok::TokenKind TagTokKind, // the end of the declaration and recover that way. // // This switch enumerates the valid "follow" set for definition. - if (TUK == Action::TUK_Definition) { + if (TUK == Sema::TUK_Definition) { bool ExpectedSemi = true; switch (Tok.getKind()) { default: break; @@ -1337,7 +1337,7 @@ void Parser::ParseCXXClassMemberDeclaration(AccessSpecifier AS, DS.AddAttributes(AttrList.AttrList); ParseDeclarationSpecifiers(DS, TemplateInfo, AS, DSC_class); - Action::MultiTemplateParamsArg TemplateParams(Actions, + MultiTemplateParamsArg TemplateParams(Actions, TemplateInfo.TemplateParams? TemplateInfo.TemplateParams->data() : 0, TemplateInfo.TemplateParams? TemplateInfo.TemplateParams->size() : 0); @@ -1538,9 +1538,8 @@ void Parser::ParseCXXMemberSpecification(SourceLocation RecordLoc, TagType == DeclSpec::TST_union || TagType == DeclSpec::TST_class) && "Invalid TagType!"); - PrettyStackTraceActionsDecl CrashInfo(TagDecl, RecordLoc, Actions, - PP.getSourceManager(), - "parsing struct/union/class body"); + PrettyDeclStackTraceEntry CrashInfo(Actions, TagDecl, RecordLoc, + "parsing struct/union/class body"); // Determine whether this is a non-nested class. Note that local // classes are *not* considered to be nested classes. @@ -2062,8 +2061,7 @@ CXX0XAttributeList Parser::ParseCXX0XAttributes(SourceLocation *EndLoc) { /// [C++0x] 'align' '(' assignment-expression ')' ExprResult Parser::ParseCXX0XAlignArgument(SourceLocation Start) { if (isTypeIdInParens()) { - EnterExpressionEvaluationContext Unevaluated(Actions, - Action::Unevaluated); + EnterExpressionEvaluationContext Unevaluated(Actions, Sema::Unevaluated); SourceLocation TypeLoc = Tok.getLocation(); ParsedType Ty = ParseTypeName().get(); SourceRange TypeRange(Start, Tok.getLocation()); diff --git a/lib/Parse/ParseExpr.cpp b/lib/Parse/ParseExpr.cpp index 7020fa412e..d70eb63a78 100644 --- a/lib/Parse/ParseExpr.cpp +++ b/lib/Parse/ParseExpr.cpp @@ -220,7 +220,7 @@ Parser::ParseExpressionWithLeadingExtension(SourceLocation ExtLoc) { /// ExprResult Parser::ParseAssignmentExpression() { if (Tok.is(tok::code_completion)) { - Actions.CodeCompleteOrdinaryName(getCurScope(), Action::PCC_Expression); + Actions.CodeCompleteOrdinaryName(getCurScope(), Sema::PCC_Expression); ConsumeCodeCompletionToken(); } @@ -261,7 +261,7 @@ ExprResult Parser::ParseConstantExpression() { // An expression is potentially evaluated unless it appears where an // integral constant expression is required (see 5.19) [...]. EnterExpressionEvaluationContext Unevaluated(Actions, - Action::Unevaluated); + Sema::Unevaluated); ExprResult LHS(ParseCastExpression(false)); if (LHS.isInvalid()) return move(LHS); @@ -905,7 +905,7 @@ ExprResult Parser::ParseCastExpression(bool isUnaryExpression, case tok::caret: return ParsePostfixExpressionSuffix(ParseBlockLiteralExpression()); case tok::code_completion: - Actions.CodeCompleteOrdinaryName(getCurScope(), Action::PCC_Expression); + Actions.CodeCompleteOrdinaryName(getCurScope(), Sema::PCC_Expression); ConsumeCodeCompletionToken(); return ParseCastExpression(isUnaryExpression, isAddressOfOperand, NotCastExpr, TypeOfCast); @@ -995,7 +995,7 @@ Parser::ParsePostfixExpressionSuffix(ExprResult LHS) { } if (Tok.isNot(tok::r_paren)) { - if (ParseExpressionList(ArgExprs, CommaLocs, &Action::CodeCompleteCall, + if (ParseExpressionList(ArgExprs, CommaLocs, &Sema::CodeCompleteCall, LHS.get())) { SkipUntil(tok::r_paren); return ExprError(); @@ -1132,7 +1132,7 @@ Parser::ParseExprAfterTypeofSizeofAlignof(const Token &OpTok, // The GNU typeof and alignof extensions also behave as unevaluated // operands. EnterExpressionEvaluationContext Unevaluated(Actions, - Action::Unevaluated); + Sema::Unevaluated); Operand = ParseCastExpression(true/*isUnaryExpression*/); } else { // If it starts with a '(', we know that it is either a parenthesized @@ -1149,7 +1149,7 @@ Parser::ParseExprAfterTypeofSizeofAlignof(const Token &OpTok, // The GNU typeof and alignof extensions also behave as unevaluated // operands. EnterExpressionEvaluationContext Unevaluated(Actions, - Action::Unevaluated); + Sema::Unevaluated); Operand = ParseParenExpression(ExprType, true/*stopIfCastExpr*/, ParsedType(), CastTy, RParenLoc); CastRange = SourceRange(LParenLoc, RParenLoc); @@ -1287,9 +1287,9 @@ ExprResult Parser::ParseBuiltinPrimaryExpression() { } // Keep track of the various subcomponents we see. - llvm::SmallVector<Action::OffsetOfComponent, 4> Comps; + llvm::SmallVector<Sema::OffsetOfComponent, 4> Comps; - Comps.push_back(Action::OffsetOfComponent()); + Comps.push_back(Sema::OffsetOfComponent()); Comps.back().isBrackets = false; Comps.back().U.IdentInfo = Tok.getIdentifierInfo(); Comps.back().LocStart = Comps.back().LocEnd = ConsumeToken(); @@ -1298,7 +1298,7 @@ ExprResult Parser::ParseBuiltinPrimaryExpression() { while (1) { if (Tok.is(tok::period)) { // offsetof-member-designator: offsetof-member-designator '.' identifier - Comps.push_back(Action::OffsetOfComponent()); + Comps.push_back(Sema::OffsetOfComponent()); Comps.back().isBrackets = false; Comps.back().LocStart = ConsumeToken(); @@ -1312,7 +1312,7 @@ ExprResult Parser::ParseBuiltinPrimaryExpression() { } else if (Tok.is(tok::l_square)) { // offsetof-member-designator: offsetof-member-design '[' expression ']' - Comps.push_back(Action::OffsetOfComponent()); + Comps.push_back(Sema::OffsetOfComponent()); Comps.back().isBrackets = true; Comps.back().LocStart = ConsumeBracket(); Res = ParseExpression(); @@ -1579,7 +1579,7 @@ ExprResult Parser::ParseStringLiteralExpression() { /// bool Parser::ParseExpressionList(llvm::SmallVectorImpl<Expr*> &Exprs, llvm::SmallVectorImpl<SourceLocation> &CommaLocs, - void (Action::*Completer)(Scope *S, + void (Sema::*Completer)(Scope *S, Expr *Data, Expr **Args, unsigned NumArgs), diff --git a/lib/Parse/ParseExprCXX.cpp b/lib/Parse/ParseExprCXX.cpp index de9498eff5..7270f6a909 100644 --- a/lib/Parse/ParseExprCXX.cpp +++ b/lib/Parse/ParseExprCXX.cpp @@ -530,7 +530,7 @@ ExprResult Parser::ParseCXXTypeid() { // polymorphic class type until after we've parsed the expression, so // we the expression is potentially potentially evaluated. EnterExpressionEvaluationContext Unevaluated(Actions, - Action::PotentiallyPotentiallyEvaluated); + Sema::PotentiallyPotentiallyEvaluated); Result = ParseExpression(); // Match the ')'. @@ -735,7 +735,7 @@ bool Parser::ParseCXXCondition(ExprResult &ExprOut, SourceLocation Loc, bool ConvertToBoolean) { if (Tok.is(tok::code_completion)) { - Actions.CodeCompleteOrdinaryName(getCurScope(), Action::PCC_Condition); + Actions.CodeCompleteOrdinaryName(getCurScope(), Sema::PCC_Condition); ConsumeCodeCompletionToken(); } @@ -1147,7 +1147,7 @@ bool Parser::ParseUnqualifiedIdTemplateId(CXXScopeSpec &SS, TemplateArgs.size()); // Constructor and destructor names. - Action::TypeResult Type + TypeResult Type = Actions.ActOnTemplateIdType(Template, NameLoc, LAngleLoc, TemplateArgsPtr, RAngleLoc); @@ -1339,7 +1339,7 @@ bool Parser::ParseUnqualifiedIdOperator(CXXScopeSpec &SS, bool EnteringContext, ParseDeclaratorInternal(D, /*DirectDeclParser=*/0); // Finish up the type. - Action::TypeResult Ty = Actions.ActOnTypeName(getCurScope(), D); + TypeResult Ty = Actions.ActOnTypeName(getCurScope(), D); if (Ty.isInvalid()) return true; diff --git a/lib/Parse/ParseInit.cpp b/lib/Parse/ParseInit.cpp index 2589867b03..4347294141 100644 --- a/lib/Parse/ParseInit.cpp +++ b/lib/Parse/ParseInit.cpp @@ -184,15 +184,15 @@ ExprResult Parser::ParseInitializerWithPotentialDesignator() { // Three cases. This is a message send to a type: [type foo] // This is a message send to super: [super foo] // This is a message sent to an expr: [super.bar foo] - switch (Action::ObjCMessageKind Kind + switch (Sema::ObjCMessageKind Kind = Actions.getObjCMessageKind(getCurScope(), II, IILoc, II == Ident_super, NextToken().is(tok::period), ReceiverType)) { - case Action::ObjCSuperMessage: - case Action::ObjCClassMessage: + case Sema::ObjCSuperMessage: + case Sema::ObjCClassMessage: CheckArrayDesignatorSyntax(*this, StartLoc, Desig); - if (Kind == Action::ObjCSuperMessage) + if (Kind == Sema::ObjCSuperMessage) return ParseAssignmentExprWithObjCMessageExprStart(StartLoc, ConsumeToken(), ParsedType(), @@ -208,7 +208,7 @@ ExprResult Parser::ParseInitializerWithPotentialDesignator() { ReceiverType, 0); - case Action::ObjCInstanceMessage: + case Sema::ObjCInstanceMessage: // Fall through; we'll just parse the expression and // (possibly) treat this like an Objective-C message send // later. @@ -321,7 +321,7 @@ ExprResult Parser::ParseBraceInitializer() { if (!getLang().CPlusPlus) Diag(LBraceLoc, diag::ext_gnu_empty_initializer); // Match the '}'. - return Actions.ActOnInitList(LBraceLoc, Action::MultiExprArg(Actions), + return Actions.ActOnInitList(LBraceLoc, MultiExprArg(Actions), ConsumeBrace()); } diff --git a/lib/Parse/ParseObjc.cpp b/lib/Parse/ParseObjc.cpp index 4b65652011..914d52ea38 100644 --- a/lib/Parse/ParseObjc.cpp +++ b/lib/Parse/ParseObjc.cpp @@ -14,6 +14,7 @@ #include "clang/Parse/ParseDiagnostic.h" #include "clang/Parse/Parser.h" #include "clang/Sema/DeclSpec.h" +#include "clang/Sema/PrettyDeclStackTrace.h" #include "clang/Sema/Scope.h" #include "llvm/ADT/SmallVector.h" using namespace clang; @@ -348,8 +349,8 @@ void Parser::ParseObjCInterfaceDeclList(Decl *interfaceDecl, // Code completion within an Objective-C interface. if (Tok.is(tok::code_completion)) { Actions.CodeCompleteOrdinaryName(getCurScope(), - ObjCImpDecl? Action::PCC_ObjCImplementation - : Action::PCC_ObjCInterface); + ObjCImpDecl? Sema::PCC_ObjCImplementation + : Sema::PCC_ObjCInterface); ConsumeCodeCompletionToken(); } @@ -840,10 +841,10 @@ Decl *Parser::ParseObjCMethodDecl(SourceLocation mLoc, } llvm::SmallVector<IdentifierInfo *, 12> KeyIdents; - llvm::SmallVector<Action::ObjCArgInfo, 12> ArgInfos; + llvm::SmallVector<Sema::ObjCArgInfo, 12> ArgInfos; while (1) { - Action::ObjCArgInfo ArgInfo; + Sema::ObjCArgInfo ArgInfo; // Each iteration parses a single keyword argument. if (Tok.isNot(tok::colon)) { @@ -951,7 +952,7 @@ Decl *Parser::ParseObjCMethodDecl(SourceLocation mLoc, PD.complete(Result); // Delete referenced AttributeList objects. - for (llvm::SmallVectorImpl<Action::ObjCArgInfo>::iterator + for (llvm::SmallVectorImpl<Sema::ObjCArgInfo>::iterator I = ArgInfos.begin(), E = ArgInfos.end(); I != E; ++I) delete I->ArgAttrs; @@ -1076,7 +1077,7 @@ void Parser::ParseObjCClassInstanceVariables(Decl *interfaceDecl, if (Tok.is(tok::code_completion)) { Actions.CodeCompleteOrdinaryName(getCurScope(), - Action::PCC_ObjCInstanceVariableList); + Sema::PCC_ObjCInstanceVariableList); ConsumeCodeCompletionToken(); } @@ -1634,9 +1635,8 @@ StmtResult Parser::ParseObjCTryStmt(SourceLocation atLoc) { Decl *Parser::ParseObjCMethodDefinition() { Decl *MDecl = ParseObjCMethodPrototype(ObjCImpDecl); - PrettyStackTraceActionsDecl CrashInfo(MDecl, Tok.getLocation(), Actions, - PP.getSourceManager(), - "parsing Objective-C method"); + PrettyDeclStackTraceEntry CrashInfo(Actions, MDecl, Tok.getLocation(), + "parsing Objective-C method"); // parse optional ';' if (Tok.is(tok::semi)) { @@ -1896,11 +1896,11 @@ ExprResult Parser::ParseObjCMessageExpression() { Name == Ident_super, NextToken().is(tok::period), ReceiverType)) { - case Action::ObjCSuperMessage: + case Sema::ObjCSuperMessage: return ParseObjCMessageExpressionBody(LBracLoc, ConsumeToken(), ParsedType(), 0); - case Action::ObjCClassMessage: + case Sema::ObjCClassMessage: if (!ReceiverType) { SkipUntil(tok::r_square); return ExprError(); @@ -1911,7 +1911,7 @@ ExprResult Parser::ParseObjCMessageExpression() { return ParseObjCMessageExpressionBody(LBracLoc, SourceLocation(), ReceiverType, 0); - case Action::ObjCInstanceMessage: + case Sema::ObjCInstanceMessage: // Fall through to parse an expression. break; } @@ -2090,20 +2090,20 @@ Parser::ParseObjCMessageExpressionBody(SourceLocation LBracLoc, if (SuperLoc.isValid()) return Actions.ActOnSuperMessage(getCurScope(), SuperLoc, Sel, LBracLoc, SelectorLoc, RBracLoc, - Action::MultiExprArg(Actions, - KeyExprs.take(), - KeyExprs.size())); + MultiExprArg(Actions, + KeyExprs.take(), + KeyExprs.size())); else if (ReceiverType) return Actions.ActOnClassMessage(getCurScope(), ReceiverType, Sel, LBracLoc, SelectorLoc, RBracLoc, - Action::MultiExprArg(Actions, - KeyExprs.take(), - KeyExprs.size())); + MultiExprArg(Actions, + KeyExprs.take(), + KeyExprs.size())); return Actions.ActOnInstanceMessage(getCurScope(), ReceiverExpr, Sel, LBracLoc, SelectorLoc, RBracLoc, - Action::MultiExprArg(Actions, - KeyExprs.take(), - KeyExprs.size())); + MultiExprArg(Actions, + KeyExprs.take(), + KeyExprs.size())); } ExprResult Parser::ParseObjCStringLiteral(SourceLocation AtLoc) { diff --git a/lib/Parse/ParsePragma.cpp b/lib/Parse/ParsePragma.cpp index e4693ad131..ddba09ae0f 100644 --- a/lib/Parse/ParsePragma.cpp +++ b/lib/Parse/ParsePragma.cpp @@ -15,7 +15,6 @@ #include "clang/Parse/ParseDiagnostic.h" #include "clang/Parse/Parser.h" #include "clang/Lex/Preprocessor.h" -#include "clang/Sema/Action.h" using namespace clang; @@ -85,7 +84,7 @@ void PragmaPackHandler::HandlePragma(Preprocessor &PP, Token &PackTok) { return; } - Action::PragmaPackKind Kind = Action::PPK_Default; + Sema::PragmaPackKind Kind = Sema::PPK_Default; IdentifierInfo *Name = 0; ExprResult Alignment; SourceLocation LParenLoc = Tok.getLocation(); @@ -99,13 +98,13 @@ void PragmaPackHandler::HandlePragma(Preprocessor &PP, Token &PackTok) { } else if (Tok.is(tok::identifier)) { const IdentifierInfo *II = Tok.getIdentifierInfo(); if (II->isStr("show")) { - Kind = Action::PPK_Show; + Kind = Sema::PPK_Show; PP.Lex(Tok); } else { if (II->isStr("push")) { - Kind = Action::PPK_Push; + Kind = Sema::PPK_Push; } else if (II->isStr("pop")) { - Kind = Action::PPK_Pop; |