[cfe-commits] r51812 - /cfe/trunk/Driver/RewriteObjC.cpp

Steve Naroff snaroff at apple.com
Fri May 30 22:02:17 PDT 2008


Author: snaroff
Date: Sat May 31 00:02:17 2008
New Revision: 51812

URL: http://llvm.org/viewvc/llvm-project?rev=51812&view=rev
Log:
Fix <rdar://problem/5969777> clang ObjC rewriter: #imported file name mysteriously commented out

This fix involved tightening up needToScanForQualifiers(), which predated ObjCQualifiedIdType.
It also includes a minor tweak to the code that searches for the beginning of the qualified type. If the AST contained the correct beginning of the declaration (i.e. the beginning of the declaration specifiers), this code would be more robust. Since it doesn't, we apply an adhoc heuristic. Note that DeclSpec contains this info...we just don't propagate it to the AST (at present).

Modified:
    cfe/trunk/Driver/RewriteObjC.cpp

Modified: cfe/trunk/Driver/RewriteObjC.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Driver/RewriteObjC.cpp?rev=51812&r1=51811&r2=51812&view=diff

==============================================================================
--- cfe/trunk/Driver/RewriteObjC.cpp (original)
+++ cfe/trunk/Driver/RewriteObjC.cpp Sat May 31 00:02:17 2008
@@ -1520,9 +1520,6 @@
 
 bool RewriteObjC::needToScanForQualifiers(QualType T) {
   
-  if (T == Context->getObjCIdType())
-    return true;
-    
   if (T->isObjCQualifiedIdType())
     return true;
   
@@ -1561,7 +1558,7 @@
     
     const char *endBuf = SM->getCharacterData(Loc);
     const char *startBuf = endBuf;
-    while (*startBuf != ';' && startBuf != MainFileStart)
+    while (*startBuf != ';' && *startBuf != '<' && startBuf != MainFileStart)
       startBuf--; // scan backward (from the decl location) for return type.
     const char *startRef = 0, *endRef = 0;
     if (scanForProtocolRefs(startBuf, endBuf, startRef, endRef)) {





More information about the cfe-commits mailing list