Skip to content

Commit

Permalink
llvm-mc: Support -filetype=null, for timing purposes.
Browse files Browse the repository at this point in the history
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99349 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
ddunbar committed Mar 23, 2010
1 parent ef6e96f commit 2d9f5d1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tools/llvm-mc/llvm-mc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
};
Expand All @@ -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));
Expand Down Expand Up @@ -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));
Expand Down

0 comments on commit 2d9f5d1

Please sign in to comment.