llvm-mc: Support -filetype=null, for timing purposes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99349 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Daniel Dunbar 2010-03-23 23:47:12 +00:00
parent ef6e96f91f
commit 2d9f5d1d7f

View File

@ -56,6 +56,7 @@ OutputAsmVariant("output-asm-variant",
cl::desc("Syntax variant to use for output printing"));
enum OutputFileType {
OFT_Null,
OFT_AssemblyFile,
OFT_ObjectFile
};
@ -65,6 +66,8 @@ FileType("filetype", cl::init(OFT_AssemblyFile),
cl::values(
clEnumValN(OFT_AssemblyFile, "asm",
"Emit an assembly ('.s') file"),
clEnumValN(OFT_Null, "null",
"Don't emit anything (for timing purposes)"),
clEnumValN(OFT_ObjectFile, "obj",
"Emit a native object ('.o') file"),
clEnumValEnd));
@ -289,6 +292,8 @@ static int AssembleInput(const char *ProgName) {
CE.reset(TheTarget->createCodeEmitter(*TM, Ctx));
Str.reset(createAsmStreamer(Ctx, *Out,TM->getTargetData()->isLittleEndian(),
/*asmverbose*/true, IP, CE.get(), ShowInst));
} else if (FileType == OFT_Null) {
Str.reset(createNullStreamer(Ctx));
} else {
assert(FileType == OFT_ObjectFile && "Invalid file type!");
CE.reset(TheTarget->createCodeEmitter(*TM, Ctx));