diff options
author | Eli Bendersky <eliben@google.com> | 2013-01-07 21:51:08 +0000 |
---|---|---|
committer | Eli Bendersky <eliben@google.com> | 2013-01-07 21:51:08 +0000 |
commit | 802b62871eaff81980aeaafebd639319cc93c051 (patch) | |
tree | 2fe33233c636883906c0c84f90ae538bc5f82c11 /llvm/lib/MC/MCParser/AsmParser.cpp | |
parent | 449e4926a6c42e7282981e1f411b2141fa32d7f2 (diff) | |
download | bcm5719-llvm-802b62871eaff81980aeaafebd639319cc93c051.tar.gz bcm5719-llvm-802b62871eaff81980aeaafebd639319cc93c051.zip |
Add the align_to_end option to .bundle_lock in the MC implementation of aligned
bundling. The document describing this feature and the implementation has also
been updated:
https://sites.google.com/a/chromium.org/dev/nativeclient/pnacl/aligned-bundling-support-in-llvm
llvm-svn: 171797
Diffstat (limited to 'llvm/lib/MC/MCParser/AsmParser.cpp')
-rw-r--r-- | llvm/lib/MC/MCParser/AsmParser.cpp | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/llvm/lib/MC/MCParser/AsmParser.cpp b/llvm/lib/MC/MCParser/AsmParser.cpp index 8a22ed59498..7c3fea56400 100644 --- a/llvm/lib/MC/MCParser/AsmParser.cpp +++ b/llvm/lib/MC/MCParser/AsmParser.cpp @@ -2473,15 +2473,31 @@ bool AsmParser::ParseDirectiveBundleAlignMode() { } /// ParseDirectiveBundleLock -/// ::= {.bundle_lock} +/// ::= {.bundle_lock} [align_to_end] bool AsmParser::ParseDirectiveBundleLock() { CheckForValidSection(); + bool AlignToEnd = false; + + if (getLexer().isNot(AsmToken::EndOfStatement)) { + StringRef Option; + SMLoc Loc = getTok().getLoc(); + const char *kInvalidOptionError = + "invalid option for '.bundle_lock' directive"; + + if (ParseIdentifier(Option)) + return Error(Loc, kInvalidOptionError); + + if (Option != "align_to_end") + return Error(Loc, kInvalidOptionError); + else if (getLexer().isNot(AsmToken::EndOfStatement)) + return Error(Loc, + "unexpected token after '.bundle_lock' directive option"); + AlignToEnd = true; + } - if (getLexer().isNot(AsmToken::EndOfStatement)) - return TokError("unexpected token in '.bundle_lock' directive"); Lex(); - getStreamer().EmitBundleLock(); + getStreamer().EmitBundleLock(AlignToEnd); return false; } |