diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2014-02-09 14:50:44 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2014-02-09 14:50:44 +0000 |
commit | 15b26696afe37e40adad3a9806ee11886b3ea349 (patch) | |
tree | f41f077e446cf9a9c4e09b64093092d0a156ce8e /llvm/lib/Target | |
parent | 9aff95c940394f5f3004150081454a6098838e18 (diff) | |
download | bcm5719-llvm-15b26696afe37e40adad3a9806ee11886b3ea349.tar.gz bcm5719-llvm-15b26696afe37e40adad3a9806ee11886b3ea349.zip |
Use a consistent argument order in TargetLoweringObjectFile.
These methods normally call each other and it is really annoying if the
arguments are in different order. The more common rule was that the arguments
specific to call are first (GV, Encoding, Suffix) and the auxiliary objects
(Mang, TM) come after. This patch changes the exceptions.
llvm-svn: 201044
Diffstat (limited to 'llvm/lib/Target')
-rw-r--r-- | llvm/lib/Target/ARM/ARMTargetObjectFile.cpp | 9 | ||||
-rw-r--r-- | llvm/lib/Target/ARM/ARMTargetObjectFile.h | 4 | ||||
-rw-r--r-- | llvm/lib/Target/Sparc/SparcTargetObjectFile.cpp | 16 | ||||
-rw-r--r-- | llvm/lib/Target/Sparc/SparcTargetObjectFile.h | 4 | ||||
-rw-r--r-- | llvm/lib/Target/TargetLoweringObjectFile.cpp | 17 | ||||
-rw-r--r-- | llvm/lib/Target/X86/X86TargetObjectFile.cpp | 17 | ||||
-rw-r--r-- | llvm/lib/Target/X86/X86TargetObjectFile.h | 4 |
7 files changed, 33 insertions, 38 deletions
diff --git a/llvm/lib/Target/ARM/ARMTargetObjectFile.cpp b/llvm/lib/Target/ARM/ARMTargetObjectFile.cpp index 9ada6a8c209..f9d71acf116 100644 --- a/llvm/lib/Target/ARM/ARMTargetObjectFile.cpp +++ b/llvm/lib/Target/ARM/ARMTargetObjectFile.cpp @@ -41,13 +41,12 @@ void ARMElfTargetObjectFile::Initialize(MCContext &Ctx, SectionKind::getMetadata()); } -const MCExpr *ARMElfTargetObjectFile:: -getTTypeGlobalReference(const GlobalValue *GV, Mangler &Mang, - MachineModuleInfo *MMI, unsigned Encoding, - MCStreamer &Streamer) const { +const MCExpr *ARMElfTargetObjectFile::getTTypeGlobalReference( + const GlobalValue *GV, unsigned Encoding, Mangler &Mang, + MachineModuleInfo *MMI, MCStreamer &Streamer) const { assert(Encoding == DW_EH_PE_absptr && "Can handle absptr encoding only"); - return MCSymbolRefExpr::Create(getSymbol(Mang, GV), + return MCSymbolRefExpr::Create(getSymbol(GV, Mang), MCSymbolRefExpr::VK_ARM_TARGET2, getContext()); } diff --git a/llvm/lib/Target/ARM/ARMTargetObjectFile.h b/llvm/lib/Target/ARM/ARMTargetObjectFile.h index 9ee1324e683..c703f2fafa3 100644 --- a/llvm/lib/Target/ARM/ARMTargetObjectFile.h +++ b/llvm/lib/Target/ARM/ARMTargetObjectFile.h @@ -28,9 +28,9 @@ public: void Initialize(MCContext &Ctx, const TargetMachine &TM) LLVM_OVERRIDE; - const MCExpr *getTTypeGlobalReference(const GlobalValue *GV, Mangler &Mang, + const MCExpr *getTTypeGlobalReference(const GlobalValue *GV, + unsigned Encoding, Mangler &Mang, MachineModuleInfo *MMI, - unsigned Encoding, MCStreamer &Streamer) const LLVM_OVERRIDE; diff --git a/llvm/lib/Target/Sparc/SparcTargetObjectFile.cpp b/llvm/lib/Target/Sparc/SparcTargetObjectFile.cpp index f7cefd0b635..11cc41f8c62 100644 --- a/llvm/lib/Target/Sparc/SparcTargetObjectFile.cpp +++ b/llvm/lib/Target/Sparc/SparcTargetObjectFile.cpp @@ -14,22 +14,20 @@ using namespace llvm; - -const MCExpr *SparcELFTargetObjectFile:: -getTTypeGlobalReference(const GlobalValue *GV, Mangler &Mang, - MachineModuleInfo *MMI, unsigned Encoding, - MCStreamer &Streamer) const { +const MCExpr *SparcELFTargetObjectFile::getTTypeGlobalReference( + const GlobalValue *GV, unsigned Encoding, Mangler &Mang, + MachineModuleInfo *MMI, MCStreamer &Streamer) const { if (Encoding & dwarf::DW_EH_PE_pcrel) { MachineModuleInfoELF &ELFMMI = MMI->getObjFileInfo<MachineModuleInfoELF>(); - MCSymbol *SSym = getSymbolWithGlobalValueBase(Mang, GV, ".DW.stub"); + MCSymbol *SSym = getSymbolWithGlobalValueBase(GV, ".DW.stub", Mang); // Add information about the stub reference to ELFMMI so that the stub // gets emitted by the asmprinter. MachineModuleInfoImpl::StubValueTy &StubSym = ELFMMI.getGVStubEntry(SSym); if (StubSym.getPointer() == 0) { - MCSymbol *Sym = getSymbol(Mang, GV); + MCSymbol *Sym = getSymbol(GV, Mang); StubSym = MachineModuleInfoImpl::StubValueTy(Sym, !GV->hasLocalLinkage()); } @@ -38,6 +36,6 @@ getTTypeGlobalReference(const GlobalValue *GV, Mangler &Mang, MCSymbolRefExpr::Create(SSym, Ctx), Ctx); } - return TargetLoweringObjectFileELF:: - getTTypeGlobalReference(GV, Mang, MMI, Encoding, Streamer); + return TargetLoweringObjectFileELF::getTTypeGlobalReference( + GV, Encoding, Mang, MMI, Streamer); } diff --git a/llvm/lib/Target/Sparc/SparcTargetObjectFile.h b/llvm/lib/Target/Sparc/SparcTargetObjectFile.h index fb97bdac8e9..933d758f76d 100644 --- a/llvm/lib/Target/Sparc/SparcTargetObjectFile.h +++ b/llvm/lib/Target/Sparc/SparcTargetObjectFile.h @@ -23,9 +23,9 @@ public: TargetLoweringObjectFileELF() {} - const MCExpr *getTTypeGlobalReference(const GlobalValue *GV, Mangler &Mang, + const MCExpr *getTTypeGlobalReference(const GlobalValue *GV, + unsigned Encoding, Mangler &Mang, MachineModuleInfo *MMI, - unsigned Encoding, MCStreamer &Streamer) const LLVM_OVERRIDE; }; diff --git a/llvm/lib/Target/TargetLoweringObjectFile.cpp b/llvm/lib/Target/TargetLoweringObjectFile.cpp index 8c98dd87b69..a0218a83df1 100644 --- a/llvm/lib/Target/TargetLoweringObjectFile.cpp +++ b/llvm/lib/Target/TargetLoweringObjectFile.cpp @@ -101,15 +101,15 @@ static bool IsNullTerminatedString(const Constant *C) { /// Return the MCSymbol for the specified global value. This /// symbol is the main label that is the address of the global. -MCSymbol *TargetLoweringObjectFile::getSymbol(Mangler &M, - const GlobalValue *GV) const { +MCSymbol *TargetLoweringObjectFile::getSymbol(const GlobalValue *GV, + Mangler &M) const { SmallString<60> NameStr; M.getNameWithPrefix(NameStr, GV); return Ctx->GetOrCreateSymbol(NameStr.str()); } MCSymbol *TargetLoweringObjectFile::getSymbolWithGlobalValueBase( - Mangler &M, const GlobalValue *GV, StringRef Suffix) const { + const GlobalValue *GV, StringRef Suffix, Mangler &M) const { assert(!Suffix.empty()); SmallString<60> NameStr; @@ -122,7 +122,7 @@ MCSymbol *TargetLoweringObjectFile::getSymbolWithGlobalValueBase( MCSymbol *TargetLoweringObjectFile:: getCFIPersonalitySymbol(const GlobalValue *GV, Mangler &Mang, MachineModuleInfo *MMI) const { - return getSymbol(Mang, GV); + return getSymbol(GV, Mang); } void TargetLoweringObjectFile::emitPersonalityValue(MCStreamer &Streamer, @@ -310,12 +310,11 @@ TargetLoweringObjectFile::getSectionForConstant(SectionKind Kind) const { /// getTTypeGlobalReference - Return an MCExpr to use for a /// reference to the specified global variable from exception /// handling information. -const MCExpr *TargetLoweringObjectFile:: -getTTypeGlobalReference(const GlobalValue *GV, Mangler &Mang, - MachineModuleInfo *MMI, unsigned Encoding, - MCStreamer &Streamer) const { +const MCExpr *TargetLoweringObjectFile::getTTypeGlobalReference( + const GlobalValue *GV, unsigned Encoding, Mangler &Mang, + MachineModuleInfo *MMI, MCStreamer &Streamer) const { const MCSymbolRefExpr *Ref = - MCSymbolRefExpr::Create(getSymbol(Mang, GV), getContext()); + MCSymbolRefExpr::Create(getSymbol(GV, Mang), getContext()); return getTTypeReference(Ref, Encoding, Streamer); } diff --git a/llvm/lib/Target/X86/X86TargetObjectFile.cpp b/llvm/lib/Target/X86/X86TargetObjectFile.cpp index bf28495c807..c5ba3ecd91f 100644 --- a/llvm/lib/Target/X86/X86TargetObjectFile.cpp +++ b/llvm/lib/Target/X86/X86TargetObjectFile.cpp @@ -18,29 +18,28 @@ using namespace llvm; using namespace dwarf; -const MCExpr *X86_64MachoTargetObjectFile:: -getTTypeGlobalReference(const GlobalValue *GV, Mangler &Mang, - MachineModuleInfo *MMI, unsigned Encoding, - MCStreamer &Streamer) const { +const MCExpr *X86_64MachoTargetObjectFile::getTTypeGlobalReference( + const GlobalValue *GV, unsigned Encoding, Mangler &Mang, + MachineModuleInfo *MMI, MCStreamer &Streamer) const { // On Darwin/X86-64, we can reference dwarf symbols with foo@GOTPCREL+4, which // is an indirect pc-relative reference. if (Encoding & (DW_EH_PE_indirect | DW_EH_PE_pcrel)) { - const MCSymbol *Sym = getSymbol(Mang, GV); + const MCSymbol *Sym = getSymbol(GV, Mang); const MCExpr *Res = MCSymbolRefExpr::Create(Sym, MCSymbolRefExpr::VK_GOTPCREL, getContext()); const MCExpr *Four = MCConstantExpr::Create(4, getContext()); return MCBinaryExpr::CreateAdd(Res, Four, getContext()); } - return TargetLoweringObjectFileMachO:: - getTTypeGlobalReference(GV, Mang, MMI, Encoding, Streamer); + return TargetLoweringObjectFileMachO::getTTypeGlobalReference( + GV, Encoding, Mang, MMI, Streamer); } MCSymbol *X86_64MachoTargetObjectFile:: getCFIPersonalitySymbol(const GlobalValue *GV, Mangler &Mang, MachineModuleInfo *MMI) const { - return getSymbol(Mang, GV); + return getSymbol(GV, Mang); } void @@ -103,5 +102,5 @@ X86WindowsTargetObjectFile::getExecutableRelativeSymbol(const ConstantExpr *CE, return 0; return MCSymbolRefExpr::Create( - getSymbol(Mang, GVLHS), MCSymbolRefExpr::VK_COFF_IMGREL32, getContext()); + getSymbol(GVLHS, Mang), MCSymbolRefExpr::VK_COFF_IMGREL32, getContext()); } diff --git a/llvm/lib/Target/X86/X86TargetObjectFile.h b/llvm/lib/Target/X86/X86TargetObjectFile.h index 6220b9acf9b..45739475f8d 100644 --- a/llvm/lib/Target/X86/X86TargetObjectFile.h +++ b/llvm/lib/Target/X86/X86TargetObjectFile.h @@ -20,9 +20,9 @@ namespace llvm { /// x86-64. class X86_64MachoTargetObjectFile : public TargetLoweringObjectFileMachO { public: - const MCExpr *getTTypeGlobalReference(const GlobalValue *GV, Mangler &Mang, + const MCExpr *getTTypeGlobalReference(const GlobalValue *GV, + unsigned Encoding, Mangler &Mang, MachineModuleInfo *MMI, - unsigned Encoding, MCStreamer &Streamer) const LLVM_OVERRIDE; |