diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2011-12-17 01:14:52 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2011-12-17 01:14:52 +0000 |
commit | d3df3d352747f09683c8b9b251e0a40f6ad878e9 (patch) | |
tree | a0c354ef3095541349f8ded36b0fc803bfd04be1 /llvm/lib/MC/MCParser/COFFAsmParser.cpp | |
parent | da07b3ad420ef31b50a3c3621c9445a2c15fef45 (diff) | |
download | bcm5719-llvm-d3df3d352747f09683c8b9b251e0a40f6ad878e9.tar.gz bcm5719-llvm-d3df3d352747f09683c8b9b251e0a40f6ad878e9.zip |
Add back the MC bits of 126425. Original patch by Nathan Jeffords. I added the
asm parsing and testcase.
llvm-svn: 146801
Diffstat (limited to 'llvm/lib/MC/MCParser/COFFAsmParser.cpp')
-rw-r--r-- | llvm/lib/MC/MCParser/COFFAsmParser.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/llvm/lib/MC/MCParser/COFFAsmParser.cpp b/llvm/lib/MC/MCParser/COFFAsmParser.cpp index 185b5168bd6..c4cdc3c9f96 100644 --- a/llvm/lib/MC/MCParser/COFFAsmParser.cpp +++ b/llvm/lib/MC/MCParser/COFFAsmParser.cpp @@ -45,6 +45,7 @@ class COFFAsmParser : public MCAsmParserExtension { AddDirectiveHandler<&COFFAsmParser::ParseDirectiveScl>(".scl"); AddDirectiveHandler<&COFFAsmParser::ParseDirectiveType>(".type"); AddDirectiveHandler<&COFFAsmParser::ParseDirectiveEndef>(".endef"); + AddDirectiveHandler<&COFFAsmParser::ParseDirectiveSecRel32>(".secrel32"); // Win64 EH directives. AddDirectiveHandler<&COFFAsmParser::ParseSEHDirectiveStartProc>( @@ -102,6 +103,7 @@ class COFFAsmParser : public MCAsmParserExtension { bool ParseDirectiveScl(StringRef, SMLoc); bool ParseDirectiveType(StringRef, SMLoc); bool ParseDirectiveEndef(StringRef, SMLoc); + bool ParseDirectiveSecRel32(StringRef, SMLoc); // Win64 EH directives. bool ParseSEHDirectiveStartProc(StringRef, SMLoc); @@ -217,6 +219,21 @@ bool COFFAsmParser::ParseDirectiveEndef(StringRef, SMLoc) { return false; } +bool COFFAsmParser::ParseDirectiveSecRel32(StringRef, SMLoc) { + StringRef SymbolID; + if (getParser().ParseIdentifier(SymbolID)) + return true; + + if (getLexer().isNot(AsmToken::EndOfStatement)) + return TokError("unexpected token in directive"); + + MCSymbol *Symbol = getContext().GetOrCreateSymbol(SymbolID); + + Lex(); + getStreamer().EmitCOFFSecRel32(Symbol); + return false; +} + bool COFFAsmParser::ParseSEHDirectiveStartProc(StringRef, SMLoc) { StringRef SymbolID; if (getParser().ParseIdentifier(SymbolID)) |