diff options
author | Dan Gohman <gohman@apple.com> | 2008-06-30 20:31:15 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2008-06-30 20:31:15 +0000 |
commit | a44b674a42b6ca57128c4eb5a358298ed3bb1406 (patch) | |
tree | 4cf3c3d8bfd809eae590b2391736bae3f16a8d1f /lib/Target | |
parent | c60276982225a6add69e823f1df854a59f1d0dad (diff) | |
download | external_llvm-a44b674a42b6ca57128c4eb5a358298ed3bb1406.zip external_llvm-a44b674a42b6ca57128c4eb5a358298ed3bb1406.tar.gz external_llvm-a44b674a42b6ca57128c4eb5a358298ed3bb1406.tar.bz2 |
Replace some std::vectors that showed up in heap profiling with
SmallVectors. Change the signature of TargetLowering::LowerArguments
to avoid returning a vector by value, and update the two targets
which still use this directly, Sparc and IA64, accordingly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52917 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target')
-rw-r--r-- | lib/Target/IA64/IA64ISelLowering.cpp | 7 | ||||
-rw-r--r-- | lib/Target/IA64/IA64ISelLowering.h | 4 | ||||
-rw-r--r-- | lib/Target/Sparc/SparcISelLowering.cpp | 8 | ||||
-rw-r--r-- | lib/Target/Sparc/SparcISelLowering.h | 4 |
4 files changed, 9 insertions, 14 deletions
diff --git a/lib/Target/IA64/IA64ISelLowering.cpp b/lib/Target/IA64/IA64ISelLowering.cpp index 8b711d8..710cd0c 100644 --- a/lib/Target/IA64/IA64ISelLowering.cpp +++ b/lib/Target/IA64/IA64ISelLowering.cpp @@ -143,9 +143,8 @@ MVT IA64TargetLowering::getSetCCResultType(const SDOperand &) const { return MVT::i1; } -std::vector<SDOperand> -IA64TargetLowering::LowerArguments(Function &F, SelectionDAG &DAG) { - std::vector<SDOperand> ArgValues; +void IA64TargetLowering::LowerArguments(Function &F, SelectionDAG &DAG, + SmallVectorImpl<SDOperand> &ArgValues) { // // add beautiful description of IA64 stack frame format // here (from intel 24535803.pdf most likely) @@ -300,8 +299,6 @@ IA64TargetLowering::LowerArguments(Function &F, SelectionDAG &DAG) { MF.getRegInfo().addLiveOut(IA64::F8); break; } - - return ArgValues; } std::pair<SDOperand, SDOperand> diff --git a/lib/Target/IA64/IA64ISelLowering.h b/lib/Target/IA64/IA64ISelLowering.h index b26c822..54f6c2e 100644 --- a/lib/Target/IA64/IA64ISelLowering.h +++ b/lib/Target/IA64/IA64ISelLowering.h @@ -53,8 +53,8 @@ namespace llvm { /// LowerArguments - This hook must be implemented to indicate how we should /// lower the arguments for the specified function, into the specified DAG. - virtual std::vector<SDOperand> - LowerArguments(Function &F, SelectionDAG &DAG); + virtual void LowerArguments(Function &F, SelectionDAG &DAG, + SmallVectorImpl<SDOperand> &ArgValues); /// LowerCallTo - This hook lowers an abstract call to a function into an /// actual call. diff --git a/lib/Target/Sparc/SparcISelLowering.cpp b/lib/Target/Sparc/SparcISelLowering.cpp index 48b4fec..fd60296 100644 --- a/lib/Target/Sparc/SparcISelLowering.cpp +++ b/lib/Target/Sparc/SparcISelLowering.cpp @@ -74,11 +74,11 @@ static SDOperand LowerRET(SDOperand Op, SelectionDAG &DAG) { /// LowerArguments - V8 uses a very simple ABI, where all values are passed in /// either one or two GPRs, including FP values. TODO: we should pass FP values /// in FP registers for fastcc functions. -std::vector<SDOperand> -SparcTargetLowering::LowerArguments(Function &F, SelectionDAG &DAG) { +void +SparcTargetLowering::LowerArguments(Function &F, SelectionDAG &DAG, + SmallVectorImpl<SDOperand> &ArgValues) { MachineFunction &MF = DAG.getMachineFunction(); MachineRegisterInfo &RegInfo = MF.getRegInfo(); - std::vector<SDOperand> ArgValues; static const unsigned ArgRegs[] = { SP::I0, SP::I1, SP::I2, SP::I3, SP::I4, SP::I5 @@ -221,8 +221,6 @@ SparcTargetLowering::LowerArguments(Function &F, SelectionDAG &DAG) { if (!OutChains.empty()) DAG.setRoot(DAG.getNode(ISD::TokenFactor, MVT::Other, &OutChains[0], OutChains.size())); - - return ArgValues; } static SDOperand LowerCALL(SDOperand Op, SelectionDAG &DAG) { diff --git a/lib/Target/Sparc/SparcISelLowering.h b/lib/Target/Sparc/SparcISelLowering.h index 023ea93..2257304 100644 --- a/lib/Target/Sparc/SparcISelLowering.h +++ b/lib/Target/Sparc/SparcISelLowering.h @@ -57,8 +57,8 @@ namespace llvm { const SelectionDAG &DAG, unsigned Depth = 0) const; - virtual std::vector<SDOperand> - LowerArguments(Function &F, SelectionDAG &DAG); + virtual void LowerArguments(Function &F, SelectionDAG &DAG, + SmallVectorImpl<SDOperand> &ArgValues); virtual MachineBasicBlock *EmitInstrWithCustomInserter(MachineInstr *MI, MachineBasicBlock *MBB); |