ARM .code directive should always go to the streamer.

Even if there's no mode switch performed, the .code directive should still
be sent to the output streamer. Otherwise, for example, an output asm stream
is not equivalent to the input stream which generated it (a dependency on
the input target triple arm vs. thumb is introduced which was not originally
there).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139155 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Jim Grosbach 2011-09-06 18:46:23 +00:00
parent 96428cea3d
commit 98447daa95

View File

@ -3797,15 +3797,13 @@ bool ARMAsmParser::parseDirectiveCode(SMLoc L) {
Parser.Lex();
if (Val == 16) {
if (!isThumb()) {
if (!isThumb())
SwitchMode();
getParser().getStreamer().EmitAssemblerFlag(MCAF_Code16);
}
getParser().getStreamer().EmitAssemblerFlag(MCAF_Code16);
} else {
if (isThumb()) {
if (isThumb())
SwitchMode();
getParser().getStreamer().EmitAssemblerFlag(MCAF_Code32);
}
getParser().getStreamer().EmitAssemblerFlag(MCAF_Code32);
}
return false;