diff options
author | Chris Lattner <sabre@nondot.org> | 2010-03-11 22:53:35 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-03-11 22:53:35 +0000 |
commit | c18409aed80ba1c6c5998befd3c3c8edc865c423 (patch) | |
tree | 85297b9076d8810b736b0bb046e8bde24e7dc436 /tools/llvm-mc | |
parent | 42263e2e407ab7d1d805e7b41cffd7217134d3b6 (diff) | |
download | external_llvm-c18409aed80ba1c6c5998befd3c3c8edc865c423.zip external_llvm-c18409aed80ba1c6c5998befd3c3c8edc865c423.tar.gz external_llvm-c18409aed80ba1c6c5998befd3c3c8edc865c423.tar.bz2 |
change MCContext to always have an MCAsmInfo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98293 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvm-mc')
-rw-r--r-- | tools/llvm-mc/llvm-mc.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/tools/llvm-mc/llvm-mc.cpp b/tools/llvm-mc/llvm-mc.cpp index fa87238..b3c442e 100644 --- a/tools/llvm-mc/llvm-mc.cpp +++ b/tools/llvm-mc/llvm-mc.cpp @@ -242,7 +242,11 @@ static int AssembleInput(const char *ProgName) { // it later. SrcMgr.setIncludeDirs(IncludeDirs); - MCContext Ctx; + + const MCAsmInfo *MAI = TheTarget->createAsmInfo(TripleName); + assert(MAI && "Unable to create target asm info!"); + + MCContext Ctx(*MAI); formatted_raw_ostream *Out = GetOutputStream(); if (!Out) return 1; @@ -262,9 +266,6 @@ static int AssembleInput(const char *ProgName) { OwningPtr<MCStreamer> Str; OwningPtr<TargetAsmBackend> TAB; - const MCAsmInfo *MAI = TheTarget->createAsmInfo(TripleName); - assert(MAI && "Unable to create target asm info!"); - if (FileType == OFT_AssemblyFile) { IP.reset(TheTarget->createMCInstPrinter(OutputAsmVariant, *MAI, *Out)); if (ShowEncoding) |