summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/Mips/MCTargetDesc/MipsMCAsmInfo.cpp
diff options
context:
space:
mode:
authorDaniel Sanders <daniel.sanders@imgtec.com>2015-05-20 13:16:42 +0000
committerDaniel Sanders <daniel.sanders@imgtec.com>2015-05-20 13:16:42 +0000
commitb718eca643df13010e3369a15899cb9adad432ec (patch)
tree854a275ecdd5a8e6c3e0ab448399ab2e0ee1e2c4 /llvm/lib/Target/Mips/MCTargetDesc/MipsMCAsmInfo.cpp
parentd7589ffe1d9319e1ff36bee1b6d61b44aabbba09 (diff)
downloadbcm5719-llvm-b718eca643df13010e3369a15899cb9adad432ec.tar.gz
bcm5719-llvm-b718eca643df13010e3369a15899cb9adad432ec.zip
[mips] The naming convention for private labels is ABI dependant.
Summary: For N32/N64, private labels begin with '.L' but for O32 they begin with '$'. MCAsmInfo now has an initializer function which can be used to provide information from the TargetMachine to control the assembly syntax. Reviewers: vkalintiris Reviewed By: vkalintiris Subscribers: jfb, sandeep, llvm-commits, rafael Differential Revision: http://reviews.llvm.org/D9821 llvm-svn: 237789
Diffstat (limited to 'llvm/lib/Target/Mips/MCTargetDesc/MipsMCAsmInfo.cpp')
-rw-r--r--llvm/lib/Target/Mips/MCTargetDesc/MipsMCAsmInfo.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/llvm/lib/Target/Mips/MCTargetDesc/MipsMCAsmInfo.cpp b/llvm/lib/Target/Mips/MCTargetDesc/MipsMCAsmInfo.cpp
index e2bd5a815ab..b47ca0b5cb5 100644
--- a/llvm/lib/Target/Mips/MCTargetDesc/MipsMCAsmInfo.cpp
+++ b/llvm/lib/Target/Mips/MCTargetDesc/MipsMCAsmInfo.cpp
@@ -12,7 +12,10 @@
//===----------------------------------------------------------------------===//
#include "MipsMCAsmInfo.h"
+#include "MCTargetDesc/MipsABIInfo.h"
+#include "MipsTargetMachine.h"
#include "llvm/ADT/Triple.h"
+#include "llvm/Target/TargetMachine.h"
using namespace llvm;
@@ -29,12 +32,14 @@ MipsMCAsmInfo::MipsMCAsmInfo(StringRef TT) {
PointerSize = CalleeSaveStackSlotSize = 8;
}
+ // These two are overridden in finishInit()
+ PrivateGlobalPrefix = "$";
+ PrivateLabelPrefix = "$";
+
AlignmentIsInBytes = false;
Data16bitsDirective = "\t.2byte\t";
Data32bitsDirective = "\t.4byte\t";
Data64bitsDirective = "\t.8byte\t";
- PrivateGlobalPrefix = "$";
- PrivateLabelPrefix = "$";
CommentString = "#";
ZeroDirective = "\t.space\t";
GPRel32Directive = "\t.gpword\t";
@@ -44,3 +49,9 @@ MipsMCAsmInfo::MipsMCAsmInfo(StringRef TT) {
ExceptionsType = ExceptionHandling::DwarfCFI;
DwarfRegNumForCFI = true;
}
+
+void MipsMCAsmInfo::finishInit(const LLVMTargetMachine &TM) {
+ const MipsABIInfo &ABI = static_cast<const MipsTargetMachine &>(TM).getABI();
+ PrivateGlobalPrefix = ABI.GetPrivateLabelPrefix();
+ PrivateLabelPrefix = ABI.GetPrivateLabelPrefix();
+}
OpenPOWER on IntegriCloud