Fixed a bug where initializer is a macro in rewrite.

llvm-svn: 92801
This commit is contained in:
Fariborz Jahanian 2010-01-05 23:06:29 +00:00
parent 8600dd3d7c
commit b8646edecd
1 changed files with 1 additions and 0 deletions

View File

@ -4540,6 +4540,7 @@ void RewriteObjC::RewriteByRefVar(VarDecl *ND) {
} }
else { else {
SourceLocation startLoc = ND->getInit()->getLocStart(); SourceLocation startLoc = ND->getInit()->getLocStart();
startLoc = SM->getInstantiationLoc(startLoc);
ByrefType += " " + Name; ByrefType += " " + Name;
ReplaceText(DeclLoc, endBuf-startBuf, ReplaceText(DeclLoc, endBuf-startBuf,
ByrefType.c_str(), ByrefType.size()); ByrefType.c_str(), ByrefType.size());