[cfe-commits] r39006 - in /cfe/cfe/trunk: Driver/clang.cpp include/clang/Lex/Preprocessor.h

sabre at cs.uiuc.edu sabre at cs.uiuc.edu
Wed Jul 11 09:26:45 PDT 2007


Author: sabre
Date: Wed Jul 11 11:26:45 2007
New Revision: 39006

URL: http://llvm.org/viewvc/llvm-project?rev=39006&view=rev
Log:
track whether DirectoryLookup dirs are framework dirs.

Modified:
    cfe/cfe/trunk/Driver/clang.cpp
    cfe/cfe/trunk/include/clang/Lex/Preprocessor.h

Modified: cfe/cfe/trunk/Driver/clang.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/Driver/clang.cpp?rev=39006&r1=39005&r2=39006&view=diff

==============================================================================
--- cfe/cfe/trunk/Driver/clang.cpp (original)
+++ cfe/cfe/trunk/Driver/clang.cpp Wed Jul 11 11:26:45 2007
@@ -598,7 +598,7 @@
 ///
 static void AddPath(const std::string &Path, IncludeDirGroup Group,
                     bool isCXXAware, bool isUserSupplied,
-                    FileManager &FM) {
+                    bool isFramework, FileManager &FM) {
   const DirectoryEntry *DE = FM.getDirectory(Path);
   if (DE == 0) {
     if (Verbose)
@@ -614,7 +614,8 @@
   else
     Type = DirectoryLookup::ExternCSystemHeaderDir;
   
-  IncludeGroup[Group].push_back(DirectoryLookup(DE, Type, isUserSupplied));
+  IncludeGroup[Group].push_back(DirectoryLookup(DE, Type, isUserSupplied,
+                                                isFramework));
 }
 
 /// RemoveDuplicates - If there are duplicate directory entries in the specified
@@ -644,21 +645,21 @@
       PP.getDiagnostics().Report(SourceLocation(),
                                  diag::err_pp_I_dash_not_supported);
     } else {
-      AddPath(I_dirs[i], Angled, false, true, FM);
+      AddPath(I_dirs[i], Angled, false, true, false, FM);
     }
   }
   
   // Handle -idirafter... options.
   for (unsigned i = 0, e = idirafter_dirs.size(); i != e; ++i)
-    AddPath(idirafter_dirs[i], After, false, true, FM);
+    AddPath(idirafter_dirs[i], After, false, true, false, FM);
   
   // Handle -iquote... options.
   for (unsigned i = 0, e = iquote_dirs.size(); i != e; ++i)
-    AddPath(iquote_dirs[i], Quoted, false, true, FM);
+    AddPath(iquote_dirs[i], Quoted, false, true, false, FM);
   
   // Handle -isystem... options.
   for (unsigned i = 0, e = isystem_dirs.size(); i != e; ++i)
-    AddPath(isystem_dirs[i], System, false, true, FM);
+    AddPath(isystem_dirs[i], System, false, true, false, FM);
 
   // Walk the -iprefix/-iwithprefix/-iwithprefixbefore argument lists in
   // parallel, processing the values in order of occurance to get the right
@@ -687,12 +688,12 @@
                   iwithprefix_vals.getPosition(iwithprefix_idx) < 
                   iwithprefixbefore_vals.getPosition(iwithprefixbefore_idx))) {
         AddPath(Prefix+iwithprefix_vals[iwithprefix_idx], 
-                System, false, false, FM);
+                System, false, false, false, FM);
         ++iwithprefix_idx;
         iwithprefix_done = iwithprefix_idx == iwithprefix_vals.size();
       } else {
         AddPath(Prefix+iwithprefixbefore_vals[iwithprefixbefore_idx], 
-                Angled, false, false, FM);
+                Angled, false, false, false, FM);
         ++iwithprefixbefore_idx;
         iwithprefixbefore_done = 
           iwithprefixbefore_idx == iwithprefixbefore_vals.size();
@@ -704,16 +705,17 @@
   // OBJC_INCLUDE_PATH, OBJCPLUS_INCLUDE_PATH environment variables.
   
   // FIXME: temporary hack: hard-coded paths.
+  // FIXME: get these from the target?
   if (!nostdinc) {
-    AddPath("/usr/local/include", System, false, false, FM);
+    AddPath("/usr/local/include", System, false, false, false, FM);
     AddPath("/usr/lib/gcc/powerpc-apple-darwin8/4.0.1/include", 
-            System, false, false, FM);
+            System, false, false, false, FM);
     AddPath("/usr/lib/gcc/powerpc-apple-darwin8/"
             "4.0.1/../../../../powerpc-apple-darwin8/include", 
-            System, false, false, FM);
-    AddPath("/usr/include", System, false, false, FM);
-    AddPath("/System/Library/Frameworks", System, false, false, FM);
-    AddPath("/Library/Frameworks", System, false, false, FM);
+            System, false, false, false, FM);
+    AddPath("/usr/include", System, false, false, false, FM);
+    AddPath("/System/Library/Frameworks", System, true, false, true, FM);
+    AddPath("/Library/Frameworks", System, true, false, true, FM);
   }
 
   // Now that we have collected all of the include paths, merge them all

Modified: cfe/cfe/trunk/include/clang/Lex/Preprocessor.h
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/include/clang/Lex/Preprocessor.h?rev=39006&r1=39005&r2=39006&view=diff

==============================================================================
--- cfe/cfe/trunk/include/clang/Lex/Preprocessor.h (original)
+++ cfe/cfe/trunk/include/clang/Lex/Preprocessor.h Wed Jul 11 11:26:45 2007
@@ -51,10 +51,16 @@
   
   /// UserSupplied - True if this is a user-supplied directory.
   ///
-  bool UserSupplied;
+  bool UserSupplied : 1;
+  
+  /// Framework - True if this is a framework directory search-path.
+  ///
+  bool Framework : 1;
 public:
-  DirectoryLookup(const DirectoryEntry *dir, DirType DT, bool isUser)
-    : Dir(dir), DirCharacteristic(DT), UserSupplied(isUser) {}
+  DirectoryLookup(const DirectoryEntry *dir, DirType DT, bool isUser,
+                  bool isFramework)
+    : Dir(dir), DirCharacteristic(DT), UserSupplied(isUser),
+      Framework(isFramework) {}
     
   /// getDir - Return the directory that this entry refers to.
   ///
@@ -67,6 +73,10 @@
   /// isUserSupplied - True if this is a user-supplied directory.
   ///
   bool isUserSupplied() const { return UserSupplied; }
+  
+  /// isFramework - True if this is a framework directory.
+  ///
+  bool isFramework() const { return Framework; }
 };
 
 /// Preprocessor - This object forms engages in a tight little dance to





More information about the cfe-commits mailing list