aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-03-11 22:53:35 +0000
committerChris Lattner <sabre@nondot.org>2010-03-11 22:53:35 +0000
commitc18409aed80ba1c6c5998befd3c3c8edc865c423 (patch)
tree85297b9076d8810b736b0bb046e8bde24e7dc436 /tools
parent42263e2e407ab7d1d805e7b41cffd7217134d3b6 (diff)
downloadexternal_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')
-rw-r--r--tools/edis/EDDisassembler.cpp10
-rw-r--r--tools/llvm-mc/llvm-mc.cpp9
2 files changed, 9 insertions, 10 deletions
diff --git a/tools/edis/EDDisassembler.cpp b/tools/edis/EDDisassembler.cpp
index 99864fb..f2b2f91 100644
--- a/tools/edis/EDDisassembler.cpp
+++ b/tools/edis/EDDisassembler.cpp
@@ -341,19 +341,17 @@ int EDDisassembler::parseInst(SmallVectorImpl<MCParsedAsmOperand*> &operands,
SourceMgr sourceMgr;
sourceMgr.AddNewSourceBuffer(buf, SMLoc()); // ownership of buf handed over
- MCContext context;
- OwningPtr<MCStreamer> streamer
- (createNullStreamer(context));
+ MCContext context(*AsmInfo);
+ OwningPtr<MCStreamer> streamer(createNullStreamer(context));
AsmParser genericParser(sourceMgr, context, *streamer, *AsmInfo);
- OwningPtr<TargetAsmParser> specificParser
- (Tgt->createAsmParser(genericParser));
+ OwningPtr<TargetAsmParser> TargetParser(Tgt->createAsmParser(genericParser));
AsmToken OpcodeToken = genericParser.Lex();
if(OpcodeToken.is(AsmToken::Identifier)) {
instName = OpcodeToken.getString();
instLoc = OpcodeToken.getLoc();
- if (specificParser->ParseInstruction(instName, instLoc, operands))
+ if (TargetParser->ParseInstruction(instName, instLoc, operands))
ret = -1;
}
else {
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)