[llvm-commits] [llvm] r98374 - in /llvm/trunk/lib/Target/X86: AsmPrinter/X86AsmPrinter.cpp AsmPrinter/X86MCInstLower.cpp X86COFFMachineModuleInfo.cpp X86COFFMachineModuleInfo.h
Chris Lattner
sabre at nondot.org
Fri Mar 12 11:48:03 PST 2010
Author: lattner
Date: Fri Mar 12 13:48:03 2010
New Revision: 98374
URL: http://llvm.org/viewvc/llvm-project?rev=98374&view=rev
Log:
minor tidying, only do work if a function is
actually X86_StdCall or X86_FastCall.
Modified:
llvm/trunk/lib/Target/X86/AsmPrinter/X86AsmPrinter.cpp
llvm/trunk/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp
llvm/trunk/lib/Target/X86/X86COFFMachineModuleInfo.cpp
llvm/trunk/lib/Target/X86/X86COFFMachineModuleInfo.h
Modified: llvm/trunk/lib/Target/X86/AsmPrinter/X86AsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/AsmPrinter/X86AsmPrinter.cpp?rev=98374&r1=98373&r2=98374&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/AsmPrinter/X86AsmPrinter.cpp (original)
+++ llvm/trunk/lib/Target/X86/AsmPrinter/X86AsmPrinter.cpp Fri Mar 12 13:48:03 2010
@@ -61,10 +61,8 @@
X86COFFMachineModuleInfo &COFFMMI =
MMI->getObjFileInfo<X86COFFMachineModuleInfo>();
- COFFMMI.DecorateCygMingName(Symb, OutContext, cast<Function>(GV),
- *TM.getTargetData());
-
- return Symb;
+ return COFFMMI.DecorateCygMingName(Symb, OutContext, cast<Function>(GV),
+ *TM.getTargetData());
}
/// runOnMachineFunction - Emit the function body.
Modified: llvm/trunk/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp?rev=98374&r1=98373&r2=98374&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp (original)
+++ llvm/trunk/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp Fri Mar 12 13:48:03 2010
@@ -65,8 +65,8 @@
MCSymbol *Sym = Mang->getSymbol(GV);
X86COFFMachineModuleInfo &COFFMMI =
AsmPrinter.MMI->getObjFileInfo<X86COFFMachineModuleInfo>();
- COFFMMI.DecorateCygMingName(Sym, Ctx, cast<Function>(GV),
- *AsmPrinter.TM.getTargetData());
+ Sym = COFFMMI.DecorateCygMingName(Sym, Ctx, cast<Function>(GV),
+ *AsmPrinter.TM.getTargetData());
Name.append(Sym->getName().begin(), Sym->getName().end());
} else {
const GlobalValue *GV = MO.getGlobal();
Modified: llvm/trunk/lib/Target/X86/X86COFFMachineModuleInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86COFFMachineModuleInfo.cpp?rev=98374&r1=98373&r2=98374&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86COFFMachineModuleInfo.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86COFFMachineModuleInfo.cpp Fri Mar 12 13:48:03 2010
@@ -28,16 +28,14 @@
/// DecorateCygMingName - Query FunctionInfoMap and use this information for
/// various name decorations for Cygwin and MingW.
-void X86COFFMachineModuleInfo::DecorateCygMingName(MCSymbol *&NameSym,
- MCContext &Ctx,
- const Function *F,
- const TargetData &TD) {
- SmallString<128> Name(NameSym->getName().begin(), NameSym->getName().end());
-
+MCSymbol *X86COFFMachineModuleInfo::DecorateCygMingName(MCSymbol *NameSym,
+ MCContext &Ctx,
+ const Function *F,
+ const TargetData &TD) {
// We don't want to decorate non-stdcall or non-fastcall functions right now
CallingConv::ID CC = F->getCallingConv();
if (CC != CallingConv::X86_StdCall && CC != CallingConv::X86_FastCall)
- return;
+ return NameSym;
unsigned ArgWords = 0;
@@ -55,6 +53,9 @@
}
const FunctionType *FT = F->getFunctionType();
+
+ SmallString<128> Name(NameSym->getName().begin(), NameSym->getName().end());
+
// "Pure" variadic functions do not receive @0 suffix.
if (!FT->isVarArg() || FT->getNumParams() == 0 ||
(FT->getNumParams() == 1 && F->hasStructRetAttr()))
@@ -67,5 +68,5 @@
Name.insert(Name.begin(), '@');
}
- NameSym = Ctx.GetOrCreateSymbol(Name.str());
+ return Ctx.GetOrCreateSymbol(Name.str());
}
Modified: llvm/trunk/lib/Target/X86/X86COFFMachineModuleInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86COFFMachineModuleInfo.h?rev=98374&r1=98373&r2=98374&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86COFFMachineModuleInfo.h (original)
+++ llvm/trunk/lib/Target/X86/X86COFFMachineModuleInfo.h Fri Mar 12 13:48:03 2010
@@ -30,8 +30,8 @@
X86COFFMachineModuleInfo(const MachineModuleInfo &) {}
virtual ~X86COFFMachineModuleInfo();
- void DecorateCygMingName(MCSymbol *&Name, MCContext &Ctx,
- const Function *F, const TargetData &TD);
+ MCSymbol *DecorateCygMingName(MCSymbol *Name, MCContext &Ctx,
+ const Function *F, const TargetData &TD);
void addExternalFunction(StringRef Name) {
CygMingStubs.insert(Name);
More information about the llvm-commits
mailing list