[cfe-commits] r92312 - /cfe/trunk/lib/Frontend/RewriteObjC.cpp
Fariborz Jahanian
fjahanian at apple.com
Wed Dec 30 12:38:08 PST 2009
Author: fjahanian
Date: Wed Dec 30 14:38:08 2009
New Revision: 92312
URL: http://llvm.org/viewvc/llvm-project?rev=92312&view=rev
Log:
When rewriting a __block declaration, use a suitable API to get location of
the declaration in the presence of an initializer macro.
Modified:
cfe/trunk/lib/Frontend/RewriteObjC.cpp
Modified: cfe/trunk/lib/Frontend/RewriteObjC.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/RewriteObjC.cpp?rev=92312&r1=92311&r2=92312&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/RewriteObjC.cpp (original)
+++ cfe/trunk/lib/Frontend/RewriteObjC.cpp Wed Dec 30 14:38:08 2009
@@ -4390,7 +4390,9 @@
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;
More information about the cfe-commits
mailing list