diff options
Diffstat (limited to 'llvm/lib/MC/MCParser/WasmAsmParser.cpp')
-rw-r--r-- | llvm/lib/MC/MCParser/WasmAsmParser.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/lib/MC/MCParser/WasmAsmParser.cpp b/llvm/lib/MC/MCParser/WasmAsmParser.cpp index 7fe2711..ea93af7 100644 --- a/llvm/lib/MC/MCParser/WasmAsmParser.cpp +++ b/llvm/lib/MC/MCParser/WasmAsmParser.cpp @@ -21,6 +21,7 @@ #include "llvm/MC/MCParser/MCAsmLexer.h" #include "llvm/MC/MCParser/MCAsmParser.h" #include "llvm/MC/MCParser/MCAsmParserExtension.h" +#include "llvm/MC/MCObjectFileInfo.h" #include "llvm/MC/MCSectionWasm.h" #include "llvm/MC/MCStreamer.h" #include "llvm/MC/MCSymbolWasm.h" @@ -52,6 +53,7 @@ public: this->MCAsmParserExtension::Initialize(*Parser); addDirectiveHandler<&WasmAsmParser::parseSectionDirectiveText>(".text"); + addDirectiveHandler<&WasmAsmParser::parseSectionDirectiveData>(".data"); addDirectiveHandler<&WasmAsmParser::parseSectionDirective>(".section"); addDirectiveHandler<&WasmAsmParser::parseDirectiveSize>(".size"); addDirectiveHandler<&WasmAsmParser::parseDirectiveType>(".type"); @@ -89,6 +91,12 @@ public: return false; } + bool parseSectionDirectiveData(StringRef, SMLoc) { + auto *S = getContext().getObjectFileInfo()->getDataSection(); + getStreamer().SwitchSection(S); + return false; + } + uint32_t parseSectionFlags(StringRef FlagStr, bool &Passive, bool &Group) { uint32_t flags = 0; for (char C : FlagStr) { |