diff options
author | Chris Lattner <sabre@nondot.org> | 2009-08-17 04:23:44 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-08-17 04:23:44 +0000 |
commit | f3ce009fcb0a04a245c437d86657e9bd61ecc18f (patch) | |
tree | 52550e36a463fe4346fe0352f00073defb08db30 /tools | |
parent | 46a947d8c191e5c218e736330c9d4d59ac4bcab3 (diff) | |
download | external_llvm-f3ce009fcb0a04a245c437d86657e9bd61ecc18f.zip external_llvm-f3ce009fcb0a04a245c437d86657e9bd61ecc18f.tar.gz external_llvm-f3ce009fcb0a04a245c437d86657e9bd61ecc18f.tar.bz2 |
give MCAsmStreamer a TargetAsmInfo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79222 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools')
-rw-r--r-- | tools/llvm-mc/llvm-mc.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/tools/llvm-mc/llvm-mc.cpp b/tools/llvm-mc/llvm-mc.cpp index 7c57f35..a9ba8bd 100644 --- a/tools/llvm-mc/llvm-mc.cpp +++ b/tools/llvm-mc/llvm-mc.cpp @@ -211,21 +211,21 @@ static int AssembleInput(const char *ProgName) { if (!Out) return 1; - // See if we can get an asm printer. - OwningPtr<AsmPrinter> AP(0); // FIXME: We shouldn't need to do this (and link in codegen). OwningPtr<TargetMachine> TM(TheTarget->createTargetMachine(TripleName, "")); - const TargetAsmInfo *TAI = 0; - if (TM) { - TAI = TheTarget->createAsmInfo(TripleName); - assert(TAI && "Unable to create target asm info!"); - - AP.reset(TheTarget->createAsmPrinter(*Out, *TM, TAI, true)); + if (!TM) { + errs() << ProgName << ": error: could not create target for triple '" + << TripleName << "'.\n"; + return 1; } - OwningPtr<MCStreamer> Str(createAsmStreamer(Ctx, *Out, AP.get())); + const TargetAsmInfo *TAI = TheTarget->createAsmInfo(TripleName); + assert(TAI && "Unable to create target asm info!"); + + OwningPtr<AsmPrinter> AP(TheTarget->createAsmPrinter(*Out, *TM, TAI, true)); + OwningPtr<MCStreamer> Str(createAsmStreamer(Ctx, *Out, *TAI, AP.get())); // FIXME: Target hook & command line option for initial section. Str.get()->SwitchSection(MCSectionMachO::Create("__TEXT","__text", |