[cfe-commits] r97445 - in /cfe/trunk/lib/Sema: SemaTemplateInstantiate.cpp TreeTransform.h
Douglas Gregor
dgregor at apple.com
Mon Mar 1 09:25:42 PST 2010
Author: dgregor
Date: Mon Mar 1 11:25:41 2010
New Revision: 97445
URL: http://llvm.org/viewvc/llvm-project?rev=97445&view=rev
Log:
Finish pushing source-location information though TreeTransform's
TransformDefinition.
Modified:
cfe/trunk/lib/Sema/SemaTemplateInstantiate.cpp
cfe/trunk/lib/Sema/TreeTransform.h
Modified: cfe/trunk/lib/Sema/SemaTemplateInstantiate.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaTemplateInstantiate.cpp?rev=97445&r1=97444&r2=97445&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaTemplateInstantiate.cpp (original)
+++ cfe/trunk/lib/Sema/SemaTemplateInstantiate.cpp Mon Mar 1 11:25:41 2010
@@ -544,7 +544,7 @@
/// \brief Transform the definition of the given declaration by
/// instantiating it.
- Decl *TransformDefinition(Decl *D);
+ Decl *TransformDefinition(SourceLocation Loc, Decl *D);
/// \bried Transform the first qualifier within a scope by instantiating the
/// declaration.
@@ -603,7 +603,7 @@
return SemaRef.FindInstantiatedDecl(Loc, cast<NamedDecl>(D), TemplateArgs);
}
-Decl *TemplateInstantiator::TransformDefinition(Decl *D) {
+Decl *TemplateInstantiator::TransformDefinition(SourceLocation Loc, Decl *D) {
Decl *Inst = getSema().SubstDecl(D, getSema().CurContext, TemplateArgs);
if (!Inst)
return 0;
Modified: cfe/trunk/lib/Sema/TreeTransform.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/TreeTransform.h?rev=97445&r1=97444&r2=97445&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/TreeTransform.h (original)
+++ cfe/trunk/lib/Sema/TreeTransform.h Mon Mar 1 11:25:41 2010
@@ -244,7 +244,7 @@
/// By default, invokes TransformDecl() to transform the declaration.
/// Subclasses may override this function to provide alternate behavior.
Decl *TransformDefinition(SourceLocation Loc, Decl *D) {
- return getDerived().TransformDecl(D);
+ return getDerived().TransformDecl(Loc, D);
}
/// \brief Transform the given declaration, which was the first part of a
@@ -3117,7 +3117,9 @@
if (S->getConditionVariable()) {
ConditionVar
= cast_or_null<VarDecl>(
- getDerived().TransformDefinition(S->getConditionVariable()));
+ getDerived().TransformDefinition(
+ S->getConditionVariable()->getLocation(),
+ S->getConditionVariable()));
if (!ConditionVar)
return SemaRef.StmtError();
} else {
@@ -3160,7 +3162,9 @@
if (S->getConditionVariable()) {
ConditionVar
= cast_or_null<VarDecl>(
- getDerived().TransformDefinition(S->getConditionVariable()));
+ getDerived().TransformDefinition(
+ S->getConditionVariable()->getLocation(),
+ S->getConditionVariable()));
if (!ConditionVar)
return SemaRef.StmtError();
} else {
@@ -3197,7 +3201,9 @@
if (S->getConditionVariable()) {
ConditionVar
= cast_or_null<VarDecl>(
- getDerived().TransformDefinition(S->getConditionVariable()));
+ getDerived().TransformDefinition(
+ S->getConditionVariable()->getLocation(),
+ S->getConditionVariable()));
if (!ConditionVar)
return SemaRef.StmtError();
} else {
@@ -3261,7 +3267,9 @@
if (S->getConditionVariable()) {
ConditionVar
= cast_or_null<VarDecl>(
- getDerived().TransformDefinition(S->getConditionVariable()));
+ getDerived().TransformDefinition(
+ S->getConditionVariable()->getLocation(),
+ S->getConditionVariable()));
if (!ConditionVar)
return SemaRef.StmtError();
} else {
@@ -3349,7 +3357,8 @@
llvm::SmallVector<Decl *, 4> Decls;
for (DeclStmt::decl_iterator D = S->decl_begin(), DEnd = S->decl_end();
D != DEnd; ++D) {
- Decl *Transformed = getDerived().TransformDefinition(*D);
+ Decl *Transformed = getDerived().TransformDefinition((*D)->getLocation(),
+ *D);
if (!Transformed)
return SemaRef.StmtError();
More information about the cfe-commits
mailing list