diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-03-01 17:25:41 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-03-01 17:25:41 +0000 |
commit | aac571c68de0a7c58d92fba0057e308f0e6d115c (patch) | |
tree | c27ba9b16c806bcdd72529a647564ae17f939aff /lib/Sema/TreeTransform.h | |
parent | 7c1e98f1cb37b40e619a0c8aee8b337f037b432b (diff) |
Finish pushing source-location information though TreeTransform's
TransformDefinition.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97445 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/TreeTransform.h')
-rw-r--r-- | lib/Sema/TreeTransform.h | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/lib/Sema/TreeTransform.h b/lib/Sema/TreeTransform.h index 4177d5249a..dccea49878 100644 --- a/lib/Sema/TreeTransform.h +++ b/lib/Sema/TreeTransform.h @@ -244,7 +244,7 @@ public: /// 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 @@ TreeTransform<Derived>::TransformIfStmt(IfStmt *S) { 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 @@ TreeTransform<Derived>::TransformSwitchStmt(SwitchStmt *S) { 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 @@ TreeTransform<Derived>::TransformWhileStmt(WhileStmt *S) { 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 @@ TreeTransform<Derived>::TransformForStmt(ForStmt *S) { 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 @@ TreeTransform<Derived>::TransformDeclStmt(DeclStmt *S) { 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(); |