Skip to content
Snippets Groups Projects
Commit d9eafdcf authored by Charles Davis's avatar Charles Davis
Browse files

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.

llvm-svn: 131899
parent 4e3f9a4c
No related branches found
No related tags found
No related merge requests found
...@@ -256,8 +256,17 @@ bool COFFAsmParser::ParseSEHDirectiveSetFrame(StringRef, SMLoc L) { ...@@ -256,8 +256,17 @@ bool COFFAsmParser::ParseSEHDirectiveSetFrame(StringRef, SMLoc L) {
return Error(L, "not implemented yet"); return Error(L, "not implemented yet");
} }
bool COFFAsmParser::ParseSEHDirectiveAllocStack(StringRef, SMLoc L) { bool COFFAsmParser::ParseSEHDirectiveAllocStack(StringRef, SMLoc) {
return Error(L, "not implemented yet"); 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) { bool COFFAsmParser::ParseSEHDirectiveSaveReg(StringRef, SMLoc L) {
...@@ -268,8 +277,22 @@ bool COFFAsmParser::ParseSEHDirectiveSaveXMM(StringRef, SMLoc L) { ...@@ -268,8 +277,22 @@ bool COFFAsmParser::ParseSEHDirectiveSaveXMM(StringRef, SMLoc L) {
return Error(L, "not implemented yet"); return Error(L, "not implemented yet");
} }
bool COFFAsmParser::ParseSEHDirectivePushFrame(StringRef, SMLoc L) { bool COFFAsmParser::ParseSEHDirectivePushFrame(StringRef, SMLoc) {
return Error(L, "not implemented yet"); 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) { bool COFFAsmParser::ParseSEHDirectiveEndProlog(StringRef, SMLoc) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment