diff options
author | Evan Cheng <evan.cheng@apple.com> | 2011-07-09 05:47:46 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2011-07-09 05:47:46 +0000 |
commit | ffc0e73046f737d75e0a62b3a83ef19bcef111e3 (patch) | |
tree | 1f82f6a0b1c1a743dd4c10377858004988a47262 /tools/lto | |
parent | 4f4a6fcd165293c347a42b543e5e55aa42a09bb2 (diff) | |
download | external_llvm-ffc0e73046f737d75e0a62b3a83ef19bcef111e3.zip external_llvm-ffc0e73046f737d75e0a62b3a83ef19bcef111e3.tar.gz external_llvm-ffc0e73046f737d75e0a62b3a83ef19bcef111e3.tar.bz2 |
Change createAsmParser to take a MCSubtargetInfo instead of triple,
CPU, and feature string. Parsing some asm directives can change
subtarget state (e.g. .code 16) and it must be reflected in other
modules (e.g. MCCodeEmitter). That is, the MCSubtargetInfo instance
must be shared.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134795 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/lto')
-rw-r--r-- | tools/lto/LTOModule.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/tools/lto/LTOModule.cpp b/tools/lto/LTOModule.cpp index 1794c97..83fdbbe 100644 --- a/tools/lto/LTOModule.cpp +++ b/tools/lto/LTOModule.cpp @@ -35,6 +35,7 @@ #include "llvm/MC/MCInst.h" #include "llvm/MC/MCParser/MCAsmParser.h" #include "llvm/MC/MCStreamer.h" +#include "llvm/MC/MCSubtargetInfo.h" #include "llvm/MC/MCSymbol.h" #include "llvm/MC/SubtargetFeature.h" #include "llvm/Target/TargetAsmParser.h" @@ -618,11 +619,12 @@ bool LTOModule::addAsmGlobalSymbols(MCContext &Context) { OwningPtr<MCAsmParser> Parser(createMCAsmParser(_target->getTarget(), SrcMgr, Context, *Streamer, *_target->getMCAsmInfo())); + OwningPtr<MCSubtargetInfo> STI(_target->getTarget(). + createMCSubtargetInfo(_target->getTargetTriple(), + _target->getTargetCPU(), + _target->getTargetFeatureString())); OwningPtr<TargetAsmParser> - TAP(_target->getTarget().createAsmParser(_target->getTargetTriple(), - _target->getTargetCPU(), - _target->getTargetFeatureString(), - *Parser.get())); + TAP(_target->getTarget().createAsmParser(*STI, *Parser.get())); Parser->setTargetParser(*TAP); int Res = Parser->Run(false); if (Res) |