| Index: tools/llvm-mc/llvm-mc.cpp
|
| diff --git a/tools/llvm-mc/llvm-mc.cpp b/tools/llvm-mc/llvm-mc.cpp
|
| index 5da9e8662353bd9bb8220754da072b09f6f9a2b5..e056d03a598bd9046783df6b0a1a3d7b54b4a7f3 100644
|
| --- a/tools/llvm-mc/llvm-mc.cpp
|
| +++ b/tools/llvm-mc/llvm-mc.cpp
|
| @@ -18,6 +18,7 @@
|
| #include "llvm/MC/MCContext.h"
|
| #include "llvm/MC/MCInstPrinter.h"
|
| #include "llvm/MC/MCInstrInfo.h"
|
| +#include "llvm/MC/MCNaCl.h"
|
| #include "llvm/MC/MCObjectFileInfo.h"
|
| #include "llvm/MC/MCParser/AsmLexer.h"
|
| #include "llvm/MC/MCRegisterInfo.h"
|
| @@ -446,7 +447,9 @@ int main(int argc, char **argv) {
|
| std::unique_ptr<MCSubtargetInfo> STI(
|
| TheTarget->createMCSubtargetInfo(TripleName, MCPU, FeaturesStr));
|
|
|
| - MCInstPrinter *IP = nullptr;
|
| + Triple T(TripleName); // @LOCALMOD
|
| +
|
| + MCInstPrinter *IP = NULL;
|
| if (FileType == OFT_AssemblyFile) {
|
| IP =
|
| TheTarget->createMCInstPrinter(OutputAsmVariant, *MAI, *MCII, *MRI, *STI);
|
| @@ -457,7 +460,7 @@ int main(int argc, char **argv) {
|
| // Set up the AsmStreamer.
|
| MCCodeEmitter *CE = nullptr;
|
| MCAsmBackend *MAB = nullptr;
|
| - if (ShowEncoding) {
|
| + if (ShowEncoding || T.isOSNaCl()) { // @LOCALMOD
|
| CE = TheTarget->createMCCodeEmitter(*MCII, *MRI, *STI, Ctx);
|
| MAB = TheTarget->createMCAsmBackend(*MRI, TripleName, MCPU);
|
| }
|
| @@ -475,6 +478,14 @@ int main(int argc, char **argv) {
|
| *STI, RelaxAll));
|
| if (NoExecStack)
|
| Str->InitSections(true);
|
| + // @LOCALMOD-BEGIN
|
| + if (T.isOSNaCl()) {
|
| + // If the above non-localmod does InitSections unconditionally,
|
| + // we can use that.
|
| + Str->InitSections(NoExecStack);
|
| + initializeNaClMCStreamer(*Str.get(), Ctx, T);
|
| + }
|
| + // @LOCALMOD-END
|
| }
|
|
|
| int Res = 1;
|
|
|