[prev in list] [next in list] [prev in thread] [next in thread] 

List:       cfe-commits
Subject:    [cfe-commits] r51812 - /cfe/trunk/Driver/RewriteObjC.cpp
From:       Steve Naroff <snaroff () apple ! com>
Date:       2008-05-31 5:02:17
Message-ID: 200805310502.m4V52I3A017734 () zion ! cs ! uiuc ! edu
[Download RAW message or body]

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)) {


_______________________________________________
cfe-commits mailing list
cfe-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic