diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2009-12-30 20:38:08 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2009-12-30 20:38:08 +0000 |
commit | 92368a15f993936de684d5d25717220733708cf9 (patch) | |
tree | e32a4cc79d5af2790e428675675d67e87126dbde /clang/lib/Frontend/RewriteObjC.cpp | |
parent | 09660c9b069423f278189dc202441cae045f7c32 (diff) | |
download | bcm5719-llvm-92368a15f993936de684d5d25717220733708cf9.tar.gz bcm5719-llvm-92368a15f993936de684d5d25717220733708cf9.zip |
When rewriting a __block declaration, use a suitable API to get location of
the declaration in the presence of an initializer macro.
llvm-svn: 92312
Diffstat (limited to 'clang/lib/Frontend/RewriteObjC.cpp')
-rw-r--r-- | clang/lib/Frontend/RewriteObjC.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/Frontend/RewriteObjC.cpp b/clang/lib/Frontend/RewriteObjC.cpp index 3ef3a061193..c3474728a6e 100644 --- a/clang/lib/Frontend/RewriteObjC.cpp +++ b/clang/lib/Frontend/RewriteObjC.cpp @@ -4390,7 +4390,9 @@ void RewriteObjC::RewriteBlockPointerDecl(NamedDecl *ND) { void RewriteObjC::RewriteByRefVar(VarDecl *ND) { SourceLocation DeclLoc = ND->getTypeSpecStartLoc(); const char *startBuf = SM->getCharacterData(DeclLoc); - const char *endBuf = SM->getCharacterData(ND->getLocEnd()); + SourceLocation X = ND->getLocEnd(); + X = SM->getInstantiationLoc(X); + const char *endBuf = SM->getCharacterData(X); std::string Name(ND->getNameAsString()); std::string ByrefType = "struct __Block_byref_"; ByrefType += Name; |