summaryrefslogtreecommitdiff
path: root/lib/CodeGen
diff options
context:
space:
mode:
authorMichael J. Spencer <bigcheesegs@gmail.com>2010-10-21 00:08:21 +0000
committerMichael J. Spencer <bigcheesegs@gmail.com>2010-10-21 00:08:21 +0000
commitdd0a00a6e377b11c3c122e111da3d1f53f13756d (patch)
tree0d888f48e2d9559d2961a428dbfd6faa4b5373f0 /lib/CodeGen
parent2d8f6fe610fa859370c38cfbe38ff809a3a417de (diff)
downloadllvm-dd0a00a6e377b11c3c122e111da3d1f53f13756d.tar.gz
llvm-dd0a00a6e377b11c3c122e111da3d1f53f13756d.tar.bz2
llvm-dd0a00a6e377b11c3c122e111da3d1f53f13756d.tar.xz
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116978 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r--lib/CodeGen/MachineModuleInfo.cpp2
-rw-r--r--lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp10
2 files changed, 6 insertions, 6 deletions
diff --git a/lib/CodeGen/MachineModuleInfo.cpp b/lib/CodeGen/MachineModuleInfo.cpp
index 5c8b37315c..79622e8df3 100644
--- a/lib/CodeGen/MachineModuleInfo.cpp
+++ b/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/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
index a68b7b0f94..4be2525cfa 100644
--- a/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
+++ b/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;
}
}