]> granicus.if.org Git - clang/commitdiff
When rewriting a __block declaration, use a suitable API to get location of
authorFariborz Jahanian <fjahanian@apple.com>
Wed, 30 Dec 2009 20:38:08 +0000 (20:38 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Wed, 30 Dec 2009 20:38:08 +0000 (20:38 +0000)
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

lib/Frontend/RewriteObjC.cpp

index 3ef3a0611931bdabece1bdd1bdd4bf39b63bb4db..c3474728a6ed631924de1791bf05daec8b73cd91 100644 (file)
@@ -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;