Hook up the '.code {16|32}' directive to the streamer.
authorJim Grosbach <grosbach@apple.com>
Fri, 5 Nov 2010 22:40:53 +0000 (22:40 +0000)
committerJim Grosbach <grosbach@apple.com>
Fri, 5 Nov 2010 22:40:53 +0000 (22:40 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118310 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/ARM/AsmParser/ARMAsmParser.cpp

index 2ebea1ac2b4cd6b6ec394c30b7b0fae2d5eaef55..818630b981c2068b51f8d5e6cf601aca76cfff30 100644 (file)
@@ -958,8 +958,11 @@ bool ARMAsmParser::ParseDirectiveCode(SMLoc L) {
     return Error(Parser.getTok().getLoc(), "unexpected token in directive");
   Parser.Lex();
 
-  // TODO tell the MC streamer the mode
-  // getParser().getStreamer().Emit???();
+  if (Val == 16)
+    getParser().getStreamer().EmitAssemblerFlag(MCAF_Code16);
+  else
+    getParser().getStreamer().EmitAssemblerFlag(MCAF_Code32);
+
   return false;
 }