[cfe-commits] r62200 - /cfe/trunk/tools/ccc/ccclib/Tools.py

Daniel Dunbar daniel at zuster.org
Tue Jan 13 16:06:14 PST 2009


Author: ddunbar
Date: Tue Jan 13 18:06:14 2009
New Revision: 62200

URL: http://llvm.org/viewvc/llvm-project?rev=62200&view=rev
Log:
ccc: Darwin/Compile: Define __private_extern__ when building c++.

Modified:
    cfe/trunk/tools/ccc/ccclib/Tools.py

Modified: cfe/trunk/tools/ccc/ccclib/Tools.py
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/ccc/ccclib/Tools.py?rev=62200&r1=62199&r2=62200&view=diff

==============================================================================
--- cfe/trunk/tools/ccc/ccclib/Tools.py (original)
+++ cfe/trunk/tools/ccc/ccclib/Tools.py Tue Jan 13 18:06:14 2009
@@ -241,6 +241,7 @@
         assert not [i for i in inputs if i.type != inputType]
 
         usePP = False
+        isCXX = False
         if inputType is Types.CType:
             cc1Name = 'cc1'
             usePP = True
@@ -256,15 +257,19 @@
         elif inputType is Types.CXXType:
             cc1Name = 'cc1plus'
             usePP = True
+            isCXX = True
         elif inputType is Types.CXXTypeNoPP:
             cc1Name = 'cc1plus'
             usePP = False
+            isCXX = True
         elif inputType is Types.ObjCXXType:
             cc1Name = 'cc1objplus'
             usePP = True
+            isCXX = True
         elif inputType is Types.ObjCXXTypeNoPP:
             cc1Name = 'cc1objplus'
             usePP = False
+            isCXX = True
         else:
             raise RuntimeError,"Unexpected input type for Darwin compile tool."
 
@@ -274,6 +279,8 @@
             raise ValueError,"-traditional is not supported without -E"
 
         if usePP:
+            # Derived from cpp_options.
+
             # Derived from cpp_unique_options.
 
             if (arglist.getLastArg(arglist.parser.COption) or
@@ -360,6 +367,7 @@
                 cmd_args.append('-D_MUDFLAPTH')
                 cmd_args.append('-include')
                 cmd_args.append('mf-runtime.h')
+            
         else:
             cmd_args.append('-fpreprocessed')
             # FIXME: There is a spec command to remove
@@ -461,6 +469,9 @@
             cmd_args.append('-fprofile-arcs')
             cmd_args.append('-ftest-coverage')
 
+        if isCXX:
+            cmd_args.append('-D__private_extern__=extern')
+
         if outputAtEnd:
             cmd_args.extend(output_args)
 





More information about the cfe-commits mailing list