aboutsummaryrefslogtreecommitdiffstats
path: root/lib/MC/MCParser/ELFAsmParser.cpp
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2010-09-02 18:53:37 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2010-09-02 18:53:37 +0000
commit1674b0b0e4972b844833f253286cbf99a6e99d6e (patch)
tree14ea7fe3f3ffc71b12eb5dd1dadb633812d116aa /lib/MC/MCParser/ELFAsmParser.cpp
parent3e234e757965a3c30f31227b60575841441368b6 (diff)
downloadexternal_llvm-1674b0b0e4972b844833f253286cbf99a6e99d6e.zip
external_llvm-1674b0b0e4972b844833f253286cbf99a6e99d6e.tar.gz
external_llvm-1674b0b0e4972b844833f253286cbf99a6e99d6e.tar.bz2
Add AsmParser support for the ELF .previous directive. Patch by Roman Divacky.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112849 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/MC/MCParser/ELFAsmParser.cpp')
-rw-r--r--lib/MC/MCParser/ELFAsmParser.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/MC/MCParser/ELFAsmParser.cpp b/lib/MC/MCParser/ELFAsmParser.cpp
index b0bc5c6..f982fda 100644
--- a/lib/MC/MCParser/ELFAsmParser.cpp
+++ b/lib/MC/MCParser/ELFAsmParser.cpp
@@ -50,6 +50,7 @@ public:
AddDirectiveHandler<&ELFAsmParser::ParseDirectiveSize>(".size");
AddDirectiveHandler<&ELFAsmParser::ParseDirectiveLEB128>(".sleb128");
AddDirectiveHandler<&ELFAsmParser::ParseDirectiveLEB128>(".uleb128");
+ AddDirectiveHandler<&ELFAsmParser::ParseDirectivePrevious>(".previous");
}
bool ParseSectionDirectiveData(StringRef, SMLoc) {
@@ -111,6 +112,7 @@ public:
bool ParseDirectiveLEB128(StringRef, SMLoc);
bool ParseDirectiveSection(StringRef, SMLoc);
bool ParseDirectiveSize(StringRef, SMLoc);
+ bool ParseDirectivePrevious(StringRef, SMLoc);
};
}
@@ -272,6 +274,14 @@ bool ELFAsmParser::ParseDirectiveLEB128(StringRef DirName, SMLoc) {
return TokError("LEB128 not supported yet");
}
+bool ELFAsmParser::ParseDirectivePrevious(StringRef DirName, SMLoc) {
+ const MCSection *PreviousSection = getStreamer().getPreviousSection();
+ if (PreviousSection != NULL)
+ getStreamer().SwitchSection(PreviousSection);
+
+ return false;
+}
+
namespace llvm {
MCAsmParserExtension *createELFAsmParser() {