summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp b/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
index 8ebf1e41ebf..f794e21b2b0 100644
--- a/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
+++ b/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
@@ -115,6 +115,10 @@ class ARMAsmParser : public MCTargetAsmParser {
return ConstantPools[Section];
}
+ void destroyConstantPool(const MCSection *Section) {
+ ConstantPools.erase(Section);
+ }
+
ARMTargetStreamer &getTargetStreamer() {
MCTargetStreamer &TS = getParser().getStreamer().getTargetStreamer();
return static_cast<ARMTargetStreamer &>(TS);
@@ -211,6 +215,7 @@ class ARMAsmParser : public MCTargetAsmParser {
bool parseDirectivePad(SMLoc L);
bool parseDirectiveRegSave(SMLoc L, bool IsVector);
bool parseDirectiveInst(SMLoc L, char Suffix = '\0');
+ bool parseDirectiveLtorg(SMLoc L);
StringRef splitMnemonic(StringRef Mnemonic, unsigned &PredicationCode,
bool &CarrySetting, unsigned &ProcessorIMod,
@@ -7894,6 +7899,8 @@ bool ARMAsmParser::ParseDirective(AsmToken DirectiveID) {
return parseDirectiveInst(DirectiveID.getLoc(), 'n');
else if (IDVal == ".inst.w")
return parseDirectiveInst(DirectiveID.getLoc(), 'w');
+ else if (IDVal == ".ltorg")
+ return parseDirectiveLtorg(DirectiveID.getLoc());
return true;
}
@@ -8445,6 +8452,20 @@ bool ARMAsmParser::parseDirectiveInst(SMLoc Loc, char Suffix) {
return false;
}
+/// parseDirectiveLtorg
+/// ::= .ltorg
+bool ARMAsmParser::parseDirectiveLtorg(SMLoc L) {
+ MCStreamer &Streamer = getParser().getStreamer();
+ const MCSection *Section = Streamer.getCurrentSection().first;
+
+ if (ConstantPool *CP = getConstantPool(Section)) {
+ CP->emitEntries(Streamer);
+ CP = 0;
+ destroyConstantPool(Section);
+ }
+ return false;
+}
+
/// Force static initialization.
extern "C" void LLVMInitializeARMAsmParser() {
RegisterMCAsmParser<ARMAsmParser> X(TheARMTarget);
OpenPOWER on IntegriCloud