aboutsummaryrefslogtreecommitdiff
path: root/lib/Frontend/RewriteObjC.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2009-12-30 20:38:08 +0000
committerFariborz Jahanian <fjahanian@apple.com>2009-12-30 20:38:08 +0000
commit6f0a0a9d2068c2ee9f399c72bf550c307bb76f9a (patch)
tree165a607c7e1576537dae0eec9982e5537ec9a7ec /lib/Frontend/RewriteObjC.cpp
parent6b401c0e7f663e83e82fdba8660d5d65a8631138 (diff)
When rewriting a __block declaration, use a suitable API to get location of
the declaration in the presence of an initializer macro. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92312 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/RewriteObjC.cpp')
-rw-r--r--lib/Frontend/RewriteObjC.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/Frontend/RewriteObjC.cpp b/lib/Frontend/RewriteObjC.cpp
index 3ef3a06119..c3474728a6 100644
--- a/lib/Frontend/RewriteObjC.cpp
+++ b/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;