diff options
author | Charles Davis <cdavis@mines.edu> | 2011-05-23 16:43:09 +0000 |
---|---|---|
committer | Charles Davis <cdavis@mines.edu> | 2011-05-23 16:43:09 +0000 |
commit | 16e1b3fcf6f389a6354b5e744730f25bfc0c04c2 (patch) | |
tree | b825570efc7f27fbafd5a3f913dec9df1e0a4b9d /lib/MC/MCParser | |
parent | c10ecd8f23ebb4541acbe18563b7f19c4f79e721 (diff) | |
download | external_llvm-16e1b3fcf6f389a6354b5e744730f25bfc0c04c2.zip external_llvm-16e1b3fcf6f389a6354b5e744730f25bfc0c04c2.tar.gz external_llvm-16e1b3fcf6f389a6354b5e744730f25bfc0c04c2.tar.bz2 |
Implement .seh_stackalloc and .seh_pushframe parsing.
I haven't implemented any of the ones that take registers yet. The problem is
that for x86-64 the streamer methods expect a native x86 register number (note:
%r8-%r15 want 8-15 instead of 0-7; same for %xmm8-%xmm15). I haven't figured
out exactly how I want to do that yet.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131899 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/MC/MCParser')
-rw-r--r-- | lib/MC/MCParser/COFFAsmParser.cpp | 31 |
1 files changed, 27 insertions, 4 deletions
diff --git a/lib/MC/MCParser/COFFAsmParser.cpp b/lib/MC/MCParser/COFFAsmParser.cpp index 0045950..63729a6 100644 --- a/lib/MC/MCParser/COFFAsmParser.cpp +++ b/lib/MC/MCParser/COFFAsmParser.cpp @@ -256,8 +256,17 @@ bool COFFAsmParser::ParseSEHDirectiveSetFrame(StringRef, SMLoc L) { return Error(L, "not implemented yet"); } -bool COFFAsmParser::ParseSEHDirectiveAllocStack(StringRef, SMLoc L) { - return Error(L, "not implemented yet"); +bool COFFAsmParser::ParseSEHDirectiveAllocStack(StringRef, SMLoc) { + int64_t Size; + if (getParser().ParseAbsoluteExpression(Size)) + return true; + + if (getLexer().isNot(AsmToken::EndOfStatement)) + return TokError("unexpected token in directive"); + + Lex(); + getStreamer().EmitWin64EHAllocStack(Size); + return false; } bool COFFAsmParser::ParseSEHDirectiveSaveReg(StringRef, SMLoc L) { @@ -268,8 +277,22 @@ bool COFFAsmParser::ParseSEHDirectiveSaveXMM(StringRef, SMLoc L) { return Error(L, "not implemented yet"); } -bool COFFAsmParser::ParseSEHDirectivePushFrame(StringRef, SMLoc L) { - return Error(L, "not implemented yet"); +bool COFFAsmParser::ParseSEHDirectivePushFrame(StringRef, SMLoc) { + bool Code; + StringRef CodeID; + SMLoc startLoc = getLexer().getLoc(); + if (!getParser().ParseIdentifier(CodeID)) { + if (CodeID != "@code") + return Error(startLoc, "expected @code"); + Code = true; + } + + if (getLexer().isNot(AsmToken::EndOfStatement)) + return TokError("unexpected token in directive"); + + Lex(); + getStreamer().EmitWin64EHPushFrame(Code); + return false; } bool COFFAsmParser::ParseSEHDirectiveEndProlog(StringRef, SMLoc) { |