[llvm-commits] [llvm] r95100 - in /llvm/trunk: docs/WritingAnLLVMBackend.html include/llvm/Target/TargetMachine.h lib/CodeGen/LLVMTargetMachine.cpp
Chris Lattner
sabre at nondot.org
Tue Feb 2 10:44:12 PST 2010
Author: lattner
Date: Tue Feb 2 12:44:12 2010
New Revision: 95100
URL: http://llvm.org/viewvc/llvm-project?rev=95100&view=rev
Log:
Inline addAssemblyEmitter into its one real caller and delete
the -print-emitted-asm option. The JIT shouldn't have to pull
in the asmprinter.
Modified:
llvm/trunk/docs/WritingAnLLVMBackend.html
llvm/trunk/include/llvm/Target/TargetMachine.h
llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp
Modified: llvm/trunk/docs/WritingAnLLVMBackend.html
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/WritingAnLLVMBackend.html?rev=95100&r1=95099&r2=95100&view=diff
==============================================================================
--- llvm/trunk/docs/WritingAnLLVMBackend.html (original)
+++ llvm/trunk/docs/WritingAnLLVMBackend.html Tue Feb 2 12:44:12 2010
@@ -354,8 +354,6 @@
// Pass Pipeline Configuration
virtual bool addInstSelector(PassManagerBase &PM, bool Fast);
virtual bool addPreEmitPass(PassManagerBase &PM, bool Fast);
- virtual bool addAssemblyEmitter(PassManagerBase &PM, bool Fast,
- std::ostream &Out);
};
} // end namespace llvm
Modified: llvm/trunk/include/llvm/Target/TargetMachine.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetMachine.h?rev=95100&r1=95099&r2=95100&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Target/TargetMachine.h (original)
+++ llvm/trunk/include/llvm/Target/TargetMachine.h Tue Feb 2 12:44:12 2010
@@ -463,14 +463,6 @@
/// getEnableTailMergeDefault - the default setting for -enable-tail-merge
/// on this target. User flag overrides.
virtual bool getEnableTailMergeDefault() const { return true; }
-
- /// addAssemblyEmitter - Helper function which creates a target specific
- /// assembly printer, if available.
- ///
- /// \return Returns 'false' on success.
- bool addAssemblyEmitter(PassManagerBase &, CodeGenOpt::Level,
- bool /* VerboseAsmDefault */,
- formatted_raw_ostream &);
};
} // End llvm namespace
Modified: llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp?rev=95100&r1=95099&r2=95100&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp (original)
+++ llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp Tue Feb 2 12:44:12 2010
@@ -57,8 +57,6 @@
cl::desc("Print LLVM IR produced by the loop-reduce pass"));
static cl::opt<bool> PrintISelInput("print-isel-input", cl::Hidden,
cl::desc("Print LLVM IR input to isel pass"));
-static cl::opt<bool> PrintEmittedAsm("print-emitted-asm", cl::Hidden,
- cl::desc("Dump emitter generated instructions as assembly"));
static cl::opt<bool> PrintGCInfo("print-gc", cl::Hidden,
cl::desc("Dump garbage collector data"));
static cl::opt<bool> VerifyMachineCode("verify-machineinstrs", cl::Hidden,
@@ -110,29 +108,20 @@
switch (FileType) {
default:
break;
- case TargetMachine::AssemblyFile:
- if (addAssemblyEmitter(PM, OptLevel, getAsmVerbosityDefault(), Out))
- return FileModel::Error;
+ case TargetMachine::AssemblyFile: {
+ FunctionPass *Printer =
+ getTarget().createAsmPrinter(Out, *this, getMCAsmInfo(),
+ getAsmVerbosityDefault());
+ if (Printer == 0) break;
+ PM.add(Printer);
return FileModel::AsmFile;
+ }
case TargetMachine::ObjectFile:
return FileModel::Error;
}
return FileModel::Error;
}
-bool LLVMTargetMachine::addAssemblyEmitter(PassManagerBase &PM,
- CodeGenOpt::Level OptLevel,
- bool Verbose,
- formatted_raw_ostream &Out) {
- FunctionPass *Printer =
- getTarget().createAsmPrinter(Out, *this, getMCAsmInfo(), Verbose);
- if (!Printer)
- return true;
-
- PM.add(Printer);
- return false;
-}
-
/// addPassesToEmitFileFinish - If the passes to emit the specified file had to
/// be split up (e.g., to add an object writer pass), this method can be used to
/// finish up adding passes to emit the file, if necessary.
@@ -144,8 +133,6 @@
if (MCE)
addSimpleCodeEmitter(PM, OptLevel, *MCE);
- if (PrintEmittedAsm)
- addAssemblyEmitter(PM, OptLevel, true, ferrs());
PM.add(createGCInfoDeleter());
@@ -163,8 +150,6 @@
if (JCE)
addSimpleCodeEmitter(PM, OptLevel, *JCE);
- if (PrintEmittedAsm)
- addAssemblyEmitter(PM, OptLevel, true, ferrs());
PM.add(createGCInfoDeleter());
@@ -180,9 +165,6 @@
// Make sure the code model is set.
setCodeModelForStatic();
- if (PrintEmittedAsm)
- addAssemblyEmitter(PM, OptLevel, true, ferrs());
-
PM.add(createGCInfoDeleter());
return false; // success!
@@ -205,9 +187,6 @@
return true;
addCodeEmitter(PM, OptLevel, MCE);
- if (PrintEmittedAsm)
- addAssemblyEmitter(PM, OptLevel, true, ferrs());
-
PM.add(createGCInfoDeleter());
return false; // success!
@@ -230,9 +209,6 @@
return true;
addCodeEmitter(PM, OptLevel, JCE);
- if (PrintEmittedAsm)
- addAssemblyEmitter(PM, OptLevel, true, ferrs());
-
PM.add(createGCInfoDeleter());
return false; // success!
More information about the llvm-commits
mailing list