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
diff --git a/lib/Sema/Action.cpp b/lib/Sema/Action.cpp
deleted file mode 100644
index 1df0e01..0000000
--- a/lib/Sema/Action.cpp
+++ /dev/null
@@ -1,38 +0,0 @@
-//===--- Action.cpp - Implement the Action class --------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the Action interface.
-//
-//===----------------------------------------------------------------------===//
-
-#include "clang/Sema/Action.h"
-#include "clang/Sema/DeclSpec.h"
-#include "clang/Sema/Scope.h"
-#include "clang/Basic/TargetInfo.h"
-#include "llvm/Support/Allocator.h"
-#include "llvm/Support/RecyclingAllocator.h"
-#include "llvm/Support/raw_ostream.h"
-using namespace clang;
-
-void PrettyStackTraceActionsDecl::print(llvm::raw_ostream &OS) const {
- if (Loc.isValid()) {
- Loc.print(OS, SM);
- OS << ": ";
- }
- OS << Message;
-
- std::string Name = Actions.getDeclName(TheDecl);
- if (!Name.empty())
- OS << " '" << Name << '\'';
-
- OS << '\n';
-}
-
-/// Out-of-line virtual destructor to provide home for Action class.
-Action::~Action() {}
diff --git a/lib/Sema/CMakeLists.txt b/lib/Sema/CMakeLists.txt
index 2144bfe..e65bb22 100644
--- a/lib/Sema/CMakeLists.txt
+++ b/lib/Sema/CMakeLists.txt
@@ -1,7 +1,6 @@
set(LLVM_NO_RTTI 1)
add_clang_library(clangSema
- Action.cpp
AnalysisBasedWarnings.cpp
AttributeList.cpp
CodeCompleteConsumer.cpp
diff --git a/lib/Sema/Sema.cpp b/lib/Sema/Sema.cpp
index 2de4d28..60e308a 100644
--- a/lib/Sema/Sema.cpp
+++ b/lib/Sema/Sema.cpp
@@ -20,6 +20,7 @@
#include "llvm/ADT/APFloat.h"
#include "clang/Sema/CXXFieldCollector.h"
#include "clang/Sema/ExternalSemaSource.h"
+#include "clang/Sema/PrettyDeclStackTrace.h"
#include "clang/Sema/Scope.h"
#include "clang/Sema/ScopeInfo.h"
#include "clang/Sema/SemaConsumer.h"
@@ -555,3 +556,21 @@
// Pin this vtable to this file.
ExternalSemaSource::~ExternalSemaSource() {}
+
+void PrettyDeclStackTraceEntry::print(llvm::raw_ostream &OS) const {
+ SourceLocation Loc = this->Loc;
+ if (!Loc.isValid() && TheDecl) Loc = TheDecl->getLocation();
+ if (Loc.isValid()) {
+ Loc.print(OS, S.getSourceManager());
+ OS << ": ";
+ }
+ OS << Message;
+
+ if (TheDecl && isa<NamedDecl>(TheDecl)) {
+ std::string Name = cast<NamedDecl>(TheDecl)->getNameAsString();
+ if (!Name.empty())
+ OS << " '" << Name << '\'';
+ }
+
+ OS << '\n';
+}
diff --git a/lib/Sema/SemaAttr.cpp b/lib/Sema/SemaAttr.cpp
index 917bf2b..0921156 100644
--- a/lib/Sema/SemaAttr.cpp
+++ b/lib/Sema/SemaAttr.cpp
@@ -139,7 +139,7 @@
// Reset just pops the top of the stack, or resets the current alignment to
// default.
- if (Kind == Action::POAK_Reset) {
+ if (Kind == Sema::POAK_Reset) {
if (!Context->pop(0, /*IsReset=*/true)) {
Diag(PragmaLoc, diag::warn_pragma_options_align_reset_failed)
<< "stack empty";
@@ -212,11 +212,11 @@
PragmaPackStack *Context = static_cast<PragmaPackStack*>(PackContext);
switch (Kind) {
- case Action::PPK_Default: // pack([n])
+ case Sema::PPK_Default: // pack([n])
Context->setAlignment(AlignmentVal);
break;
- case Action::PPK_Show: // pack(show)
+ case Sema::PPK_Show: // pack(show)
// Show the current alignment, making sure to show the right value
// for the default.
AlignmentVal = Context->getAlignment();
@@ -229,14 +229,14 @@
Diag(PragmaLoc, diag::warn_pragma_pack_show) << AlignmentVal;
break;
- case Action::PPK_Push: // pack(push [, id] [, [n])
+ case Sema::PPK_Push: // pack(push [, id] [, [n])
Context->push(Name);
// Set the new alignment if specified.
if (Alignment)
Context->setAlignment(AlignmentVal);
break;
- case Action::PPK_Pop: // pack(pop [, id] [, n])
+ case Sema::PPK_Pop: // pack(pop [, id] [, n])
// MSDN, C/C++ Preprocessor Reference > Pragma Directives > pack:
// "#pragma pack(pop, identifier, n) is undefined"
if (Alignment && Name)
diff --git a/lib/Sema/SemaCXXCast.cpp b/lib/Sema/SemaCXXCast.cpp
index c58c92c..21b1a73 100644
--- a/lib/Sema/SemaCXXCast.cpp
+++ b/lib/Sema/SemaCXXCast.cpp
@@ -120,7 +120,7 @@
Sema::ActOnCXXNamedCast(SourceLocation OpLoc, tok::TokenKind Kind,
SourceLocation LAngleBracketLoc, ParsedType Ty,
SourceLocation RAngleBracketLoc,
- SourceLocation LParenLoc, ExprArg E,
+ SourceLocation LParenLoc, Expr *E,
SourceLocation RParenLoc) {
TypeSourceInfo *DestTInfo;
@@ -135,7 +135,7 @@
ExprResult
Sema::BuildCXXNamedCast(SourceLocation OpLoc, tok::TokenKind Kind,
- TypeSourceInfo *DestTInfo, ExprArg Ex,
+ TypeSourceInfo *DestTInfo, Expr *Ex,
SourceRange AngleBrackets, SourceRange Parens) {
QualType DestType = DestTInfo->getType();
@@ -965,8 +965,7 @@
return TC_NotApplicable;
ExprResult Result
- = InitSeq.Perform(Self, Entity, InitKind,
- Action::MultiExprArg(Self, &SrcExpr, 1));
+ = InitSeq.Perform(Self, Entity, InitKind, MultiExprArg(Self, &SrcExpr, 1));
if (Result.isInvalid()) {
msg = 0;
return TC_Failed;
diff --git a/lib/Sema/SemaCodeComplete.cpp b/lib/Sema/SemaCodeComplete.cpp
index 4c06fac..aade627 100644
--- a/lib/Sema/SemaCodeComplete.cpp
+++ b/lib/Sema/SemaCodeComplete.cpp
@@ -1113,7 +1113,7 @@
}
}
-static void AddStorageSpecifiers(Action::ParserCompletionContext CCC,
+static void AddStorageSpecifiers(Sema::ParserCompletionContext CCC,
const LangOptions &LangOpts,
ResultBuilder &Results) {
typedef CodeCompletionResult Result;
@@ -1124,13 +1124,13 @@
Results.AddResult(Result("static"));
}
-static void AddFunctionSpecifiers(Action::ParserCompletionContext CCC,
+static void AddFunctionSpecifiers(Sema::ParserCompletionContext CCC,
const LangOptions &LangOpts,
ResultBuilder &Results) {
typedef CodeCompletionResult Result;
switch (CCC) {
- case Action::PCC_Class:
- case Action::PCC_MemberTemplate:
+ case Sema::PCC_Class:
+ case Sema::PCC_MemberTemplate:
if (LangOpts.CPlusPlus) {
Results.AddResult(Result("explicit"));
Results.AddResult(Result("friend"));
@@ -1139,21 +1139,21 @@
}
// Fall through
- case Action::PCC_ObjCInterface:
- case Action::PCC_ObjCImplementation:
- case Action::PCC_Namespace:
- case Action::PCC_Template:
+ case Sema::PCC_ObjCInterface:
+ case Sema::PCC_ObjCImplementation:
+ case Sema::PCC_Namespace:
+ case Sema::PCC_Template:
if (LangOpts.CPlusPlus || LangOpts.C99)
Results.AddResult(Result("inline"));
break;
- case Action::PCC_ObjCInstanceVariableList:
- case Action::PCC_Expression:
- case Action::PCC_Statement:
- case Action::PCC_ForInit:
- case Action::PCC_Condition:
- case Action::PCC_RecoveryInFunction:
- case Action::PCC_Type:
+ case Sema::PCC_ObjCInstanceVariableList:
+ case Sema::PCC_Expression:
+ case Sema::PCC_Statement:
+ case Sema::PCC_ForInit:
+ case Sema::PCC_Condition:
+ case Sema::PCC_RecoveryInFunction:
+ case Sema::PCC_Type:
break;
}
}
@@ -1181,29 +1181,29 @@
Results.AddResult(CodeCompletionResult(Pattern));
}
-static bool WantTypesInContext(Action::ParserCompletionContext CCC,
+static bool WantTypesInContext(Sema::ParserCompletionContext CCC,
const LangOptions &LangOpts) {
if (LangOpts.CPlusPlus)
return true;
switch (CCC) {
- case Action::PCC_Namespace:
- case Action::PCC_Class:
- case Action::PCC_ObjCInstanceVariableList:
- case Action::PCC_Template:
- case Action::PCC_MemberTemplate:
- case Action::PCC_Statement:
- case Action::PCC_RecoveryInFunction:
- case Action::PCC_Type:
+ case Sema::PCC_Namespace:
+ case Sema::PCC_Class:
+ case Sema::PCC_ObjCInstanceVariableList:
+ case Sema::PCC_Template:
+ case Sema::PCC_MemberTemplate:
+ case Sema::PCC_Statement:
+ case Sema::PCC_RecoveryInFunction:
+ case Sema::PCC_Type:
return true;
- case Action::PCC_ObjCInterface:
- case Action::PCC_ObjCImplementation:
- case Action::PCC_Expression:
- case Action::PCC_Condition:
+ case Sema::PCC_ObjCInterface:
+ case Sema::PCC_ObjCImplementation:
+ case Sema::PCC_Expression:
+ case Sema::PCC_Condition:
return false;
- case Action::PCC_ForInit:
+ case Sema::PCC_ForInit:
return LangOpts.ObjC1 || LangOpts.C99;
}
@@ -1211,13 +1211,13 @@
}
/// \brief Add language constructs that show up for "ordinary" names.
-static void AddOrdinaryNameResults(Action::ParserCompletionContext CCC,
+static void AddOrdinaryNameResults(Sema::ParserCompletionContext CCC,
Scope *S,
Sema &SemaRef,
ResultBuilder &Results) {
typedef CodeCompletionResult Result;
switch (CCC) {
- case Action::PCC_Namespace:
+ case Sema::PCC_Namespace:
if (SemaRef.getLangOptions().CPlusPlus) {
CodeCompletionString *Pattern = 0;
@@ -1276,7 +1276,7 @@
AddTypedefResult(Results);
// Fall through
- case Action::PCC_Class:
+ case Sema::PCC_Class:
if (SemaRef.getLangOptions().CPlusPlus) {
// Using declaration
CodeCompletionString *Pattern = new CodeCompletionString;
@@ -1300,7 +1300,7 @@
Results.AddResult(Result(Pattern));
}
- if (CCC == Action::PCC_Class) {
+ if (CCC == Sema::PCC_Class) {
AddTypedefResult(Results);
// public:
@@ -1324,8 +1324,8 @@
}
// Fall through
- case Action::PCC_Template:
- case Action::PCC_MemberTemplate:
+ case Sema::PCC_Template:
+ case Sema::PCC_MemberTemplate:
if (SemaRef.getLangOptions().CPlusPlus && Results.includeCodePatterns()) {
// template < parameters >
CodeCompletionString *Pattern = new CodeCompletionString;
@@ -1340,24 +1340,24 @@
AddFunctionSpecifiers(CCC, SemaRef.getLangOptions(), Results);
break;
- case Action::PCC_ObjCInterface:
+ case Sema::PCC_ObjCInterface:
AddObjCInterfaceResults(SemaRef.getLangOptions(), Results, true);
AddStorageSpecifiers(CCC, SemaRef.getLangOptions(), Results);
AddFunctionSpecifiers(CCC, SemaRef.getLangOptions(), Results);
break;
- case Action::PCC_ObjCImplementation:
+ case Sema::PCC_ObjCImplementation:
AddObjCImplementationResults(SemaRef.getLangOptions(), Results, true);
AddStorageSpecifiers(CCC, SemaRef.getLangOptions(), Results);
AddFunctionSpecifiers(CCC, SemaRef.getLangOptions(), Results);
break;
- case Action::PCC_ObjCInstanceVariableList:
+ case Sema::PCC_ObjCInstanceVariableList:
AddObjCVisibilityResults(SemaRef.getLangOptions(), Results, true);
break;
- case Action::PCC_RecoveryInFunction:
- case Action::PCC_Statement: {
+ case Sema::PCC_RecoveryInFunction:
+ case Sema::PCC_Statement: {
AddTypedefResult(Results);
CodeCompletionString *Pattern = 0;
@@ -1529,12 +1529,12 @@
}
// Fall through (for statement expressions).
- case Action::PCC_ForInit:
- case Action::PCC_Condition:
+ case Sema::PCC_ForInit:
+ case Sema::PCC_Condition:
AddStorageSpecifiers(CCC, SemaRef.getLangOptions(), Results);
// Fall through: conditions and statements can have expressions.
- case Action::PCC_Expression: {
+ case Sema::PCC_Expression: {
CodeCompletionString *Pattern = 0;
if (SemaRef.getLangOptions().CPlusPlus) {
// 'this', if we're in a non-static member function.
@@ -1670,14 +1670,14 @@
break;
}
- case Action::PCC_Type:
+ case Sema::PCC_Type:
break;
}
if (WantTypesInContext(CCC, SemaRef.getLangOptions()))
AddTypeSpecifierResults(SemaRef.getLangOptions(), Results);
- if (SemaRef.getLangOptions().CPlusPlus && CCC != Action::PCC_Type)
+ if (SemaRef.getLangOptions().CPlusPlus && CCC != Sema::PCC_Type)
Results.AddResult(Result("operator"));
}
@@ -2322,35 +2322,35 @@
static enum CodeCompletionContext::Kind mapCodeCompletionContext(Sema &S,
Sema::ParserCompletionContext PCC) {
switch (PCC) {
- case Action::PCC_Namespace:
+ case Sema::PCC_Namespace:
return CodeCompletionContext::CCC_TopLevel;
- case Action::PCC_Class:
+ case Sema::PCC_Class:
return CodeCompletionContext::CCC_ClassStructUnion;
- case Action::PCC_ObjCInterface:
+ case Sema::PCC_ObjCInterface:
return CodeCompletionContext::CCC_ObjCInterface;
- case Action::PCC_ObjCImplementation:
+ case Sema::PCC_ObjCImplementation:
return CodeCompletionContext::CCC_ObjCImplementation;
- case Action::PCC_ObjCInstanceVariableList:
+ case Sema::PCC_ObjCInstanceVariableList:
return CodeCompletionContext::CCC_ObjCIvarList;
- case Action::PCC_Template:
- case Action::PCC_MemberTemplate:
- case Action::PCC_RecoveryInFunction:
+ case Sema::PCC_Template:
+ case Sema::PCC_MemberTemplate:
+ case Sema::PCC_RecoveryInFunction:
return CodeCompletionContext::CCC_Other;
- case Action::PCC_Expression:
- case Action::PCC_ForInit:
- case Action::PCC_Condition:
+ case Sema::PCC_Expression:
+ case Sema::PCC_ForInit:
+ case Sema::PCC_Condition:
return CodeCompletionContext::CCC_Expression;
- case Action::PCC_Statement:
+ case Sema::PCC_Statement:
return CodeCompletionContext::CCC_Statement;
- case Action::PCC_Type:
+ case Sema::PCC_Type:
return CodeCompletionContext::CCC_Type;
}
@@ -4855,8 +4855,8 @@
void Sema::CodeCompleteInPreprocessorConditionalExclusion(Scope *S) {
CodeCompleteOrdinaryName(S,
- S->getFnParent()? Action::PCC_RecoveryInFunction
- : Action::PCC_Namespace);
+ S->getFnParent()? Sema::PCC_RecoveryInFunction
+ : Sema::PCC_Namespace);
}
void Sema::CodeCompletePreprocessorMacroName(bool IsDefinition) {
@@ -4912,8 +4912,8 @@
// do for function calls.
CodeCompleteOrdinaryName(S,
- S->getFnParent()? Action::PCC_RecoveryInFunction
- : Action::PCC_Namespace);
+ S->getFnParent()? Sema::PCC_RecoveryInFunction
+ : Sema::PCC_Namespace);
}
void Sema::CodeCompleteNaturalLanguage() {
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index 3473bff..122a956 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -42,14 +42,6 @@
using namespace clang;
using namespace sema;
-/// getDeclName - Return a pretty name for the specified decl if possible, or
-/// an empty string if not. This is used for pretty crash reporting.
-std::string Sema::getDeclName(Decl *D) {
- if (NamedDecl *DN = dyn_cast_or_null<NamedDecl>(D))
- return DN->getQualifiedNameAsString();
- return "";
-}
-
Sema::DeclGroupPtrTy Sema::ConvertDeclToDeclGroup(Decl *Ptr) {
return DeclGroupPtrTy::make(DeclGroupRef(Ptr));
}
@@ -4921,7 +4913,7 @@
const_cast<VarDecl*>(NRVOCandidate)->setNRVOVariable(true);
}
-Decl *Sema::ActOnFinishFunctionBody(Decl *D, StmtArg BodyArg) {
+Decl *Sema::ActOnFinishFunctionBody(Decl *D, Stmt *BodyArg) {
return ActOnFinishFunctionBody(D, move(BodyArg), false);
}
diff --git a/lib/Sema/SemaDeclAttr.cpp b/lib/Sema/SemaDeclAttr.cpp
index 177013e..9b36b31 100644
--- a/lib/Sema/SemaDeclAttr.cpp
+++ b/lib/Sema/SemaDeclAttr.cpp
@@ -2412,7 +2412,7 @@
///
/// The state token we use is the start index of this scope
/// on the warning stack.
-Action::ParsingDeclStackState Sema::PushParsingDeclaration() {
+Sema::ParsingDeclStackState Sema::PushParsingDeclaration() {
ParsingDeclDepth++;
return (ParsingDeclStackState) DelayedDiagnostics.size();
}
diff --git a/lib/Sema/SemaDeclCXX.cpp b/lib/Sema/SemaDeclCXX.cpp
index 223569d..513836a 100644
--- a/lib/Sema/SemaDeclCXX.cpp
+++ b/lib/Sema/SemaDeclCXX.cpp
@@ -584,7 +584,7 @@
/// example:
/// class foo : public bar, virtual private baz {
/// 'public bar' and 'virtual private baz' are each base-specifiers.
-Sema::BaseResult
+BaseResult
Sema::ActOnBaseSpecifier(Decl *classdecl, SourceRange SpecifierRange,
bool Virtual, AccessSpecifier Access,
ParsedType basetype, SourceLocation BaseLoc) {
@@ -1056,7 +1056,7 @@
}
/// ActOnMemInitializer - Handle a C++ member initializer.
-Sema::MemInitResult
+MemInitResult
Sema::ActOnMemInitializer(Decl *ConstructorD,
Scope *S,
CXXScopeSpec &SS,
@@ -1262,7 +1262,7 @@
return false;
}
-Sema::MemInitResult
+MemInitResult
Sema::BuildMemberInitializer(FieldDecl *Member, Expr **Args,
unsigned NumArgs, SourceLocation IdLoc,
SourceLocation LParenLoc,
@@ -1359,7 +1359,7 @@
RParenLoc);
}
-Sema::MemInitResult
+MemInitResult
Sema::BuildBaseInitializer(QualType BaseType, TypeSourceInfo *BaseTInfo,
Expr **Args, unsigned NumArgs,
SourceLocation LParenLoc, SourceLocation RParenLoc,
@@ -1519,7 +1519,7 @@
= InitializationKind::CreateDefault(Constructor->getLocation());
InitializationSequence InitSeq(SemaRef, InitEntity, InitKind, 0, 0);
BaseInit = InitSeq.Perform(SemaRef, InitEntity, InitKind,
- Sema::MultiExprArg(SemaRef, 0, 0));
+ MultiExprArg(SemaRef, 0, 0));
break;
}
@@ -1548,8 +1548,7 @@
InitializationSequence InitSeq(SemaRef, InitEntity, InitKind,
&CopyCtorArg, 1);
BaseInit = InitSeq.Perform(SemaRef, InitEntity, InitKind,
- Sema::MultiExprArg(SemaRef,
- &CopyCtorArg, 1));
+ MultiExprArg(&CopyCtorArg, 1));
break;
}
@@ -1673,7 +1672,7 @@
ExprResult MemberInit
= InitSeq.Perform(SemaRef, Entities.back(), InitKind,
- Sema::MultiExprArg(SemaRef, &CopyCtorArgE, 1));
+ MultiExprArg(&CopyCtorArgE, 1));
MemberInit = SemaRef.MaybeCreateCXXExprWithTemporaries(MemberInit.get());
if (MemberInit.isInvalid())
return true;
@@ -1698,8 +1697,7 @@
InitializationSequence InitSeq(SemaRef, InitEntity, InitKind, 0, 0);
ExprResult MemberInit =
- InitSeq.Perform(SemaRef, InitEntity, InitKind,
- Sema::MultiExprArg(SemaRef, 0, 0));
+ InitSeq.Perform(SemaRef, InitEntity, InitKind, MultiExprArg());
if (MemberInit.isInvalid())
return true;
@@ -4621,7 +4619,7 @@
/*TemplateArgs=*/0,
/*SuppressQualifierCheck=*/true);
if (OpEqualRef.isInvalid())
- return S.StmtError();
+ return StmtError();
// Build the call to the assignment operator.
@@ -4629,7 +4627,7 @@
OpEqualRef.takeAs<Expr>(),
Loc, &From, 1, 0, Loc);
if (Call.isInvalid())
- return S.StmtError();
+ return StmtError();
return S.Owned(Call.takeAs<Stmt>());
}
@@ -4640,7 +4638,7 @@
if (!ArrayTy) {
ExprResult Assignment = S.CreateBuiltinBinOp(Loc, BO_Assign, To, From);
if (Assignment.isInvalid())
- return S.StmtError();
+ return StmtError();
return S.Owned(Assignment.takeAs<Stmt>());
}
@@ -4707,7 +4705,7 @@
To, From,
CopyingBaseSubobject, Depth+1);
if (Copy.isInvalid())
- return S.StmtError();
+ return StmtError();
// Construct the loop that copies all elements of this array.
return S.ActOnForStmt(Loc, Loc, InitStmt,
@@ -6947,8 +6945,7 @@
InitializationSequence InitSeq(*this, InitEntity, InitKind, 0, 0);
ExprResult MemberInit =
- InitSeq.Perform(*this, InitEntity, InitKind,
- Sema::MultiExprArg(*this, 0, 0));
+ InitSeq.Perform(*this, InitEntity, InitKind, MultiExprArg());
MemberInit = MaybeCreateCXXExprWithTemporaries(MemberInit.get());
// Note, MemberInit could actually come back empty if no initialization
// is required (e.g., because it would call a trivial default constructor)
diff --git a/lib/Sema/SemaExprCXX.cpp b/lib/Sema/SemaExprCXX.cpp
index 8f61933..2f8cfe2 100644
--- a/lib/Sema/SemaExprCXX.cpp
+++ b/lib/Sema/SemaExprCXX.cpp
@@ -1587,16 +1587,16 @@
ASTOwningVector<Expr*> ConstructorArgs(S);
if (S.CompleteConstructorCall(cast<CXXConstructorDecl>(Method),
- Sema::MultiExprArg(S, &From, 1),
+ MultiExprArg(&From, 1),
CastLoc, ConstructorArgs))
- return S.ExprError();
+ return ExprError();
ExprResult Result =
S.BuildCXXConstructExpr(CastLoc, Ty, cast<CXXConstructorDecl>(Method),
move_arg(ConstructorArgs),
/*ZeroInit*/ false, CXXConstructExpr::CK_Complete);
if (Result.isInvalid())
- return S.ExprError();
+ return ExprError();
return S.MaybeBindToTemporary(Result.takeAs<Expr>());
}
@@ -2182,8 +2182,7 @@
InitializationKind Kind = InitializationKind::CreateCopy(E->getLocStart(),
SourceLocation());
InitializationSequence InitSeq(Self, Entity, Kind, &E, 1);
- ExprResult Result = InitSeq.Perform(Self, Entity, Kind,
- Sema::MultiExprArg(Self, &E, 1));
+ ExprResult Result = InitSeq.Perform(Self, Entity, Kind, MultiExprArg(&E, 1));
if (Result.isInvalid())
return true;
@@ -2784,7 +2783,7 @@
return ActOnCallExpr(/*Scope*/ 0,
MemExpr,
/*LPLoc*/ ExpectedLParenLoc,
- Sema::MultiExprArg(*this, 0, 0),
+ MultiExprArg(),
/*CommaLocs*/ 0,
/*RPLoc*/ ExpectedLParenLoc);
}
diff --git a/lib/Sema/SemaExprObjC.cpp b/lib/Sema/SemaExprObjC.cpp
index 56d80a0..b56159c 100644
--- a/lib/Sema/SemaExprObjC.cpp
+++ b/lib/Sema/SemaExprObjC.cpp
@@ -24,9 +24,9 @@
using namespace clang;
-Sema::ExprResult Sema::ParseObjCStringLiteral(SourceLocation *AtLocs,
- ExprTy **strings,
- unsigned NumStrings) {
+ExprResult Sema::ParseObjCStringLiteral(SourceLocation *AtLocs,
+ Expr **strings,
+ unsigned NumStrings) {
StringLiteral **Strings = reinterpret_cast<StringLiteral**>(strings);
// Most ObjC strings are formed out of a single piece. However, we *can*
@@ -133,11 +133,11 @@
return new (Context) ObjCEncodeExpr(StrTy, EncodedTypeInfo, AtLoc, RParenLoc);
}
-Sema::ExprResult Sema::ParseObjCEncodeExpression(SourceLocation AtLoc,
- SourceLocation EncodeLoc,
- SourceLocation LParenLoc,
- ParsedType ty,
- SourceLocation RParenLoc) {
+ExprResult Sema::ParseObjCEncodeExpression(SourceLocation AtLoc,
+ SourceLocation EncodeLoc,
+ SourceLocation LParenLoc,
+ ParsedType ty,
+ SourceLocation RParenLoc) {
// FIXME: Preserve type source info ?
TypeSourceInfo *TInfo;
QualType EncodedType = GetTypeFromParser(ty, &TInfo);
@@ -148,11 +148,11 @@
return BuildObjCEncodeExpression(AtLoc, TInfo, RParenLoc);
}
-Sema::ExprResult Sema::ParseObjCSelectorExpression(Selector Sel,
- SourceLocation AtLoc,
- SourceLocation SelLoc,
- SourceLocation LParenLoc,
- SourceLocation RParenLoc) {
+ExprResult Sema::ParseObjCSelectorExpression(Selector Sel,
+ SourceLocation AtLoc,
+ SourceLocation SelLoc,
+ SourceLocation LParenLoc,
+ SourceLocation RParenLoc) {
ObjCMethodDecl *Method = LookupInstanceMethodInGlobalPool(Sel,
SourceRange(LParenLoc, RParenLoc), false, false);
if (!Method)
@@ -170,11 +170,11 @@
return new (Context) ObjCSelectorExpr(Ty, Sel, AtLoc, RParenLoc);
}
-Sema::ExprResult Sema::ParseObjCProtocolExpression(IdentifierInfo *ProtocolId,
- SourceLocation AtLoc,
- SourceLocation ProtoLoc,
- SourceLocation LParenLoc,
- SourceLocation RParenLoc) {
+ExprResult Sema::ParseObjCProtocolExpression(IdentifierInfo *ProtocolId,
+ SourceLocation AtLoc,
+ SourceLocation ProtoLoc,
+ SourceLocation LParenLoc,
+ SourceLocation RParenLoc) {
ObjCProtocolDecl* PDecl = LookupProtocol(ProtocolId, ProtoLoc);
if (!PDecl) {
Diag(ProtoLoc, diag::err_undeclared_protocol) << ProtocolId;
diff --git a/lib/Sema/SemaInit.cpp b/lib/Sema/SemaInit.cpp
index fdac476..a719590 100644
--- a/lib/Sema/SemaInit.cpp
+++ b/lib/Sema/SemaInit.cpp
@@ -265,8 +265,7 @@
}
ExprResult MemberInit
- = InitSeq.Perform(SemaRef, MemberEntity, Kind,
- Sema::MultiExprArg(SemaRef, 0, 0));
+ = InitSeq.Perform(SemaRef, MemberEntity, Kind, MultiExprArg());
if (MemberInit.isInvalid()) {
hadError = true;
return;
@@ -375,8 +374,7 @@
}
ExprResult ElementInit
- = InitSeq.Perform(SemaRef, ElementEntity, Kind,
- Sema::MultiExprArg(SemaRef, 0, 0));
+ = InitSeq.Perform(SemaRef, ElementEntity, Kind, MultiExprArg());
if (ElementInit.isInvalid()) {
hadError = true;
return;
@@ -680,8 +678,7 @@
if (Seq) {
ExprResult Result =
- Seq.Perform(SemaRef, Entity, Kind,
- Sema::MultiExprArg(SemaRef, &expr, 1));
+ Seq.Perform(SemaRef, Entity, Kind, MultiExprArg(&expr, 1));
if (Result.isInvalid())
hadError = true;
@@ -3369,7 +3366,7 @@
<< CurInitExpr->getSourceRange();
CandidateSet.NoteCandidates(S, OCD_AllCandidates, &CurInitExpr, 1);
if (!IsExtraneousCopy || S.isSFINAEContext())
- return S.ExprError();
+ return ExprError();
return move(CurInit);
case OR_Ambiguous:
@@ -3377,7 +3374,7 @@
<< (int)Entity.getKind() << CurInitExpr->getType()
<< CurInitExpr->getSourceRange();
CandidateSet.NoteCandidates(S, OCD_ViableCandidates, &CurInitExpr, 1);
- return S.ExprError();
+ return ExprError();
case OR_Deleted:
S.Diag(Loc, diag::err_temp_copy_deleted)
@@ -3385,7 +3382,7 @@
<< CurInitExpr->getSourceRange();
S.Diag(Best->Function->getLocation(), diag::note_unavailable_here)
<< Best->Function->isDeleted();
- return S.ExprError();
+ return ExprError();
}
CXXConstructorDecl *Constructor = cast<CXXConstructorDecl>(Best->Function);
@@ -3424,10 +3421,9 @@
// Determine the arguments required to actually perform the
// constructor call (we might have derived-to-base conversions, or
// the copy constructor may have default arguments).
- if (S.CompleteConstructorCall(Constructor,
- Sema::MultiExprArg(S, &CurInitExpr, 1),
+ if (S.CompleteConstructorCall(Constructor, MultiExprArg(&CurInitExpr, 1),
Loc, ConstructorArgs))
- return S.ExprError();
+ return ExprError();
// Actually perform the constructor call.
CurInit = S.BuildCXXConstructExpr(Loc, T, Constructor, Elidable,
@@ -3459,12 +3455,12 @@
InitializationSequence::Perform(Sema &S,
const InitializedEntity &Entity,
const InitializationKind &Kind,
- Action::MultiExprArg Args,
+ MultiExprArg Args,
QualType *ResultType) {
if (SequenceKind == FailedSequence) {
unsigned NumArgs = Args.size();
Diagnose(S, Entity, Kind, (Expr **)Args.release(), NumArgs);
- return S.ExprError();
+ return ExprError();
}
if (SequenceKind == DependentSequence) {
@@ -3559,7 +3555,7 @@
assert(Args.size() == 1);
CurInit = ExprResult(((Expr **)(Args.get()))[0]->Retain());
if (CurInit.isInvalid())
- return S.ExprError();
+ return ExprError();
break;
case SK_ConstructorInitialization:
@@ -3573,7 +3569,7 @@
for (step_iterator Step = step_begin(), StepEnd = step_end();
Step != StepEnd; ++Step) {
if (CurInit.isInvalid())
- return S.ExprError();
+ return ExprError();
Expr *CurInitExpr = (Expr *)CurInit.get();
QualType SourceType = CurInitExpr? CurInitExpr->getType() : QualType();
@@ -3603,7 +3599,7 @@
CurInitExpr->getLocStart(),
CurInitExpr->getSourceRange(),
&BasePath, IgnoreBaseAccess))
- return S.ExprError();
+ return ExprError();
if (S.BasePathInvolvesVirtualBase(BasePath)) {
QualType T = SourceType;
@@ -3636,7 +3632,7 @@
<< BitField->getDeclName()
<< CurInitExpr->getSourceRange();
S.Diag(BitField->getLocation(), diag::note_bitfield_decl);
- return S.ExprError();
+ return ExprError();
}
if (CurInitExpr->refersToVectorElement()) {
@@ -3645,14 +3641,14 @@
<< Entity.getType().isVolatileQualified()
<< CurInitExpr->getSourceRange();
PrintInitLocationNote(S, Entity);
- return S.ExprError();
+ return ExprError();
}
// Reference binding does not have any corresponding ASTs.
// Check exception specifications
if (S.CheckExceptionSpecCompatibility(CurInitExpr, DestType))
- return S.ExprError();
+ return ExprError();
break;
@@ -3661,7 +3657,7 @@
// Check exception specifications
if (S.CheckExceptionSpecCompatibility(CurInitExpr, DestType))
- return S.ExprError();
+ return ExprError();
break;
@@ -3688,9 +3684,9 @@
// Determine the arguments required to actually perform the constructor
// call.
if (S.CompleteConstructorCall(Constructor,
- Sema::MultiExprArg(S, &CurInitExpr, 1),
+ MultiExprArg(&CurInitExpr, 1),
Loc, ConstructorArgs))
- return S.ExprError();
+ return ExprError();
// Build the an expression that constructs a temporary.
CurInit = S.BuildCXXConstructExpr(Loc, Step->Type, Constructor,
@@ -3698,7 +3694,7 @@
/*ZeroInit*/ false,
CXXConstructExpr::CK_Complete);
if (CurInit.isInvalid())
- return S.ExprError();
+ return ExprError();
S.CheckConstructorAccess(Kind.getLocation(), Constructor, Entity,
FoundFn.getAccess());
@@ -3724,7 +3720,7 @@
// we don't want to turn off access control here for c-style casts.
if (S.PerformObjectArgumentInitialization(CurInitExpr, /*Qualifier=*/0,
FoundFn, Conversion))
- return S.ExprError();
+ return ExprError();
// Do a little dance to make sure that CurInit has the proper
// pointer.
@@ -3734,7 +3730,7 @@
CurInit = S.Owned(S.BuildCXXMemberCallExpr(CurInitExpr, FoundFn,
Conversion));
if (CurInit.isInvalid() || !CurInit.get())
- return S.ExprError();
+ return ExprError();
CastKind = CK_UserDefinedConversion;
@@ -3792,7 +3788,7 @@
if (S.PerformImplicitConversion(CurInitExpr, Step->Type, *Step->ICS,
Sema::AA_Converting, IgnoreBaseAccess))
- return S.ExprError();
+ return ExprError();
CurInit.release();
CurInit = S.Owned(CurInitExpr);
@@ -3803,7 +3799,7 @@
InitListExpr *InitList = cast<InitListExpr>(CurInitExpr);
QualType Ty = Step->Type;
if (S.CheckInitList(Entity, InitList, ResultType? *ResultType : Ty))
- return S.ExprError();
+ return ExprError();
CurInit.release();
CurInit = S.Owned(InitList);
@@ -3836,7 +3832,7 @@
// call.
if (S.CompleteConstructorCall(Constructor, move(Args),
Loc, ConstructorArgs))
- return S.ExprError();
+ return ExprError();
if (Entity.getKind() == InitializedEntity::EK_Temporary &&
@@ -3881,7 +3877,7 @@
ConstructKind);
}
if (CurInit.isInvalid())
- return S.ExprError();
+ return ExprError();
// Only check access if all of that succeeded.
S.CheckConstructorAccess(Loc, Constructor, Entity,
@@ -3933,7 +3929,7 @@
getAssignmentAction(Entity),
&Complained)) {
PrintInitLocationNote(S, Entity);
- return S.ExprError();
+ return ExprError();
} else if (Complained)
PrintInitLocationNote(S, Entity);
@@ -4448,5 +4444,5 @@
EqualLoc);
InitializationSequence Seq(*this, Entity, Kind, &InitE, 1);
Init.release();
- return Seq.Perform(*this, Entity, Kind, MultiExprArg(*this, &InitE, 1));
+ return Seq.Perform(*this, Entity, Kind, MultiExprArg(&InitE, 1));
}
diff --git a/lib/Sema/SemaOverload.cpp b/lib/Sema/SemaOverload.cpp
index 0d5968f..95c03eb 100644
--- a/lib/Sema/SemaOverload.cpp
+++ b/lib/Sema/SemaOverload.cpp
@@ -3423,7 +3423,7 @@
return;
// Overload resolution is always an unevaluated context.
- EnterExpressionEvaluationContext Unevaluated(*this, Action::Unevaluated);
+ EnterExpressionEvaluationContext Unevaluated(*this, Sema::Unevaluated);
if (CXXConstructorDecl *Constructor = dyn_cast<CXXConstructorDecl>(Function)){
// C++ [class.copy]p3:
@@ -3586,7 +3586,7 @@
return;
// Overload resolution is always an unevaluated context.
- EnterExpressionEvaluationContext Unevaluated(*this, Action::Unevaluated);
+ EnterExpressionEvaluationContext Unevaluated(*this, Sema::Unevaluated);
// Add this candidate
CandidateSet.push_back(OverloadCandidate());
@@ -3784,7 +3784,7 @@
return;
// Overload resolution is always an unevaluated context.
- EnterExpressionEvaluationContext Unevaluated(*this, Action::Unevaluated);
+ EnterExpressionEvaluationContext Unevaluated(*this, Sema::Unevaluated);
// Add this candidate
CandidateSet.push_back(OverloadCandidate());
@@ -3945,7 +3945,7 @@
return;
// Overload resolution is always an unevaluated context.
- EnterExpressionEvaluationContext Unevaluated(*this, Action::Unevaluated);
+ EnterExpressionEvaluationContext Unevaluated(*this, Sema::Unevaluated);
CandidateSet.push_back(OverloadCandidate());
OverloadCandidate& Candidate = CandidateSet.back();
@@ -4090,7 +4090,7 @@
bool IsAssignmentOperator,
unsigned NumContextualBoolArguments) {
// Overload resolution is always an unevaluated context.
- EnterExpressionEvaluationContext Unevaluated(*this, Action::Unevaluated);
+ EnterExpressionEvaluationContext Unevaluated(*this, Sema::Unevaluated);
// Add this candidate
CandidateSet.push_back(OverloadCandidate());
@@ -6618,13 +6618,13 @@
LookupResult R(SemaRef, ULE->getName(), ULE->getNameLoc(),
Sema::LookupOrdinaryName);
if (SemaRef.DiagnoseEmptyLookup(S, SS, R, Sema::CTC_Expression))
- return SemaRef.ExprError();
+ return ExprError();
assert(!R.empty() && "lookup results empty despite recovery");
// Build an implicit member call if appropriate. Just drop the
// casts and such from the call, we don't really care.
- ExprResult NewFn = SemaRef.ExprError();
+ ExprResult NewFn = ExprError();
if ((*R.begin())->isCXXClassMember())
NewFn = SemaRef.BuildPossibleImplicitMemberExpr(SS, R, ExplicitTemplateArgs);
else if (ExplicitTemplateArgs)
@@ -6633,13 +6633,13 @@
NewFn = SemaRef.BuildDeclarationNameExpr(SS, R, false);
if (NewFn.isInvalid())
- return SemaRef.ExprError();
+ return ExprError();
// This shouldn't cause an infinite loop because we're giving it
// an expression with non-empty lookup results, which should never
// end up here.
return SemaRef.ActOnCallExpr(/*Scope*/ 0, NewFn.take(), LParenLoc,
- Sema::MultiExprArg(SemaRef, Args, NumArgs),
+ MultiExprArg(Args, NumArgs),
CommaLocs, RParenLoc);
}
@@ -7421,7 +7421,7 @@
/// type (C++ [over.call.object]), which can end up invoking an
/// overloaded function call operator (@c operator()) or performing a
/// user-defined conversion on the object argument.
-Sema::ExprResult
+ExprResult
Sema::BuildCallToObjectOfClassType(Scope *S, Expr *Object,
SourceLocation LParenLoc,
Expr **Args, unsigned NumArgs,
@@ -7560,8 +7560,7 @@
CXXMemberCallExpr *CE = BuildCXXMemberCallExpr(Object, Best->FoundDecl,
Conv);
- return ActOnCallExpr(S, CE, LParenLoc,
- MultiExprArg(*this, (ExprTy**)Args, NumArgs),
+ return ActOnCallExpr(S, CE, LParenLoc, MultiExprArg(Args, NumArgs),
CommaLocs, RParenLoc);
}
diff --git a/lib/Sema/SemaTemplate.cpp b/lib/Sema/SemaTemplate.cpp
index 22a0933..e293e9b 100644
--- a/lib/Sema/SemaTemplate.cpp
+++ b/lib/Sema/SemaTemplate.cpp
@@ -712,7 +712,7 @@
SS.getRange());
}
-Sema::DeclResult
+DeclResult
Sema::CheckClassTemplate(Scope *S, unsigned TagSpec, TagUseKind TUK,
SourceLocation KWLoc, CXXScopeSpec &SS,
IdentifierInfo *Name, SourceLocation NameLoc,
@@ -1518,7 +1518,7 @@
return Context.getTemplateSpecializationType(Name, TemplateArgs, CanonType);
}
-Action::TypeResult
+TypeResult
Sema::ActOnTemplateIdType(TemplateTy TemplateD, SourceLocation TemplateLoc,
SourceLocation LAngleLoc,
ASTTemplateArgsPtr TemplateArgsIn,
@@ -1547,12 +1547,12 @@
return CreateParsedType(Result, DI);
}
-Sema::TypeResult Sema::ActOnTagTemplateIdType(TypeResult TypeResult,
- TagUseKind TUK,
- DeclSpec::TST TagSpec,
- SourceLocation TagLoc) {
+TypeResult Sema::ActOnTagTemplateIdType(TypeResult TypeResult,
+ TagUseKind TUK,
+ TypeSpecifierType TagSpec,
+ SourceLocation TagLoc) {
if (TypeResult.isInvalid())
- return Sema::TypeResult();
+ return ::TypeResult();
// FIXME: preserve source info, ideally without copying the DI.
TypeSourceInfo *DI;
@@ -4634,7 +4634,7 @@
}
// Explicit instantiation of a class template specialization
-Sema::DeclResult
+DeclResult
Sema::ActOnExplicitInstantiation(Scope *S,
SourceLocation ExternLoc,
SourceLocation TemplateLoc,
@@ -4839,7 +4839,7 @@
bool Owned = false;
bool IsDependent = false;
- Decl *TagD = ActOnTag(S, TagSpec, Action::TUK_Reference,
+ Decl *TagD = ActOnTag(S, TagSpec, Sema::TUK_Reference,
KWLoc, SS, Name, NameLoc, Attr, AS_none,
MultiTemplateParamsArg(*this, 0, 0),
Owned, IsDependent);
@@ -4951,10 +4951,10 @@
return TagD;
}
-Sema::DeclResult Sema::ActOnExplicitInstantiation(Scope *S,
- SourceLocation ExternLoc,
- SourceLocation TemplateLoc,
- Declarator &D) {
+DeclResult Sema::ActOnExplicitInstantiation(Scope *S,
+ SourceLocation ExternLoc,
+ SourceLocation TemplateLoc,
+ Declarator &D) {
// Explicit instantiations always require a name.
// TODO: check if/when DNInfo should replace Name.
DeclarationNameInfo NameInfo = GetNameForDeclarator(D);
@@ -5204,7 +5204,7 @@
return (Decl*) 0;
}
-Sema::TypeResult
+TypeResult
Sema::ActOnDependentTag(Scope *S, unsigned TagSpec, TagUseKind TUK,
const CXXScopeSpec &SS, IdentifierInfo *Name,
SourceLocation TagLoc, SourceLocation NameLoc) {
@@ -5228,7 +5228,7 @@
return ParsedType::make(Context.getDependentNameType(Kwd, NNS, Name));
}
-Sema::TypeResult
+TypeResult
Sema::ActOnTypenameType(Scope *S, SourceLocation TypenameLoc,
const CXXScopeSpec &SS, const IdentifierInfo &II,
SourceLocation IdLoc) {
@@ -5263,7 +5263,7 @@
return CreateParsedType(T, TSI);
}
-Sema::TypeResult
+TypeResult
Sema::ActOnTypenameType(Scope *S, SourceLocation TypenameLoc,
const CXXScopeSpec &SS, SourceLocation TemplateLoc,
ParsedType Ty) {
diff --git a/lib/Sema/SemaTemplateInstantiate.cpp b/lib/Sema/SemaTemplateInstantiate.cpp
index 024060f..4d4c181 100644
--- a/lib/Sema/SemaTemplateInstantiate.cpp
+++ b/lib/Sema/SemaTemplateInstantiate.cpp
@@ -821,7 +821,7 @@
getSema().FindInstantiatedDecl(E->getLocation(),
VD, TemplateArgs));
if (!VD)
- return SemaRef.ExprError();
+ return ExprError();
// Derive the type we want the substituted decl to have. This had
// better be non-dependent, or these checks will have serious problems.
@@ -1201,7 +1201,7 @@
// PushDeclContext because we don't have a scope.
ContextRAII SavedContext(*this, Instantiation);
EnterExpressionEvaluationContext EvalContext(*this,
- Action::PotentiallyEvaluated);
+ Sema::PotentiallyEvaluated);
// If this is an instantiation of a local class, merge this local
// instantiation scope with the enclosing scope. Otherwise, every
diff --git a/lib/Sema/SemaTemplateInstantiateDecl.cpp b/lib/Sema/SemaTemplateInstantiateDecl.cpp
index 1e95b91..e40075a 100644
--- a/lib/Sema/SemaTemplateInstantiateDecl.cpp
+++ b/lib/Sema/SemaTemplateInstantiateDecl.cpp
@@ -11,6 +11,7 @@
//===----------------------------------------------------------------------===/
#include "clang/Sema/SemaInternal.h"
#include "clang/Sema/Lookup.h"
+#include "clang/Sema/PrettyDeclStackTrace.h"
#include "clang/Sema/Template.h"
#include "clang/AST/ASTConsumer.h"
#include "clang/AST/ASTContext.h"
@@ -20,7 +21,6 @@
#include "clang/AST/Expr.h"
#include "clang/AST/ExprCXX.h"
#include "clang/AST/TypeLoc.h"
-#include "clang/Basic/PrettyStackTrace.h"
#include "clang/Lex/Preprocessor.h"
using namespace clang;
@@ -147,7 +147,7 @@
if (Aligned->isAlignmentDependent()) {
// The alignment expression is not potentially evaluated.
EnterExpressionEvaluationContext Unevaluated(*this,
- Action::Unevaluated);
+ Sema::Unevaluated);
if (Aligned->isAlignmentExpr()) {
ExprResult Result = SubstExpr(Aligned->getAlignmentExpr(),
@@ -493,7 +493,7 @@
BitWidth = 0;
else if (BitWidth) {
// The bit-width expression is not potentially evaluated.
- EnterExpressionEvaluationContext Unevaluated(SemaRef, Action::Unevaluated);
+ EnterExpressionEvaluationContext Unevaluated(SemaRef, Sema::Unevaluated);
ExprResult InstantiatedBitWidth
= SemaRef.SubstExpr(BitWidth, TemplateArgs);
@@ -581,7 +581,7 @@
Expr *AssertExpr = D->getAssertExpr();
// The expression in a static assertion is not potentially evaluated.
- EnterExpressionEvaluationContext Unevaluated(SemaRef, Action::Unevaluated);
+ EnterExpressionEvaluationContext Unevaluated(SemaRef, Sema::Unevaluated);
ExprResult InstantiatedAssertExpr
= SemaRef.SubstExpr(AssertExpr, TemplateArgs);
@@ -620,7 +620,7 @@
if (Expr *UninstValue = EC->getInitExpr()) {
// The enumerator's value expression is not potentially evaluated.
EnterExpressionEvaluationContext Unevaluated(SemaRef,
- Action::Unevaluated);
+ Sema::Unevaluated);
Value = SemaRef.SubstExpr(UninstValue, TemplateArgs);
}
@@ -2070,7 +2070,7 @@
PendingInstantiations.swap(SavedPendingInstantiations);
EnterExpressionEvaluationContext EvalContext(*this,
- Action::PotentiallyEvaluated);
+ Sema::PotentiallyEvaluated);
ActOnStartOfFunctionDef(0, Function);
// Introduce a new scope where local variable instantiations will be
@@ -2718,10 +2718,8 @@
// Instantiate function definitions
if (FunctionDecl *Function = dyn_cast<FunctionDecl>(Inst.first)) {
- PrettyStackTraceActionsDecl CrashInfo(Function,
- Function->getLocation(), *this,
- Context.getSourceManager(),
- "instantiating function definition");
+ PrettyDeclStackTraceEntry CrashInfo(*this, Function, SourceLocation(),
+ "instantiating function definition");
bool DefinitionRequired = Function->getTemplateSpecializationKind() ==
TSK_ExplicitInstantiationDefinition;
InstantiateFunctionDefinition(/*FIXME:*/Inst.second, Function, true,
@@ -2754,10 +2752,9 @@
break;
}
- PrettyStackTraceActionsDecl CrashInfo(Var, Var->getLocation(), *this,
- Context.getSourceManager(),
- "instantiating static data member "
- "definition");
+ PrettyDeclStackTraceEntry CrashInfo(*this, Var, Var->getLocation(),
+ "instantiating static data member "
+ "definition");
bool DefinitionRequired = Var->getTemplateSpecializationKind() ==
TSK_ExplicitInstantiationDefinition;
@@ -2779,3 +2776,4 @@
}
}
}
+
diff --git a/lib/Sema/SemaType.cpp b/lib/Sema/SemaType.cpp
index 2bff683..8988de8 100644
--- a/lib/Sema/SemaType.cpp
+++ b/lib/Sema/SemaType.cpp
@@ -1700,7 +1700,7 @@
" GetTypeFromParser");
}
-Sema::TypeResult Sema::ActOnTypeName(Scope *S, Declarator &D) {
+TypeResult Sema::ActOnTypeName(Scope *S, Declarator &D) {
// C99 6.7.6: Type names have no identifier. This is already validated by
// the parser.
assert(D.getIdentifier() == 0 && "Type name should have no identifier!");
diff --git a/lib/Sema/TreeTransform.h b/lib/Sema/TreeTransform.h
index ed531c7..a796f2e 100644
--- a/lib/Sema/TreeTransform.h
+++ b/lib/Sema/TreeTransform.h
@@ -92,9 +92,6 @@
Sema &SemaRef;
public:
- typedef Sema::MultiExprArg MultiExprArg;
- typedef Sema::MultiStmtArg MultiStmtArg;
-
/// \brief Initializes a new tree transformer.
TreeTransform(Sema &SemaRef) : SemaRef(SemaRef) { }
@@ -964,11 +961,11 @@
/// By default, performs semantic analysis to build the new statement.
/// Subclasses may override this routine to provide different behavior.
StmtResult RebuildObjCForCollectionStmt(SourceLocation ForLoc,
- SourceLocation LParenLoc,
- Stmt *Element,
- Expr *Collection,
- SourceLocation RParenLoc,
- Stmt *Body) {
+ SourceLocation LParenLoc,
+ Stmt *Element,
+ Expr *Collection,
+ SourceLocation RParenLoc,
+ Stmt *Body) {
return getSema().ActOnObjCForCollectionStmt(ForLoc, LParenLoc,
Element,
Collection,
@@ -994,8 +991,8 @@
/// By default, performs semantic analysis to build the new statement.
/// Subclasses may override this routine to provide different behavior.
StmtResult RebuildCXXCatchStmt(SourceLocation CatchLoc,
- VarDecl *ExceptionDecl,
- Stmt *Handler) {
+ VarDecl *ExceptionDecl,
+ Stmt *Handler) {
return Owned(new (getSema().Context) CXXCatchStmt(CatchLoc, ExceptionDecl,
Handler));
}
@@ -1005,8 +1002,8 @@
/// By default, performs semantic analysis to build the new statement.
/// Subclasses may override this routine to provide different behavior.
StmtResult RebuildCXXTryStmt(SourceLocation TryLoc,
- Stmt *TryBlock,
- MultiStmtArg Handlers) {
+ Stmt *TryBlock,
+ MultiStmtArg Handlers) {
return getSema().ActOnCXXTryBlock(TryLoc, TryBlock, move(Handlers));
}
@@ -1015,8 +1012,8 @@
/// By default, performs semantic analysis to build the new expression.
/// Subclasses may override this routine to provide different behavior.
ExprResult RebuildDeclarationNameExpr(const CXXScopeSpec &SS,
- LookupResult &R,
- bool RequiresADL) {
+ LookupResult &R,
+ bool RequiresADL) {
return getSema().BuildDeclarationNameExpr(SS, R, RequiresADL);
}
@@ -1026,10 +1023,10 @@
/// By default, performs semantic analysis to build the new expression.
/// Subclasses may override this routine to provide different behavior.
ExprResult RebuildDeclRefExpr(NestedNameSpecifier *Qualifier,
- SourceRange QualifierRange,
- ValueDecl *VD,
- const DeclarationNameInfo &NameInfo,
- TemplateArgumentListInfo *TemplateArgs) {
+ SourceRange QualifierRange,
+ ValueDecl *VD,
+ const DeclarationNameInfo &NameInfo,
+ TemplateArgumentListInfo *TemplateArgs) {
CXXScopeSpec SS;
SS.setScopeRep(Qualifier);
SS.setRange(QualifierRange);
@@ -1078,7 +1075,7 @@
/// Subclasses may override this routine to provide different behavior.
ExprResult RebuildOffsetOfExpr(SourceLocation OperatorLoc,
TypeSourceInfo *Type,
- Action::OffsetOfComponent *Components,
+ Sema::OffsetOfComponent *Components,
unsigned NumComponents,
SourceLocation RParenLoc) {
return getSema().BuildBuiltinOffsetOf(OperatorLoc, Type, Components,
@@ -1105,7 +1102,7 @@
ExprResult Result
= getSema().CreateSizeOfAlignOfExpr(SubExpr, OpLoc, isSizeOf, R);
if (Result.isInvalid())
- return getSema().ExprError();
+ return ExprError();
return move(Result);
}
@@ -1154,7 +1151,7 @@
if (getSema().PerformObjectMemberConversion(Base, Qualifier,
FoundDecl, Member))
- return getSema().ExprError();
+ return ExprError();
MemberExpr *ME =
new (getSema().Context) MemberExpr(Base, isArrow,
@@ -1281,7 +1278,7 @@
= SemaRef.ActOnDesignatedInitializer(Desig, EqualOrColonLoc, GNUSyntax,
Init);
if (Result.isInvalid())
- return SemaRef.ExprError();
+ return ExprError();
ArrayExprs.release();
return move(Result);
@@ -1420,7 +1417,7 @@
break;
}
- return getSema().ExprError();
+ return ExprError();
}
/// \brief Build a new C++ static_cast expression.
@@ -1503,7 +1500,7 @@
return getSema().ActOnCXXTypeConstructExpr(TypeRange,
ParsedType::make(TInfo->getType()),
LParenLoc,
- Sema::MultiExprArg(getSema(), &Sub, 1),
+ MultiExprArg(&Sub, 1),
/*CommaLocs=*/0,
RParenLoc);
}
@@ -1679,7 +1676,7 @@
ASTOwningVector<Expr*> ConvertedArgs(SemaRef);
if (getSema().CompleteConstructorCall(Constructor, move(Args), Loc,
ConvertedArgs))
- return getSema().ExprError();
+ return ExprError();
return getSema().BuildCXXConstructExpr(Loc, T, Constructor, IsElidable,
move_arg(ConvertedArgs),
@@ -1826,7 +1823,7 @@
SS, 0,
false);
if (Result.isInvalid())
- return getSema().ExprError();
+ return ExprError();
if (Result.get())
return move(Result);
@@ -1854,7 +1851,7 @@
/*FIME:*/PropertyLoc,
SS, 0, false);
if (Result.isInvalid())
- return getSema().ExprError();
+ return ExprError();
if (Result.get())
return move(Result);
@@ -1901,7 +1898,7 @@
/*FIME:*/IsaLoc,
SS, 0, false);
if (Result.isInvalid())
- return getSema().ExprError();
+ return ExprError();
if (Result.get())
return move(Result);
@@ -1946,7 +1943,7 @@
// Type-check the __builtin_shufflevector expression.
ExprResult Result = SemaRef.SemaBuiltinShuffleVector(TheCall);
if (Result.isInvalid())
- return SemaRef.ExprError();
+ return ExprError();
OwnedCall.release();
return move(Result);
@@ -1975,7 +1972,7 @@
{
ExprResult E = getDerived().TransformExpr(cast<Expr>(S));
if (E.isInvalid())
- return getSema().StmtError();
+ return StmtError();
return getSema().ActOnExprStmt(getSema().MakeFullExpr(E.take()));
}
@@ -2273,7 +2270,7 @@
Expr *SourceExpr = Input.getSourceDeclExpression();
if (SourceExpr) {
EnterExpressionEvaluationContext Unevaluated(getSema(),
- Action::Unevaluated);
+ Sema::Unevaluated);
ExprResult E = getDerived().TransformExpr(SourceExpr);
SourceExpr = (E.isInvalid() ? 0 : E.take());
}
@@ -2298,7 +2295,7 @@
case TemplateArgument::Expression: {
// Template argument expressions are not potentially evaluated.
EnterExpressionEvaluationContext Unevaluated(getSema(),
- Action::Unevaluated);
+ Sema::Unevaluated);
Expr *InputExpr = Input.getSourceExpression();
if (!InputExpr) InputExpr = Input.getArgument().getAsExpr();
@@ -2628,7 +2625,7 @@
Expr *Size = TL.getSizeExpr();
if (Size) {
- EnterExpressionEvaluationContext Unevaluated(SemaRef, Action::Unevaluated);
+ EnterExpressionEvaluationContext Unevaluated(SemaRef, Sema::Unevaluated);
Size = getDerived().TransformExpr(Size).template takeAs<Expr>();
}
NewTL.setSizeExpr(Size);
@@ -2676,7 +2673,7 @@
return QualType();
// Array bounds are not potentially evaluated contexts
- EnterExpressionEvaluationContext Unevaluated(SemaRef, Action::Unevaluated);
+ EnterExpressionEvaluationContext Unevaluated(SemaRef, Sema::Unevaluated);
ExprResult SizeResult
= getDerived().TransformExpr(T->getSizeExpr());
@@ -2717,7 +2714,7 @@
return QualType();
// Array bounds are not potentially evaluated contexts
- EnterExpressionEvaluationContext Unevaluated(SemaRef, Action::Unevaluated);
+ EnterExpressionEvaluationContext Unevaluated(SemaRef, Sema::Unevaluated);
ExprResult SizeResult
= getDerived().TransformExpr(T->getSizeExpr());
@@ -2763,7 +2760,7 @@
return QualType();
// Vector sizes are not potentially evaluated contexts
- EnterExpressionEvaluationContext Unevaluated(SemaRef, Action::Unevaluated);
+ EnterExpressionEvaluationContext Unevaluated(SemaRef, Sema::Unevaluated);
ExprResult Size = getDerived().TransformExpr(T->getSizeExpr());
if (Size.isInvalid())
@@ -3018,7 +3015,7 @@
TypeOfExprTypeLoc TL,
QualType ObjectType) {
// typeof expressions are not potentially evaluated contexts
- EnterExpressionEvaluationContext Unevaluated(SemaRef, Action::Unevaluated);
+ EnterExpressionEvaluationContext Unevaluated(SemaRef, Sema::Unevaluated);
ExprResult E = getDerived().TransformExpr(TL.getUnderlyingExpr());
if (E.isInvalid())
@@ -3073,7 +3070,7 @@
DecltypeType *T = TL.getTypePtr();
// decltype expressions are not potentially evaluated contexts
- EnterExpressionEvaluationContext Unevaluated(SemaRef, Action::Unevaluated);
+ EnterExpressionEvaluationContext Unevaluated(SemaRef, Sema::Unevaluated);
ExprResult E = getDerived().TransformExpr(T->getUnderlyingExpr());
if (E.isInvalid())
@@ -3449,7 +3446,7 @@
B != BEnd; ++B) {
StmtResult Result = getDerived().TransformStmt(*B);
if (Result.isInvalid())
- return getSema().StmtError();
+ return StmtError();
SubStmtChanged = SubStmtChanged || Result.get() != *B;
Statements.push_back(Result.takeAs<Stmt>());
@@ -3471,17 +3468,17 @@
ExprResult LHS, RHS;
{
// The case value expressions are not potentially evaluated.
- EnterExpressionEvaluationContext Unevaluated(SemaRef, Action::Unevaluated);
+ EnterExpressionEvaluationContext Unevaluated(SemaRef, Sema::Unevaluated);
// Transform the left-hand case value.
LHS = getDerived().TransformExpr(S->getLHS());
if (LHS.isInvalid())
- return SemaRef.StmtError();
+ return StmtError();
// Transform the right-hand case value (for the GNU case-range extension).
RHS = getDerived().TransformExpr(S->getRHS());
if (RHS.isInvalid())
- return SemaRef.StmtError();
+ return StmtError();
}
// Build the case statement.
@@ -3493,12 +3490,12 @@
RHS.get(),
S->getColonLoc());
if (Case.isInvalid())
- return SemaRef.StmtError();
+ return StmtError();
// Transform the statement following the case
StmtResult SubStmt = getDerived().TransformStmt(S->getSubStmt());
if (SubStmt.isInvalid())
- return SemaRef.StmtError();
+ return StmtError();
// Attach the body to the case statement
return getDerived().RebuildCaseStmtBody(Case.get(), SubStmt.get());
@@ -3510,7 +3507,7 @@
// Transform the statement following the default case
StmtResult SubStmt = getDerived().TransformStmt(S->getSubStmt());
if (SubStmt.isInvalid())
- return SemaRef.StmtError();
+ return StmtError();
// Default statements are always rebuilt
return getDerived().RebuildDefaultStmt(S->getDefaultLoc(), S->getColonLoc(),
@@ -3522,7 +3519,7 @@
TreeTransform<Derived>::TransformLabelStmt(LabelStmt *S) {
StmtResult SubStmt = getDerived().TransformStmt(S->getSubStmt());
if (SubStmt.isInvalid())
- return SemaRef.StmtError();
+ return StmtError();
// FIXME: Pass the real colon location in.
SourceLocation ColonLoc = SemaRef.PP.getLocForEndOfToken(S->getIdentLoc());
@@ -3543,12 +3540,12 @@
S->getConditionVariable()->getLocation(),
S->getConditionVariable()));
if (!ConditionVar)
- return SemaRef.StmtError();
+ return StmtError();
} else {
Cond = getDerived().TransformExpr(S->getCond());
if (Cond.isInvalid())
- return SemaRef.StmtError();
+ return StmtError();
// Convert the condition to a boolean value.
if (S->getCond()) {
@@ -3556,7 +3553,7 @@
S->getIfLoc(),
Cond.get());
if (CondE.isInvalid())
- return getSema().StmtError();
+ return StmtError();
Cond = CondE.get();
}
@@ -3564,17 +3561,17 @@
Sema::FullExprArg FullCond(getSema().MakeFullExpr(Cond.take()));
if (!S->getConditionVariable() && S->getCond() && !FullCond.get())
- return SemaRef.StmtError();
+ return StmtError();
// Transform the "then" branch.
StmtResult Then = getDerived().TransformStmt(S->getThen());
if (Then.isInvalid())
- return SemaRef.StmtError();
+ return StmtError();
// Transform the "else" branch.
StmtResult Else = getDerived().TransformStmt(S->getElse());
if (Else.isInvalid())
- return SemaRef.StmtError();
+ return StmtError();
if (!getDerived().AlwaysRebuild() &&
FullCond.get() == S->getCond() &&
@@ -3601,12 +3598,12 @@
S->getConditionVariable()->getLocation(),
S->getConditionVariable()));
if (!ConditionVar)
- return SemaRef.StmtError();
+ return StmtError();
} else {
Cond = getDerived().TransformExpr(S->getCond());
if (Cond.isInvalid())
- return SemaRef.StmtError();
+ return StmtError();
}
// Rebuild the switch statement.
@@ -3614,12 +3611,12 @@
= getDerived().RebuildSwitchStmtStart(S->getSwitchLoc(), Cond.get(),
ConditionVar);
if (Switch.isInvalid())
- return SemaRef.StmtError();
+ return StmtError();
// Transform the body of the switch statement.
StmtResult Body = getDerived().TransformStmt(S->getBody());
if (Body.isInvalid())
- return SemaRef.StmtError();
+ return StmtError();
// Complete the switch statement.
return getDerived().RebuildSwitchStmtBody(S->getSwitchLoc(), Switch.get(),
@@ -3639,12 +3636,12 @@
S->getConditionVariable()->getLocation(),
S->getConditionVariable()));
if (!ConditionVar)
- return SemaRef.StmtError();
+ return StmtError();
} else {
Cond = getDerived().TransformExpr(S->getCond());
if (Cond.isInvalid())
- return SemaRef.StmtError();
+ return StmtError();
if (S->getCond()) {
// Convert the condition to a boolean value.
@@ -3652,19 +3649,19 @@
S->getWhileLoc(),
Cond.get());
if (CondE.isInvalid())
- return getSema().StmtError();
+ return StmtError();
Cond = CondE;
}
}
Sema::FullExprArg FullCond(getSema().MakeFullExpr(Cond.take()));
if (!S->getConditionVariable() && S->getCond() && !FullCond.get())
- return SemaRef.StmtError();
+ return StmtError();
// Transform the body
StmtResult Body = getDerived().TransformStmt(S->getBody());
if (Body.isInvalid())
- return SemaRef.StmtError();
+ return StmtError();
if (!getDerived().AlwaysRebuild() &&
FullCond.get() == S->getCond() &&
@@ -3682,12 +3679,12 @@
// Transform the body
StmtResult Body = getDerived().TransformStmt(S->getBody());
if (Body.isInvalid())
- return SemaRef.StmtError();
+ return StmtError();
// Transform the condition
ExprResult Cond = getDerived().TransformExpr(S->getCond());
if (Cond.isInvalid())
- return SemaRef.StmtError();
+ return StmtError();
if (!getDerived().AlwaysRebuild() &&
Cond.get() == S->getCond() &&
@@ -3705,7 +3702,7 @@
// Transform the initialization statement
StmtResult Init = getDerived().TransformStmt(S->getInit());
if (Init.isInvalid())
- return SemaRef.StmtError();
+ return StmtError();
// Transform the condition
ExprResult Cond;
@@ -3717,12 +3714,12 @@
S->getConditionVariable()->getLocation(),
S->getConditionVariable()));
if (!ConditionVar)
- return SemaRef.StmtError();
+ return StmtError();
} else {
Cond = getDerived().TransformExpr(S->getCond());
if (Cond.isInvalid())
- return SemaRef.StmtError();
+ return StmtError();
if (S->getCond()) {
// Convert the condition to a boolean value.
@@ -3730,7 +3727,7 @@
S->getForLoc(),
Cond.get());
if (CondE.isInvalid())
- return getSema().StmtError();
+ return StmtError();
Cond = CondE.get();
}
@@ -3738,21 +3735,21 @@
Sema::FullExprArg FullCond(getSema().MakeFullExpr(Cond.take()));
if (!S->getConditionVariable() && S->getCond() && !FullCond.get())
- return SemaRef.StmtError();
+ return StmtError();
// Transform the increment
ExprResult Inc = getDerived().TransformExpr(S->getInc());
if (Inc.isInvalid())
- return SemaRef.StmtError();
+ return StmtError();
Sema::FullExprArg FullInc(getSema().MakeFullExpr(Inc.get()));
if (S->getInc() && !FullInc.get())
- return SemaRef.StmtError();
+ return StmtError();
// Transform the body
StmtResult Body = getDerived().TransformStmt(S->getBody());
if (Body.isInvalid())
- return SemaRef.StmtError();
+ return StmtError();
if (!getDerived().AlwaysRebuild() &&
Init.get() == S->getInit() &&
@@ -3779,7 +3776,7 @@
TreeTransform<Derived>::TransformIndirectGotoStmt(IndirectGotoStmt *S) {
ExprResult Target = getDerived().TransformExpr(S->getTarget());
if (Target.isInvalid())
- return SemaRef.StmtError();
+ return StmtError();
if (!getDerived().AlwaysRebuild() &&
Target.get() == S->getTarget())
@@ -3806,7 +3803,7 @@
TreeTransform<Derived>::TransformReturnStmt(ReturnStmt *S) {
ExprResult Result = getDerived().TransformExpr(S->getRetValue());
if (Result.isInvalid())
- return SemaRef.StmtError();
+ return StmtError();
// FIXME: We always rebuild the return statement because there is no way
// to tell whether the return type of the function has changed.
@@ -3823,7 +3820,7 @@
Decl *Transformed = getDerived().TransformDefinition((*D)->getLocation(),
*D);
if (!Transformed)
- return SemaRef.StmtError();
+ return StmtError();
if (Transformed != *D)
DeclChanged = true;
@@ -3869,7 +3866,7 @@
Expr *OutputExpr = S->getOutputExpr(I);
ExprResult Result = getDerived().TransformExpr(OutputExpr);
if (Result.isInvalid())
- return SemaRef.StmtError();
+ return StmtError();
ExprsChanged |= Result.get() != OutputExpr;
@@ -3887,7 +3884,7 @@
Expr *InputExpr = S->getInputExpr(I);
ExprResult Result = getDerived().TransformExpr(InputExpr);
if (Result.isInvalid())
- return SemaRef.StmtError();
+ return StmtError();
ExprsChanged |= Result.get() != InputExpr;
@@ -3925,7 +3922,7 @@
// Transform the body of the @try.
StmtResult TryBody = getDerived().TransformStmt(S->getTryBody());
if (TryBody.isInvalid())
- return SemaRef.StmtError();
+ return StmtError();
// Transform the @catch statements (if present).
bool AnyCatchChanged = false;
@@ -3933,7 +3930,7 @@
for (unsigned I = 0, N = S->getNumCatchStmts(); I != N; ++I) {
StmtResult Catch = getDerived().TransformStmt(S->getCatchStmt(I));
if (Catch.isInvalid())
- return SemaRef.StmtError();
+ return StmtError();
if (Catch.get() != S->getCatchStmt(I))
AnyCatchChanged = true;
CatchStmts.push_back(Catch.release());
@@ -3944,7 +3941,7 @@
if (S->getFinallyStmt()) {
Finally = getDerived().TransformStmt(S->getFinallyStmt());
if (Finally.isInvalid())
- return SemaRef.StmtError();
+ return StmtError();
}
// If nothing changed, just retain this statement.
@@ -3969,7 +3966,7 @@
if (FromVar->getTypeSourceInfo()) {
TSInfo = getDerived().TransformType(FromVar->getTypeSourceInfo());
if (!TSInfo)
- return SemaRef.StmtError();
+ return StmtError();
}
QualType T;
@@ -3978,17 +3975,17 @@
else {
T = getDerived().TransformType(FromVar->getType());
if (T.isNull())
- return SemaRef.StmtError();
+ return StmtError();
}
Var = getDerived().RebuildObjCExceptionDecl(FromVar, TSInfo, T);
if (!Var)
- return SemaRef.StmtError();
+ return StmtError();
}
StmtResult Body = getDerived().TransformStmt(S->getCatchBody());
if (Body.isInvalid())
- return SemaRef.StmtError();
+ return StmtError();
return getDerived().RebuildObjCAtCatchStmt(S->getAtCatchLoc(),
S->getRParenLoc(),
@@ -4001,7 +3998,7 @@
// Transform the body.
StmtResult Body = getDerived().TransformStmt(S->getFinallyBody());
if (Body.isInvalid())
- return SemaRef.StmtError();
+ return StmtError();
// If nothing changed, just retain this statement.
if (!getDerived().AlwaysRebuild() &&
@@ -4020,7 +4017,7 @@
if (S->getThrowExpr()) {
Operand = getDerived().TransformExpr(S->getThrowExpr());
if (Operand.isInvalid())
- return getSema().StmtError();
+ return StmtError();
}
if (!getDerived().AlwaysRebuild() &&
@@ -4037,12 +4034,12 @@
// Transform the object we are locking.
ExprResult Object = getDerived().TransformExpr(S->getSynchExpr());
if (Object.isInvalid())
- return SemaRef.StmtError();
+ return StmtError();
// Transform the body.
StmtResult Body = getDerived().TransformStmt(S->getSynchBody());
if (Body.isInvalid())
- return SemaRef.StmtError();
+ return StmtError();
// If nothing change, just retain the current statement.
if (!getDerived().AlwaysRebuild() &&
@@ -4062,17 +4059,17 @@
// Transform the element statement.
StmtResult Element = getDerived().TransformStmt(S->getElement());
if (Element.isInvalid())
- return SemaRef.StmtError();
+ return StmtError();
// Transform the collection expression.
ExprResult Collection = getDerived().TransformExpr(S->getCollection());
if (Collection.isInvalid())
- return SemaRef.StmtError();
+ return StmtError();
// Transform the body.
StmtResult Body = getDerived().TransformStmt(S->getBody());
if (Body.isInvalid())
- return SemaRef.StmtError();
+ return StmtError();
// If nothing changed, just retain this statement.
if (!getDerived().AlwaysRebuild() &&
@@ -4103,7 +4100,7 @@
QualType T = getDerived().TransformType(ExceptionDecl->getType());
if (T.isNull())
- return SemaRef.StmtError();
+ return StmtError();
Var = getDerived().RebuildExceptionDecl(ExceptionDecl,
T,
@@ -4113,13 +4110,13 @@
/*FIXME: Inaccurate*/
SourceRange(ExceptionDecl->getLocation()));
if (!Var || Var->isInvalidDecl())
- return SemaRef.StmtError();
+ return StmtError();
}
// Transform the actual exception handler.
StmtResult Handler = getDerived().TransformStmt(S->getHandlerBlock());
if (Handler.isInvalid())
- return SemaRef.StmtError();
+ return StmtError();
if (!getDerived().AlwaysRebuild() &&
!Var &&
@@ -4138,7 +4135,7 @@
StmtResult TryBlock
= getDerived().TransformCompoundStmt(S->getTryBlock());
if (TryBlock.isInvalid())
- return SemaRef.StmtError();
+ return StmtError();
// Transform the handlers.
bool HandlerChanged = false;
@@ -4147,7 +4144,7 @@
StmtResult Handler
= getDerived().TransformCXXCatchStmt(S->getHandler(I));
if (Handler.isInvalid())
- return SemaRef.StmtError();
+ return StmtError();
HandlerChanged = HandlerChanged || Handler.get() != S->getHandler(I);
Handlers.push_back(Handler.takeAs<Stmt>());
@@ -4179,20 +4176,20 @@
Qualifier = getDerived().TransformNestedNameSpecifier(E->getQualifier(),
E->getQualifierRange());
if (!Qualifier)
- return SemaRef.ExprError();
+ return ExprError();
}
ValueDecl *ND
= cast_or_null<ValueDecl>(getDerived().TransformDecl(E->getLocation(),
E->getDecl()));
if (!ND)
- return SemaRef.ExprError();
+ return ExprError();
DeclarationNameInfo NameInfo = E->getNameInfo();
if (NameInfo.getName()) {
NameInfo = getDerived().TransformDeclarationNameInfo(NameInfo);
if (!NameInfo.getName())
- return SemaRef.ExprError();
+ return ExprError();
}
if (!getDerived().AlwaysRebuild() &&
@@ -4216,7 +4213,7 @@
for (unsigned I = 0, N = E->getNumTemplateArgs(); I != N; ++I) {
TemplateArgumentLoc Loc;
if (getDerived().TransformTemplateArgument(E->getTemplateArgs()[I], Loc))
- return SemaRef.ExprError();
+ return ExprError();
TransArgs.addArgument(Loc);
}
}
@@ -4260,7 +4257,7 @@
TreeTransform<Derived>::TransformParenExpr(ParenExpr *E) {
ExprResult SubExpr = getDerived().TransformExpr(E->getSubExpr());
if (SubExpr.isInvalid())
- return SemaRef.ExprError();
+ return ExprError();
if (!getDerived().AlwaysRebuild() && SubExpr.get() == E->getSubExpr())
return SemaRef.Owned(E->Retain());
@@ -4274,7 +4271,7 @@
TreeTransform<Derived>::TransformUnaryOperator(UnaryOperator *E) {
ExprResult SubExpr = getDerived().TransformExpr(E->getSubExpr());
if (SubExpr.isInvalid())
- return SemaRef.ExprError();
+ return ExprError();
if (!getDerived().AlwaysRebuild() && SubExpr.get() == E->getSubExpr())
return SemaRef.Owned(E->Retain());
@@ -4290,7 +4287,7 @@
// Transform the type.
TypeSourceInfo *Type = getDerived().TransformType(E->getTypeSourceInfo());
if (!Type)
- return getSema().ExprError();
+ return ExprError();
// Transform all of the components into components similar to what the
// parser uses.
@@ -4299,7 +4296,7 @@
// the fields again. However, __builtin_offsetof is rare enough in
// template code that we don't care.
bool ExprChanged = false;
- typedef Action::OffsetOfComponent Component;
+ typedef Sema::OffsetOfComponent Component;
typedef OffsetOfExpr::OffsetOfNode Node;
llvm::SmallVector<Component, 4> Components;
for (unsigned I = 0, N = E->getNumComponents(); I != N; ++I) {
@@ -4313,7 +4310,7 @@
Expr *FromIndex = E->getIndexExpr(ON.getArrayExprIndex());
ExprResult Index = getDerived().TransformExpr(FromIndex);
if (Index.isInvalid())
- return getSema().ExprError();
+ return ExprError();
ExprChanged = ExprChanged || Index.get() != FromIndex;
Comp.isBrackets = true;
@@ -4358,7 +4355,7 @@
TypeSourceInfo *NewT = getDerived().TransformType(OldT);
if (!NewT)
- return SemaRef.ExprError();
+ return ExprError();
if (!getDerived().AlwaysRebuild() && OldT == NewT)
return SemaRef.Owned(E->Retain());
@@ -4373,11 +4370,11 @@
// C++0x [expr.sizeof]p1:
// The operand is either an expression, which is an unevaluated operand
// [...]
- EnterExpressionEvaluationContext Unevaluated(SemaRef, Action::Unevaluated);
+ EnterExpressionEvaluationContext Unevaluated(SemaRef, Sema::Unevaluated);
SubExpr = getDerived().TransformExpr(E->getArgumentExpr());
if (SubExpr.isInvalid())
- return SemaRef.ExprError();
+ return ExprError();
if (!getDerived().AlwaysRebuild() && SubExpr.get() == E->getArgumentExpr())
return SemaRef.Owned(E->Retain());
@@ -4393,11 +4390,11 @@
TreeTransform<Derived>::TransformArraySubscriptExpr(ArraySubscriptExpr *E) {
ExprResult LHS = getDerived().TransformExpr(E->getLHS());
if (LHS.isInvalid())
- return SemaRef.ExprError();
+ return ExprError();
ExprResult RHS = getDerived().TransformExpr(E->getRHS());
if (RHS.isInvalid())
- return SemaRef.ExprError();
+ return ExprError();
if (!getDerived().AlwaysRebuild() &&
@@ -4417,7 +4414,7 @@
// Transform the callee.
ExprResult Callee = getDerived().TransformExpr(E->getCallee());
if (Callee.isInvalid())
- return SemaRef.ExprError();
+ return ExprError();
// Transform arguments.
bool ArgChanged = false;
@@ -4426,7 +4423,7 @@
for (unsigned I = 0, N = E->getNumArgs(); I != N; ++I) {
ExprResult Arg = getDerived().TransformExpr(E->getArg(I));
if (Arg.isInvalid())
- return SemaRef.ExprError();
+ return ExprError();
// FIXME: Wrong source location information for the ','.
FakeCommaLocs.push_back(
@@ -4455,7 +4452,7 @@
TreeTransform<Derived>::TransformMemberExpr(MemberExpr *E) {
ExprResult Base = getDerived().TransformExpr(E->getBase());
if (Base.isInvalid())
- return SemaRef.ExprError();
+ return ExprError();
NestedNameSpecifier *Qualifier = 0;
if (E->hasQualifier()) {
@@ -4463,14 +4460,14 @@
= getDerived().TransformNestedNameSpecifier(E->getQualifier(),
E->getQualifierRange());
if (Qualifier == 0)
- return SemaRef.ExprError();
+ return ExprError();
}
ValueDecl *Member
= cast_or_null<ValueDecl>(getDerived().TransformDecl(E->getMemberLoc(),
E->getMemberDecl()));
if (!Member)
- return SemaRef.ExprError();
+ return ExprError();
NamedDecl *FoundDecl = E->getFoundDecl();
if (FoundDecl == E->getMemberDecl()) {
@@ -4479,7 +4476,7 @@
FoundDecl = cast_or_null<NamedDecl>(
getDerived().TransformDecl(E->getMemberLoc(), FoundDecl));
if (!FoundDecl)
- return SemaRef.ExprError();
+ return ExprError();
}
if (!getDerived().AlwaysRebuild() &&
@@ -4502,7 +4499,7 @@
for (unsigned I = 0, N = E->getNumTemplateArgs(); I != N; ++I) {
TemplateArgumentLoc Loc;
if (getDerived().TransformTemplateArgument(E->getTemplateArgs()[I], Loc))
- return SemaRef.ExprError();
+ return ExprError();
TransArgs.addArgument(Loc);
}
}
@@ -4534,11 +4531,11 @@
TreeTransform<Derived>::TransformBinaryOperator(BinaryOperator *E) {
ExprResult LHS = getDerived().TransformExpr(E->getLHS());
if (LHS.isInvalid())
- return SemaRef.ExprError();
+ return ExprError();
ExprResult RHS = getDerived().TransformExpr(E->getRHS());
if (RHS.isInvalid())
- return SemaRef.ExprError();
+ return ExprError();
if (!getDerived().AlwaysRebuild() &&
LHS.get() == E->getLHS() &&
@@ -4561,15 +4558,15 @@
TreeTransform<Derived>::TransformConditionalOperator(ConditionalOperator *E) {
ExprResult Cond = getDerived().TransformExpr(E->getCond());
if (Cond.isInvalid())
- return SemaRef.ExprError();
+ return ExprError();
ExprResult LHS = getDerived().TransformExpr(E->getLHS());
if (LHS.isInvalid())
- return SemaRef.ExprError();
+ return ExprError();
ExprResult RHS = getDerived().TransformExpr(E->getRHS());
if (RHS.isInvalid())
- return SemaRef.ExprError();
+ return ExprError();
if (!getDerived().AlwaysRebuild() &&
Cond.get() == E->getCond() &&
@@ -4606,13 +4603,13 @@
OldT = E->getTypeInfoAsWritten();
NewT = getDerived().TransformType(OldT);
if (!NewT)
- return SemaRef.ExprError();
+ return ExprError();
}
ExprResult SubExpr
= getDerived().TransformExpr(E->getSubExprAsWritten());
if (SubExpr.isInvalid())
- return SemaRef.ExprError();
+ return ExprError();
if (!getDerived().AlwaysRebuild() &&
OldT == NewT &&
@@ -4631,11 +4628,11 @@
TypeSourceInfo *OldT = E->getTypeSourceInfo();
TypeSourceInfo *NewT = getDerived().TransformType(OldT);
if (!NewT)
- return SemaRef.ExprError();
+ return ExprError();
ExprResult Init = getDerived().TransformExpr(E->getInitializer());
if (Init.isInvalid())
- return SemaRef.ExprError();
+ return ExprError();
if (!getDerived().AlwaysRebuild() &&
OldT == NewT &&
@@ -4656,7 +4653,7 @@
TreeTransform<Derived>::TransformExtVectorElementExpr(ExtVectorElementExpr *E) {
ExprResult Base = getDerived().TransformExpr(E->getBase());
if (Base.isInvalid())
- return SemaRef.ExprError();
+ return ExprError();
if (!getDerived().AlwaysRebuild() &&
Base.get() == E->getBase())
@@ -4679,7 +4676,7 @@
for (unsigned I = 0, N = E->getNumInits(); I != N; ++I) {
ExprResult Init = getDerived().TransformExpr(E->getInit(I));
if (Init.isInvalid())
- return SemaRef.ExprError();
+ return ExprError();
InitChanged = InitChanged || Init.get() != E->getInit(I);
Inits.push_back(Init.get());
@@ -4700,7 +4697,7 @@
// transform the initializer value
ExprResult Init = getDerived().TransformExpr(E->getInit());
if (Init.isInvalid())
- return SemaRef.ExprError();
+ return ExprError();
// transform the designators.
ASTOwningVector<Expr*, 4> ArrayExprs(SemaRef);
@@ -4718,7 +4715,7 @@
if (D->isArrayDesignator()) {
ExprResult Index = getDerived().TransformExpr(E->getArrayIndex(*D));
if (Index.isInvalid())
- return SemaRef.ExprError();
+ return ExprError();
Desig.AddDesignator(Designator::getArray(Index.get(),
D->getLBracketLoc()));
@@ -4732,11 +4729,11 @@
ExprResult Start
= getDerived().TransformExpr(E->getArrayRangeStart(*D));
if (Start.isInvalid())
- return SemaRef.ExprError();
+ return ExprError();
ExprResult End = getDerived().TransformExpr(E->getArrayRangeEnd(*D));
if (End.isInvalid())
- return SemaRef.ExprError();
+ return ExprError();
Desig.AddDesignator(Designator::getArrayRange(Start.get(),
End.get(),
@@ -4770,7 +4767,7 @@
// need to transform the type?
QualType T = getDerived().TransformType(E->getType());
if (T.isNull())
- return SemaRef.ExprError();
+ return ExprError();
if (!getDerived().AlwaysRebuild() &&
T == E->getType())
@@ -4784,11 +4781,11 @@
TreeTransform<Derived>::TransformVAArgExpr(VAArgExpr *E) {
TypeSourceInfo *TInfo = getDerived().TransformType(E->getWrittenTypeInfo());
if (!TInfo)
- return SemaRef.ExprError();
+ return ExprError();
ExprResult SubExpr = getDerived().TransformExpr(E->getSubExpr());
if (SubExpr.isInvalid())
- return SemaRef.ExprError();
+ return ExprError();
if (!getDerived().AlwaysRebuild() &&
TInfo == E->getWrittenTypeInfo() &&
@@ -4807,7 +4804,7 @@
for (unsigned I = 0, N = E->getNumExprs(); I != N; ++I) {
ExprResult Init = getDerived().TransformExpr(E->getExpr(I));
if (Init.isInvalid())
- return SemaRef.ExprError();
+ return ExprError();
ArgumentChanged = ArgumentChanged || Init.get() != E->getExpr(I);
Inits.push_back(Init.get());
@@ -4836,7 +4833,7 @@
StmtResult SubStmt
= getDerived().TransformCompoundStmt(E->getSubStmt(), true);
if (SubStmt.isInvalid())
- return SemaRef.ExprError();
+ return ExprError();
if (!getDerived().AlwaysRebuild() &&
SubStmt.get() == E->getSubStmt())
@@ -4855,11 +4852,11 @@
TInfo1 = getDerived().TransformType(E->getArgTInfo1());
if (!TInfo1)
- return SemaRef.ExprError();
+ return ExprError();
TInfo2 = getDerived().TransformType(E->getArgTInfo2());
if (!TInfo2)
- return SemaRef.ExprError();
+ return ExprError();
if (!getDerived().AlwaysRebuild() &&
TInfo1 == E->getArgTInfo1() &&
@@ -4876,15 +4873,15 @@
TreeTransform<Derived>::TransformChooseExpr(ChooseExpr *E) {
ExprResult Cond = getDerived().TransformExpr(E->getCond());
if (Cond.isInvalid())
- return SemaRef.ExprError();
+ return ExprError();
ExprResult LHS = getDerived().TransformExpr(E->getLHS());
if (LHS.isInvalid())
- return SemaRef.ExprError();
+ return ExprError();
ExprResult RHS = getDerived().TransformExpr(E->getRHS());
if (RHS.isInvalid())
- return SemaRef.ExprError();
+ return ExprError();
if (!getDerived().AlwaysRebuild() &&
Cond.get() == E->getCond() &&
@@ -4912,7 +4909,7 @@
case OO_Array_New:
case OO_Array_Delete:
llvm_unreachable("new and delete operators cannot use CXXOperatorCallExpr");
- return SemaRef.ExprError();
+ return ExprError();
case OO_Call: {
// This is a call to an object's operator().
@@ -4921,7 +4918,7 @@
// Transform the object itself.
ExprResult Object = getDerived().TransformExpr(E->getArg(0));
if (Object.isInvalid())
- return SemaRef.ExprError();
+ return ExprError();
// FIXME: Poor location information
SourceLocation FakeLParenLoc
@@ -4937,7 +4934,7 @@
ExprResult Arg = getDerived().TransformExpr(E->getArg(I));
if (Arg.isInvalid())
- return SemaRef.ExprError();
+ return ExprError();
// FIXME: Poor source location information.
SourceLocation FakeCommaLoc
@@ -4963,27 +4960,27 @@
case OO_Conditional:
llvm_unreachable("conditional operator is not actually overloadable");
- return SemaRef.ExprError();
+ return ExprError();
case OO_None:
case NUM_OVERLOADED_OPERATORS:
llvm_unreachable("not an overloaded operator?");
- return SemaRef.ExprError();
+ return ExprError();
}
ExprResult Callee = getDerived().TransformExpr(E->getCallee());
if (Callee.isInvalid())
- return SemaRef.ExprError();
+ return ExprError();
ExprResult First = getDerived().TransformExpr(E->getArg(0));
if (First.isInvalid())
- return SemaRef.ExprError();
+ return ExprError();
ExprResult Second;
if (E->getNumArgs() == 2) {
Second = getDerived().TransformExpr(E->getArg(1));
if (Second.isInvalid())
- return SemaRef.ExprError();
+ return ExprError();
}
if (!getDerived().AlwaysRebuild() &&
@@ -5019,13 +5016,13 @@
OldT = E->getTypeInfoAsWritten();
NewT = getDerived().TransformType(OldT);
if (!NewT)
- return SemaRef.ExprError();
+ return ExprError();
}
ExprResult SubExpr
= getDerived().TransformExpr(E->getSubExprAsWritten());
if (SubExpr.isInvalid())
- return SemaRef.ExprError();
+ return ExprError();
if (!getDerived().AlwaysRebuild() &&
OldT == NewT &&
@@ -5086,13 +5083,13 @@
OldT = E->getTypeInfoAsWritten();
NewT = getDerived().TransformType(OldT);
if (!NewT)
- return SemaRef.ExprError();
+ return ExprError();
}
ExprResult SubExpr
= getDerived().TransformExpr(E->getSubExprAsWritten());
if (SubExpr.isInvalid())
- return SemaRef.ExprError();
+ return ExprError();
if (!getDerived().AlwaysRebuild() &&
OldT == NewT &&
@@ -5115,7 +5112,7 @@
TypeSourceInfo *TInfo
= getDerived().TransformType(E->getTypeOperandSourceInfo());
if (!TInfo)
- return SemaRef.ExprError();
+ return ExprError();
if (!getDerived().AlwaysRebuild() &&
TInfo == E->getTypeOperandSourceInfo())
@@ -5131,11 +5128,11 @@
// after we perform semantic analysis, so the expression is potentially
// potentially evaluated.
EnterExpressionEvaluationContext Unevaluated(SemaRef,
- Action::PotentiallyPotentiallyEvaluated);
+ Sema::PotentiallyPotentiallyEvaluated);
ExprResult SubExpr = getDerived().TransformExpr(E->getExprOperand());
if (SubExpr.isInvalid())
- return SemaRef.ExprError();
+ return ExprError();
if (!getDerived().AlwaysRebuild() &&
SubExpr.get() == E->getExprOperand())
@@ -5167,7 +5164,7 @@
QualType T = getDerived().TransformType(E->getType());
if (T.isNull())
- return SemaRef.ExprError();
+ return ExprError();
if (!getDerived().AlwaysRebuild() &&
T == E->getType())
@@ -5181,7 +5178,7 @@
TreeTransform<Derived>::TransformCXXThrowExpr(CXXThrowExpr *E) {
ExprResult SubExpr = getDerived().TransformExpr(E->getSubExpr());
if (SubExpr.isInvalid())
- return SemaRef.ExprError();
+ return ExprError();
if (!getDerived().AlwaysRebuild() &&
SubExpr.get() == E->getSubExpr())
@@ -5197,7 +5194,7 @@
= cast_or_null<ParmVarDecl>(getDerived().TransformDecl(E->getLocStart(),
E->getParam()));
if (!Param)
- return SemaRef.ExprError();
+ return ExprError();
if (!getDerived().AlwaysRebuild() &&
Param == E->getParam())
@@ -5213,7 +5210,7 @@
QualType T = getDerived().TransformType(E->getType());
if (T.isNull())
- return SemaRef.ExprError();
+ return ExprError();
if (!getDerived().AlwaysRebuild() &&
T == E->getType())
@@ -5232,12 +5229,12 @@
TemporaryBase Rebase(*this, E->getLocStart(), DeclarationName());
QualType AllocType = getDerived().TransformType(E->getAllocatedType());
if (AllocType.isNull())
- return SemaRef.ExprError();
+ return ExprError();
// Transform the size of the array we're allocating (if any).
ExprResult ArraySize = getDerived().TransformExpr(E->getArraySize());
if (ArraySize.isInvalid())
- return SemaRef.ExprError();
+ return ExprError();
// Transform the placement arguments (if any).
bool ArgumentChanged = false;
@@ -5245,7 +5242,7 @@
for (unsigned I = 0, N = E->getNumPlacementArgs(); I != N; ++I) {
ExprResult Arg = getDerived().TransformExpr(E->getPlacementArg(I));
if (Arg.isInvalid())
- return SemaRef.ExprError();
+ return ExprError();
ArgumentChanged = ArgumentChanged || Arg.get() != E->getPlacementArg(I);
PlacementArgs.push_back(Arg.take());
@@ -5259,7 +5256,7 @@
ExprResult Arg = getDerived().TransformExpr(E->getConstructorArg(I));
if (Arg.isInvalid())
- return SemaRef.ExprError();
+ return ExprError();
ArgumentChanged = ArgumentChanged || Arg.get() != E->getConstructorArg(I);
ConstructorArgs.push_back(Arg.take());
@@ -5272,7 +5269,7 @@
getDerived().TransformDecl(E->getLocStart(),
E->getConstructor()));
if (!Constructor)
- return SemaRef.ExprError();
+ return ExprError();
}
FunctionDecl *OperatorNew = 0;
@@ -5281,7 +5278,7 @@
getDerived().TransformDecl(E->getLocStart(),
E->getOperatorNew()));
if (!OperatorNew)
- return SemaRef.ExprError();
+ return ExprError();
}
FunctionDecl *OperatorDelete = 0;
@@ -5290,7 +5287,7 @@
getDerived().TransformDecl(E->getLocStart(),
E->getOperatorDelete()));
if (!OperatorDelete)
- return SemaRef.ExprError();
+ return ExprError();
}
if (!getDerived().AlwaysRebuild() &&
@@ -5356,7 +5353,7 @@
TreeTransform<Derived>::TransformCXXDeleteExpr(CXXDeleteExpr *E) {
ExprResult Operand = getDerived().TransformExpr(E->getArgument());
if (Operand.isInvalid())
- return SemaRef.ExprError();
+ return ExprError();
// Transform the delete operator, if known.
FunctionDecl *OperatorDelete = 0;
@@ -5365,7 +5362,7 @@
getDerived().TransformDecl(E->getLocStart(),
E->getOperatorDelete()));
if (!OperatorDelete)
- return SemaRef.ExprError();
+ return ExprError();
}
if (!getDerived().AlwaysRebuild() &&
@@ -5390,7 +5387,7 @@
CXXPseudoDestructorExpr *E) {
ExprResult Base = getDerived().TransformExpr(E->getBase());
if (Base.isInvalid())
- return SemaRef.ExprError();
+ return ExprError();
ParsedType ObjectTypePtr;
bool MayBePseudoDestructor = false;
@@ -5400,7 +5397,7 @@
ObjectTypePtr,
MayBePseudoDestructor);
if (Base.isInvalid())
- return SemaRef.ExprError();
+ return ExprError();
QualType ObjectType = ObjectTypePtr.get();
NestedNameSpecifier *Qualifier
@@ -5408,14 +5405,14 @@
E->getQualifierRange(),
ObjectType);
if (E->getQualifier() && !Qualifier)
- return SemaRef.ExprError();
+ return ExprError();
PseudoDestructorTypeStorage Destroyed;
if (E->getDestroyedTypeInfo()) {
TypeSourceInfo *DestroyedTypeInfo
= getDerived().TransformType(E->getDestroyedTypeInfo(), ObjectType);
if (!DestroyedTypeInfo)
- return SemaRef.ExprError();
+ return ExprError();
Destroyed = DestroyedTypeInfo;
} else if (ObjectType->isDependentType()) {
// We aren't likely to be able to resolve the identifier down to a type
@@ -5437,7 +5434,7 @@
SS, ObjectTypePtr,
false);
if (!T)
- return SemaRef.ExprError();
+ return ExprError();
Destroyed
= SemaRef.Context.getTrivialTypeSourceInfo(SemaRef.GetTypeFromParser(T),
@@ -5449,7 +5446,7 @@
ScopeTypeInfo = getDerived().TransformType(E->getScopeTypeInfo(),
ObjectType);
if (!ScopeTypeInfo)
- return SemaRef.ExprError();
+ return ExprError();
}
return getDerived().RebuildCXXPseudoDestructorExpr(Base.get(),
@@ -5484,7 +5481,7 @@
if (isa<UsingShadowDecl>(*I))
continue;
else
- return SemaRef.ExprError();
+ return ExprError();
}
// Expand using declarations.
@@ -5510,7 +5507,7 @@
Qualifier = getDerived().TransformNestedNameSpecifier(Old->getQualifier(),
Old->getQualifierRange());
if (!Qualifier)
- return SemaRef.ExprError();
+ return ExprError();
SS.setScopeRep(Qualifier);
SS.setRange(Old->getQualifierRange());
@@ -5522,7 +5519,7 @@
Old->getNameLoc(),
Old->getNamingClass()));
if (!NamingClass)
- return SemaRef.ExprError();
+ return ExprError();
R.setNamingClass(NamingClass);
}
@@ -5537,7 +5534,7 @@
for (unsigned I = 0, N = Old->getNumTemplateArgs(); I != N; ++I) {
TemplateArgumentLoc Loc;
if (getDerived().TransformTemplateArgument(Old->getTemplateArgs()[I], Loc))
- return SemaRef.ExprError();
+ return ExprError();
TransArgs.addArgument(Loc);
}
@@ -5552,7 +5549,7 @@
QualType T = getDerived().TransformType(E->getQueriedType());
if (T.isNull())
- return SemaRef.ExprError();
+ return ExprError();
if (!getDerived().AlwaysRebuild() &&
T == E->getQueriedType())
@@ -5577,12 +5574,12 @@
= getDerived().TransformNestedNameSpecifier(E->getQualifier(),
E->getQualifierRange());
if (!NNS)
- return SemaRef.ExprError();
+ return ExprError();
DeclarationNameInfo NameInfo
= getDerived().TransformDeclarationNameInfo(E->getNameInfo());
if (!NameInfo.getName())
- return SemaRef.ExprError();
+ return ExprError();
if (!E->hasExplicitTemplateArgs()) {
if (!getDerived().AlwaysRebuild() &&
@@ -5602,7 +5599,7 @@
for (unsigned I = 0, N = E->getNumTemplateArgs(); I != N; ++I) {
TemplateArgumentLoc Loc;
if (getDerived().TransformTemplateArgument(E->getTemplateArgs()[I], Loc))
- return SemaRef.ExprError();
+ return ExprError();
TransArgs.addArgument(Loc);
}
@@ -5625,14 +5622,14 @@
QualType T = getDerived().TransformType(E->getType());
if (T.isNull())
- return SemaRef.ExprError();
+ return ExprError();
CXXConstructorDecl *Constructor
= cast_or_null<CXXConstructorDecl>(
getDerived().TransformDecl(E->getLocStart(),
E->getConstructor()));
if (!Constructor)
- return SemaRef.ExprError();
+ return ExprError();
bool ArgumentChanged = false;
ASTOwningVector<Expr*> Args(SemaRef);
@@ -5646,7 +5643,7 @@
ExprResult TransArg = getDerived().TransformExpr(*Arg);
if (TransArg.isInvalid())
- return SemaRef.ExprError();
+ return ExprError();
ArgumentChanged = ArgumentChanged || TransArg.get() != *Arg;
Args.push_back(TransArg.get());
@@ -5708,14 +5705,14 @@
TemporaryBase Rebase(*this, E->getTypeBeginLoc(), DeclarationName());
QualType T = getDerived().TransformType(E->getType());
if (T.isNull())
- return SemaRef.ExprError();
+ return ExprError();
CXXConstructorDecl *Constructor
= cast_or_null<CXXConstructorDecl>(
getDerived().TransformDecl(E->getLocStart(),
E->getConstructor()));
if (!Constructor)
- return SemaRef.ExprError();
+ return ExprError();
bool ArgumentChanged = false;
ASTOwningVector<Expr*> Args(SemaRef);
@@ -5730,7 +5727,7 @@
ExprResult TransArg = getDerived().TransformExpr(*Arg);
if (TransArg.isInvalid())
- return SemaRef.ExprError();
+ return ExprError();
ArgumentChanged = ArgumentChanged || TransArg.get() != *Arg;
Args.push_back((Expr *)TransArg.release());
@@ -5767,7 +5764,7 @@
TemporaryBase Rebase(*this, E->getTypeBeginLoc(), DeclarationName());
QualType T = getDerived().TransformType(E->getTypeAsWritten());
if (T.isNull())
- return SemaRef.ExprError();
+ return ExprError();
bool ArgumentChanged = false;
ASTOwningVector<Expr*> Args(SemaRef);
@@ -5777,7 +5774,7 @@
Arg != ArgEnd; ++Arg) {
ExprResult TransArg = getDerived().TransformExpr(*Arg);
if (TransArg.isInvalid())
- return SemaRef.ExprError();
+ return ExprError();
ArgumentChanged = ArgumentChanged || TransArg.get() != *Arg;
FakeCommaLocs.push_back(
@@ -5812,7 +5809,7 @@
OldBase = E->getBase();
Base = getDerived().TransformExpr(OldBase);
if (Base.isInvalid())
- return SemaRef.ExprError();
+ return ExprError();
// Start the member reference and compute the object's type.
ParsedType ObjectTy;
@@ -5823,7 +5820,7 @@
ObjectTy,
MayBePseudoDestructor);
if (Base.isInvalid())
- return SemaRef.ExprError();
+ return ExprError();
ObjectType = ObjectTy.get();
BaseType = ((Expr*) Base.get())->getType();
@@ -5847,14 +5844,14 @@
ObjectType,
FirstQualifierInScope);
if (!Qualifier)
- return SemaRef.ExprError();
+ return ExprError();
}
DeclarationNameInfo NameInfo
= getDerived().TransformDeclarationNameInfo(E->getMemberNameInfo(),
ObjectType);
if (!NameInfo.getName())
- return SemaRef.ExprError();
+ return ExprError();
if (!E->hasExplicitTemplateArgs()) {
// This is a reference to a member without an explicitly-specified
@@ -5882,7 +5879,7 @@
for (unsigned I = 0, N = E->getNumTemplateArgs(); I != N; ++I) {
TemplateArgumentLoc Loc;
if (getDerived().TransformTemplateArgument(E->getTemplateArgs()[I], Loc))
- return SemaRef.ExprError();
+ return ExprError();
TransArgs.addArgument(Loc);
}
@@ -5906,7 +5903,7 @@
if (!Old->isImplicitAccess()) {
Base = getDerived().TransformExpr(Old->getBase());
if (Base.isInvalid())
- return SemaRef.ExprError();
+ return ExprError();
BaseType = ((Expr*) Base.get())->getType();
} else {
BaseType = getDerived().TransformType(Old->getBaseType());
@@ -5918,7 +5915,7 @@
= getDerived().TransformNestedNameSpecifier(Old->getQualifier(),
Old->getQualifierRange());
if (Qualifier == 0)
- return SemaRef.ExprError();
+ return ExprError();
}
LookupResult R(SemaRef, Old->getMemberNameInfo(),
@@ -5936,7 +5933,7 @@
if (isa<UsingShadowDecl>(*I))
continue;
else
- return SemaRef.ExprError();
+ return ExprError();
}
// Expand using declarations.
@@ -5960,7 +5957,7 @@
Old->getMemberLoc(),
Old->getNamingClass()));
if (!NamingClass)
- return SemaRef.ExprError();
+ return ExprError();
R.setNamingClass(NamingClass);
}
@@ -5973,7 +5970,7 @@
TemplateArgumentLoc Loc;
if (getDerived().TransformTemplateArgument(Old->getTemplateArgs()[I],
Loc))
- return SemaRef.ExprError();
+ return ExprError();
TransArgs.addArgument(Loc);
}
}
@@ -6008,7 +6005,7 @@
TypeSourceInfo *EncodedTypeInfo
= getDerived().TransformType(E->getEncodedTypeSourceInfo());
if (!EncodedTypeInfo)
- return SemaRef.ExprError();
+ return ExprError();
if (!getDerived().AlwaysRebuild() &&
EncodedTypeInfo == E->getEncodedTypeSourceInfo())
@@ -6028,7 +6025,7 @@
for (unsigned I = 0, N = E->getNumArgs(); I != N; ++I) {
ExprResult Arg = getDerived().TransformExpr(E->getArg(I));
if (Arg.isInvalid())
- return SemaRef.ExprError();
+ return ExprError();
ArgChanged = ArgChanged || Arg.get() != E->getArg(I);
Args.push_back(Arg.get());
@@ -6039,7 +6036,7 @@
TypeSourceInfo *ReceiverTypeInfo
= getDerived().TransformType(E->getClassReceiverTypeInfo());
if (!ReceiverTypeInfo)
- return SemaRef.ExprError();
+ return ExprError();
// If nothing changed, just retain the existing message send.
if (!getDerived().AlwaysRebuild() &&
@@ -6061,7 +6058,7 @@
ExprResult Receiver
= getDerived().TransformExpr(E->getInstanceReceiver());
if (Receiver.isInvalid())
- return SemaRef.ExprError();
+ return ExprError();
// If nothing changed, just retain the existing message send.
if (!getDerived().AlwaysRebuild() &&
@@ -6095,7 +6092,7 @@
// Transform the base expression.
ExprResult Base = getDerived().TransformExpr(E->getBase());
if (Base.isInvalid())
- return SemaRef.ExprError();
+ return ExprError();
// We don't need to transform the ivar; it will never change.
@@ -6115,7 +6112,7 @@
// Transform the base expression.
ExprResult Base = getDerived().TransformExpr(E->getBase());
if (Base.isInvalid())
- return SemaRef.ExprError();
+ return ExprError();
// We don't need to transform the property; it will never change.
@@ -6140,7 +6137,7 @@
// Transform the base expression.
ExprResult Base = getDerived().TransformExpr(E->getBase());
if (Base.isInvalid())
- return SemaRef.ExprError();
+ return ExprError();
// We don't need to transform the getters/setters; they will never change.
@@ -6171,7 +6168,7 @@
// Transform the base expression.
ExprResult Base = getDerived().TransformExpr(E->getBase());
if (Base.isInvalid())
- return SemaRef.ExprError();
+ return ExprError();
// If nothing changed, just retain the existing expression.
if (!getDerived().AlwaysRebuild() &&
@@ -6190,7 +6187,7 @@
for (unsigned I = 0, N = E->getNumSubExprs(); I != N; ++I) {
ExprResult SubExpr = getDerived().TransformExpr(E->getExpr(I));
if (SubExpr.isInvalid())
- return SemaRef.ExprError();
+ return ExprError();
ArgumentChanged = ArgumentChanged || SubExpr.get() != E->getExpr(I);
SubExprs.push_back(SubExpr.get());
@@ -6239,7 +6236,7 @@
// Transform the body
StmtResult Body = getDerived().TransformStmt(E->getBody());
if (Body.isInvalid())
- return SemaRef.ExprError();
+ return ExprError();
// Set the parameters on the block decl.
if (!Params.empty())
CurBlock->TheDecl->setParams(Params.data(), Params.size());
@@ -6265,7 +6262,7 @@
= cast_or_null<ValueDecl>(getDerived().TransformDecl(E->getLocation(),
E->getDecl()));
if (!ND)
- return SemaRef.ExprError();
+ return ExprError();
if (!getDerived().AlwaysRebuild() &&
ND == E->getDecl()) {
@@ -6624,7 +6621,7 @@
ExprResult Result
= SemaRef.CreateBuiltinBinOp(OpLoc, Opc, First, Second);
if (Result.isInvalid())
- return SemaRef.ExprError();
+ return ExprError();
return move(Result);
}
@@ -6666,7 +6663,7 @@
ExprResult Result
= SemaRef.CreateOverloadedBinOp(OpLoc, Opc, Functions, Args[0], Args[1]);
if (Result.isInvalid())
- return SemaRef.ExprError();
+ return ExprError();
return move(Result);
}