diff options
| author | Michael J. Spencer <bigcheesegs@gmail.com> | 2010-10-21 00:08:21 +0000 |
|---|---|---|
| committer | Michael J. Spencer <bigcheesegs@gmail.com> | 2010-10-21 00:08:21 +0000 |
| commit | 83ce5f181f9fdd0633b698e31958d35b3583b332 (patch) | |
| tree | c8557795b523571d159b6686b02aa3a5f3d1f0f6 /llvm/lib | |
| parent | 4ac3ed02197d5991c775407932237d616f17bb5e (diff) | |
| download | bcm5719-llvm-83ce5f181f9fdd0633b698e31958d35b3583b332.tar.gz bcm5719-llvm-83ce5f181f9fdd0633b698e31958d35b3583b332.zip | |
CodeGen-Windows: Only emit _fltused if a VarArg function is called with floating point args.
This should be the minimum set of functions that could possibly need it.
llvm-svn: 116978
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/CodeGen/MachineModuleInfo.cpp | 2 | ||||
| -rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp | 10 | ||||
| -rw-r--r-- | llvm/lib/Target/X86/X86AsmPrinter.cpp | 2 |
3 files changed, 7 insertions, 7 deletions
diff --git a/llvm/lib/CodeGen/MachineModuleInfo.cpp b/llvm/lib/CodeGen/MachineModuleInfo.cpp index 5c8b37315cd..79622e8df3e 100644 --- a/llvm/lib/CodeGen/MachineModuleInfo.cpp +++ b/llvm/lib/CodeGen/MachineModuleInfo.cpp @@ -257,7 +257,7 @@ MachineModuleInfo::MachineModuleInfo(const MCAsmInfo &MAI) : ImmutablePass(ID), Context(MAI), ObjFileMMI(0), CurCallSite(0), CallsEHReturn(0), CallsUnwindInit(0), DbgInfoAvailable(false), - CallsExternalFunctionWithFloatingPointArguments(false) { + CallsExternalVAFunctionWithFloatingPointArguments(false) { initializeMachineModuleInfoPass(*PassRegistry::getPassRegistry()); // Always emit some info, by default "no personality" info. Personalities.push_back(NULL); diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp index a68b7b0f947..4be2525cfa1 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp @@ -5030,16 +5030,16 @@ void SelectionDAGBuilder::visitCall(const CallInst &I) { // See if any floating point values are being passed to this external // function. This is used to emit an undefined reference to fltused on // Windows. - if (!F->hasLocalLinkage() && F->hasName()) { - MachineModuleInfo &MMI = DAG.getMachineFunction().getMMI(); - for (unsigned i = 0, e = I.getNumArgOperands(); i != e && - !MMI.callsExternalFunctionWithFloatingPointArguments(); ++i) { + MachineModuleInfo &MMI = DAG.getMachineFunction().getMMI(); + if (F->isVarArg() && + !MMI.callsExternalVAFunctionWithFloatingPointArguments()) { + for (unsigned i = 0, e = I.getNumArgOperands(); i != e; ++i) { const Type* T = I.getArgOperand(i)->getType(); for (po_iterator<const Type*> i = po_begin(T), e = po_end(T); i != e; ++i) { if (i->isFloatingPointTy()) { - MMI.setCallsExternalFunctionWithFloatingPointArguments(true); + MMI.setCallsExternalVAFunctionWithFloatingPointArguments(true); break; } } diff --git a/llvm/lib/Target/X86/X86AsmPrinter.cpp b/llvm/lib/Target/X86/X86AsmPrinter.cpp index c4fd7298b57..f7cb9e71f67 100644 --- a/llvm/lib/Target/X86/X86AsmPrinter.cpp +++ b/llvm/lib/Target/X86/X86AsmPrinter.cpp @@ -582,7 +582,7 @@ void X86AsmPrinter::EmitEndOfAsmFile(Module &M) { if (Subtarget->isTargetWindows() && !Subtarget->isTargetCygMing() - && MMI->callsExternalFunctionWithFloatingPointArguments()) { + && MMI->callsExternalVAFunctionWithFloatingPointArguments()) { MCSymbol *S = MMI->getContext().GetOrCreateSymbol(StringRef("__fltused")); OutStreamer.EmitSymbolAttribute(S, MCSA_Global); } |

