llvm.org GIT mirror llvm / d15dff2
rename X86FunctionInfo to X86MachineFunctionInfo to match the header file it is defined in. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36196 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 13 years ago
7 changed file(s) with 23 addition(s) and 21 deletion(s). Raw diff Collapse all Expand all
9191 // Populate function information map. Actually, We don't want to populate
9292 // non-stdcall or non-fastcall functions' information right now.
9393 if (CC == CallingConv::X86_StdCall || CC == CallingConv::X86_FastCall)
94 FunctionInfoMap[F] = *MF.getInfoFunctionInfo>();
94 FunctionInfoMap[F] = *MF.getInfoMachineFunctionInfo>();
9595
9696 X86SharedAsmPrinter::decorateName(CurrentFnName, F);
9797
3131 #include "llvm/Target/TargetOptions.h"
3232 using namespace llvm;
3333
34 static X86FunctionInfo calculateFunctionInfo(const Function *F,
35 const TargetData *TD) {
36 X86FunctionInfo Info;
34 static X86MachineFunctionInfo calculateFunctionInfo(const Function *F,
35 const TargetData *TD) {
36 X86MachineFunctionInfo Info;
3737 uint64_t Size = 0;
3838
3939 switch (F->getCallingConv()) {
7676
7777 FMFInfoMap::const_iterator info_item = FunctionInfoMap.find(F);
7878
79 const X86FunctionInfo *Info;
79 const X86MachineFunctionInfo *Info;
8080 if (info_item == FunctionInfoMap.end()) {
8181 // Calculate apropriate function info and populate map
8282 FunctionInfoMap[F] = calculateFunctionInfo(F, TM.getTargetData());
4747 //
4848 // This structure is using e.g. for name decoration for stdcall & fastcall'ed
4949 // function, since we have to use arguments' size for decoration.
50 typedef std::mapFunctionInfo> FMFInfoMap;
50 typedef std::mapMachineFunctionInfo> FMFInfoMap;
5151 FMFInfoMap FunctionInfoMap;
5252
5353 void decorateName(std::string& Name, const GlobalValue* GV);
728728 RegSaveFrameIndex = 0xAAAAAAA; // X86-64 only.
729729 ReturnAddrIndex = 0; // No return address slot generated yet.
730730
731 MF.getInfoFunctionInfo>()->setBytesToPopOnReturn(BytesToPopOnReturn);
731 MF.getInfoMachineFunctionInfo>()
732 ->setBytesToPopOnReturn(BytesToPopOnReturn);
732733
733734 // Return the new list of results.
734735 return DAG.getNode(ISD::MERGE_VALUES, Op.Val->getVTList(),
972973 BytesToPopOnReturn = StackSize; // Callee pops all stack arguments.
973974 BytesCallerReserves = 0;
974975
975 MF.getInfoFunctionInfo>()->setBytesToPopOnReturn(BytesToPopOnReturn);
976 MF.getInfoMachineFunctionInfo>()
977 ->setBytesToPopOnReturn(BytesToPopOnReturn);
976978
977979 // Return the new list of results.
978980 return DAG.getNode(ISD::MERGE_VALUES, Op.Val->getVTList(),
34403442 if (Fn->hasExternalLinkage() &&
34413443 Subtarget->isTargetCygMing() &&
34423444 Fn->getName() == "main")
3443 MF.getInfoFunctionInfo>()->setForceFramePointer(true);
3445 MF.getInfoMachineFunctionInfo>()->setForceFramePointer(true);
34443446
34453447 unsigned CC = cast(Op.getOperand(1))->getValue();
34463448 if (Subtarget->is64Bit())
34563458 case CallingConv::C:
34573459 return LowerCCCArguments(Op, DAG);
34583460 case CallingConv::X86_StdCall:
3459 MF.getInfoFunctionInfo>()->setDecorationStyle(StdCall);
3461 MF.getInfoMachineFunctionInfo>()->setDecorationStyle(StdCall);
34603462 return LowerCCCArguments(Op, DAG, true);
34613463 case CallingConv::X86_FastCall:
3462 MF.getInfoFunctionInfo>()->setDecorationStyle(FastCall);
3464 MF.getInfoMachineFunctionInfo>()->setDecorationStyle(FastCall);
34633465 return LowerFastCCArguments(Op, DAG);
34643466 }
34653467 }
5050 // Populate function information map. Actually, We don't want to populate
5151 // non-stdcall or non-fastcall functions' information right now.
5252 if (CC == CallingConv::X86_StdCall || CC == CallingConv::X86_FastCall)
53 FunctionInfoMap[F] = *MF.getInfoFunctionInfo>();
53 FunctionInfoMap[F] = *MF.getInfoMachineFunctionInfo>();
5454
5555 X86SharedAsmPrinter::decorateName(CurrentFnName, F);
5656
2323 FastCall
2424 };
2525
26 /// X86FunctionInfo - This class is derived from MachineFunction private
26 /// X86MachineFunctionInfo - This class is derived from MachineFunction private
2727 /// X86 target-specific information for each MachineFunction.
28 class X86FunctionInfo : public MachineFunctionInfo {
28 class X86MachineFunctionInfo : public MachineFunctionInfo {
2929 /// ForceFramePointer - True if the function is required to use of frame
3030 /// pointer for reasons other than it containing dynamic allocation or
3131 /// that FP eliminatation is turned off. For example, Cygwin main function
4141 NameDecorationStyle DecorationStyle;
4242
4343 public:
44 X86FunctionInfo() : ForceFramePointer(false),
45 BytesToPopOnReturn(0),
46 DecorationStyle(None) {}
44 X86MachineFunctionInfo() : ForceFramePointer(false),
45 BytesToPopOnReturn(0),
46 DecorationStyle(None) {}
4747
48 X86FunctionInfo(MachineFunction &MF) : ForceFramePointer(false),
49 BytesToPopOnReturn(0),
50 DecorationStyle(None) {}
48 X86MachineFunctionInfo(MachineFunction &MF) : ForceFramePointer(false),
49 BytesToPopOnReturn(0),
50 DecorationStyle(None) {}
5151
5252 bool getForceFramePointer() const { return ForceFramePointer;}
5353 void setForceFramePointer(bool forceFP) { ForceFramePointer = forceFP; }
926926 bool X86RegisterInfo::hasFP(const MachineFunction &MF) const {
927927 return (NoFramePointerElim ||
928928 MF.getFrameInfo()->hasVarSizedObjects() ||
929 MF.getInfoFunctionInfo>()->getForceFramePointer());
929 MF.getInfoMachineFunctionInfo>()->getForceFramePointer());
930930 }
931931
932932 void X86RegisterInfo::