[cfe-commits] r72640 - in /cfe/trunk: include/clang/Parse/Action.h lib/Frontend/PrintParserCallbacks.cpp lib/Parse/ParseDecl.cpp lib/Sema/Sema.h lib/Sema/SemaDecl.cpp lib/Sema/SemaExprCXX.cpp
Anders Carlsson
andersca at mac.com
Sat May 30 14:37:25 PDT 2009
Author: andersca
Date: Sat May 30 16:37:25 2009
New Revision: 72640
URL: http://llvm.org/viewvc/llvm-project?rev=72640&view=rev
Log:
AddInitializerToDecl needs to take a full expression.
Modified:
cfe/trunk/include/clang/Parse/Action.h
cfe/trunk/lib/Frontend/PrintParserCallbacks.cpp
cfe/trunk/lib/Parse/ParseDecl.cpp
cfe/trunk/lib/Sema/Sema.h
cfe/trunk/lib/Sema/SemaDecl.cpp
cfe/trunk/lib/Sema/SemaExprCXX.cpp
Modified: cfe/trunk/include/clang/Parse/Action.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Parse/Action.h?rev=72640&r1=72639&r2=72640&view=diff
==============================================================================
--- cfe/trunk/include/clang/Parse/Action.h (original)
+++ cfe/trunk/include/clang/Parse/Action.h Sat May 30 16:37:25 2009
@@ -271,7 +271,7 @@
/// This allows ActOnDeclarator to register "xx" prior to parsing the
/// initializer. The declaration above should still result in a warning,
/// since the reference to "xx" is uninitialized.
- virtual void AddInitializerToDecl(DeclPtrTy Dcl, ExprArg Init) {
+ virtual void AddInitializerToDecl(DeclPtrTy Dcl, FullExprArg Init) {
return;
}
Modified: cfe/trunk/lib/Frontend/PrintParserCallbacks.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/PrintParserCallbacks.cpp?rev=72640&r1=72639&r2=72640&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/PrintParserCallbacks.cpp (original)
+++ cfe/trunk/lib/Frontend/PrintParserCallbacks.cpp Sat May 30 16:37:25 2009
@@ -109,7 +109,7 @@
/// This allows ActOnDeclarator to register "xx" prior to parsing the
/// initializer. The declaration above should still result in a warning,
/// since the reference to "xx" is uninitialized.
- virtual void AddInitializerToDecl(DeclPtrTy Dcl, ExprArg Init) {
+ virtual void AddInitializerToDecl(DeclPtrTy Dcl, FullExprArg Init) {
Out << __FUNCTION__ << "\n";
}
Modified: cfe/trunk/lib/Parse/ParseDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseDecl.cpp?rev=72640&r1=72639&r2=72640&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseDecl.cpp (original)
+++ cfe/trunk/lib/Parse/ParseDecl.cpp Sat May 30 16:37:25 2009
@@ -360,7 +360,7 @@
SkipUntil(tok::semi, true, true);
return DeclPtrTy();
}
- Actions.AddInitializerToDecl(ThisDecl, move(Init));
+ Actions.AddInitializerToDecl(ThisDecl, Actions.FullExpr(Init));
}
} else if (Tok.is(tok::l_paren)) {
// Parse C++ direct initializer: '(' expression-list ')'
Modified: cfe/trunk/lib/Sema/Sema.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/Sema.h?rev=72640&r1=72639&r2=72640&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/Sema.h (original)
+++ cfe/trunk/lib/Sema/Sema.h Sat May 30 16:37:25 2009
@@ -409,7 +409,7 @@
virtual void ActOnParamUnparsedDefaultArgument(DeclPtrTy param,
SourceLocation EqualLoc);
virtual void ActOnParamDefaultArgumentError(DeclPtrTy param);
- virtual void AddInitializerToDecl(DeclPtrTy dcl, ExprArg init);
+ virtual void AddInitializerToDecl(DeclPtrTy dcl, FullExprArg init);
void AddInitializerToDecl(DeclPtrTy dcl, ExprArg init, bool DirectInit);
void ActOnUninitializedDecl(DeclPtrTy dcl);
virtual void SetDeclDeleted(DeclPtrTy dcl, SourceLocation DelLoc);
Modified: cfe/trunk/lib/Sema/SemaDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDecl.cpp?rev=72640&r1=72639&r2=72640&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDecl.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDecl.cpp Sat May 30 16:37:25 2009
@@ -2468,8 +2468,8 @@
return true;
}
-void Sema::AddInitializerToDecl(DeclPtrTy dcl, ExprArg init) {
- AddInitializerToDecl(dcl, move(init), /*DirectInit=*/false);
+void Sema::AddInitializerToDecl(DeclPtrTy dcl, FullExprArg init) {
+ AddInitializerToDecl(dcl, init.release(), /*DirectInit=*/false);
}
/// AddInitializerToDecl - Adds the initializer Init to the
Modified: cfe/trunk/lib/Sema/SemaExprCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExprCXX.cpp?rev=72640&r1=72639&r2=72640&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaExprCXX.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExprCXX.cpp Sat May 30 16:37:25 2009
@@ -744,7 +744,7 @@
DeclPtrTy Dcl = ActOnDeclarator(S, D, DeclPtrTy());
if (!Dcl)
return ExprError();
- AddInitializerToDecl(Dcl, move(AssignExprVal));
+ AddInitializerToDecl(Dcl, move(AssignExprVal), /*DirectInit=*/false);
// Mark this variable as one that is declared within a conditional.
// We know that the decl had to be a VarDecl because that is the only type of
More information about the cfe-commits
mailing list