From: Jim Grosbach Date: Tue, 6 Sep 2011 18:46:23 +0000 (+0000) Subject: ARM .code directive should always go to the streamer. X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=98447daa9559d5bf7816f084581b5ca073d316f6;p=oota-llvm.git 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 --- diff --git a/lib/Target/ARM/AsmParser/ARMAsmParser.cpp b/lib/Target/ARM/AsmParser/ARMAsmParser.cpp index 0c4bbac4f69..6668fc9f557 100644 --- a/lib/Target/ARM/AsmParser/ARMAsmParser.cpp +++ b/lib/Target/ARM/AsmParser/ARMAsmParser.cpp @@ -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;