ccc: Darwin/Compile: Define __private_extern__ when building c++.
llvm-svn: 62200
This commit is contained in:
parent
3c82aa0209
commit
e725ff1263
|
|
@ -241,6 +241,7 @@ class Darwin_X86_CompileTool(Tool):
|
||||||
assert not [i for i in inputs if i.type != inputType]
|
assert not [i for i in inputs if i.type != inputType]
|
||||||
|
|
||||||
usePP = False
|
usePP = False
|
||||||
|
isCXX = False
|
||||||
if inputType is Types.CType:
|
if inputType is Types.CType:
|
||||||
cc1Name = 'cc1'
|
cc1Name = 'cc1'
|
||||||
usePP = True
|
usePP = True
|
||||||
|
|
@ -256,15 +257,19 @@ class Darwin_X86_CompileTool(Tool):
|
||||||
elif inputType is Types.CXXType:
|
elif inputType is Types.CXXType:
|
||||||
cc1Name = 'cc1plus'
|
cc1Name = 'cc1plus'
|
||||||
usePP = True
|
usePP = True
|
||||||
|
isCXX = True
|
||||||
elif inputType is Types.CXXTypeNoPP:
|
elif inputType is Types.CXXTypeNoPP:
|
||||||
cc1Name = 'cc1plus'
|
cc1Name = 'cc1plus'
|
||||||
usePP = False
|
usePP = False
|
||||||
|
isCXX = True
|
||||||
elif inputType is Types.ObjCXXType:
|
elif inputType is Types.ObjCXXType:
|
||||||
cc1Name = 'cc1objplus'
|
cc1Name = 'cc1objplus'
|
||||||
usePP = True
|
usePP = True
|
||||||
|
isCXX = True
|
||||||
elif inputType is Types.ObjCXXTypeNoPP:
|
elif inputType is Types.ObjCXXTypeNoPP:
|
||||||
cc1Name = 'cc1objplus'
|
cc1Name = 'cc1objplus'
|
||||||
usePP = False
|
usePP = False
|
||||||
|
isCXX = True
|
||||||
else:
|
else:
|
||||||
raise RuntimeError,"Unexpected input type for Darwin compile tool."
|
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"
|
raise ValueError,"-traditional is not supported without -E"
|
||||||
|
|
||||||
if usePP:
|
if usePP:
|
||||||
|
# Derived from cpp_options.
|
||||||
|
|
||||||
# Derived from cpp_unique_options.
|
# Derived from cpp_unique_options.
|
||||||
|
|
||||||
if (arglist.getLastArg(arglist.parser.COption) or
|
if (arglist.getLastArg(arglist.parser.COption) or
|
||||||
|
|
@ -360,6 +367,7 @@ class Darwin_X86_CompileTool(Tool):
|
||||||
cmd_args.append('-D_MUDFLAPTH')
|
cmd_args.append('-D_MUDFLAPTH')
|
||||||
cmd_args.append('-include')
|
cmd_args.append('-include')
|
||||||
cmd_args.append('mf-runtime.h')
|
cmd_args.append('mf-runtime.h')
|
||||||
|
|
||||||
else:
|
else:
|
||||||
cmd_args.append('-fpreprocessed')
|
cmd_args.append('-fpreprocessed')
|
||||||
# FIXME: There is a spec command to remove
|
# 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('-fprofile-arcs')
|
||||||
cmd_args.append('-ftest-coverage')
|
cmd_args.append('-ftest-coverage')
|
||||||
|
|
||||||
|
if isCXX:
|
||||||
|
cmd_args.append('-D__private_extern__=extern')
|
||||||
|
|
||||||
if outputAtEnd:
|
if outputAtEnd:
|
||||||
cmd_args.extend(output_args)
|
cmd_args.extend(output_args)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue