summaryrefslogtreecommitdiffstats
path: root/tools/llvm-dis
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-02-07 04:39:35 +0000
committerChris Lattner <sabre@nondot.org>2007-02-07 04:39:35 +0000
commit4d544cd646440fb99131206d6f074fa32dc308dc (patch)
treed98ca9b70a888aae09384f911b12a2c26f1b466e /tools/llvm-dis
parent91140e963369f9bf3f651f0c923bf8f839f9cda7 (diff)
downloadexternal_llvm-4d544cd646440fb99131206d6f074fa32dc308dc.zip
external_llvm-4d544cd646440fb99131206d6f074fa32dc308dc.tar.gz
external_llvm-4d544cd646440fb99131206d6f074fa32dc308dc.tar.bz2
add an option for timing bc file reading.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33977 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvm-dis')
-rw-r--r--tools/llvm-dis/llvm-dis.cpp17
1 files changed, 12 insertions, 5 deletions
diff --git a/tools/llvm-dis/llvm-dis.cpp b/tools/llvm-dis/llvm-dis.cpp
index d2022fd..e4ed2b3 100644
--- a/tools/llvm-dis/llvm-dis.cpp
+++ b/tools/llvm-dis/llvm-dis.cpp
@@ -39,6 +39,9 @@ OutputFilename("o", cl::desc("Override output filename"),
static cl::opt<bool>
Force("f", cl::desc("Overwrite output files"));
+static cl::opt<bool>
+DontPrint("disable-output", cl::desc("Don't output the .ll file"), cl::Hidden);
+
int main(int argc, char **argv) {
llvm_shutdown_obj X; // Call llvm_shutdown() on exit.
try {
@@ -58,7 +61,9 @@ int main(int argc, char **argv) {
return 1;
}
- if (OutputFilename != "") { // Specified an output filename?
+ if (DontPrint) {
+ // Just use stdout. We won't actually print anything on it.
+ } else if (OutputFilename != "") { // Specified an output filename?
if (OutputFilename != "-") { // Not stdout?
if (!Force && std::ifstream(OutputFilename.c_str())) {
// If force is not specified, make sure not to overwrite a file!
@@ -102,10 +107,12 @@ int main(int argc, char **argv) {
}
// All that llvm-dis does is write the assembly to a file.
- PassManager Passes;
- OStream L(*Out);
- Passes.add(new PrintModulePass(&L));
- Passes.run(*M.get());
+ if (!DontPrint) {
+ PassManager Passes;
+ OStream L(*Out);
+ Passes.add(new PrintModulePass(&L));
+ Passes.run(*M.get());
+ }
if (Out != &std::cout) {
((std::ofstream*)Out)->close();