summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-01-14 00:06:14 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-01-14 00:06:14 +0000
commite725ff12638d9370ef09daf2bc5d7d06e1694c9d (patch)
treee882b0c7a48bded6b54b9e459a368de84a71f114
parent3c82aa0209071d2e3bb0ce9df1fc90ef5c56575f (diff)
downloadbcm5719-llvm-e725ff12638d9370ef09daf2bc5d7d06e1694c9d.tar.gz
bcm5719-llvm-e725ff12638d9370ef09daf2bc5d7d06e1694c9d.zip
ccc: Darwin/Compile: Define __private_extern__ when building c++.
llvm-svn: 62200
-rw-r--r--clang/tools/ccc/ccclib/Tools.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/clang/tools/ccc/ccclib/Tools.py b/clang/tools/ccc/ccclib/Tools.py
index 1b8db335973..bc10081dc10 100644
--- a/clang/tools/ccc/ccclib/Tools.py
+++ b/clang/tools/ccc/ccclib/Tools.py
@@ -241,6 +241,7 @@ class Darwin_X86_CompileTool(Tool):
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 @@ class Darwin_X86_CompileTool(Tool):
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 @@ class Darwin_X86_CompileTool(Tool):
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 @@ class Darwin_X86_CompileTool(Tool):
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 @@ class Darwin_X86_CompileTool(Tool):
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)
OpenPOWER on IntegriCloud