diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2018-09-11 22:46:22 -0400 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2018-09-11 22:46:22 -0400 |
| commit | 014cc60a72ac2d64935bf424459b5fa13e281ed9 (patch) | |
| tree | 7f8c43d42297bb52e39366bb45084f7ee6662ae3 /src/zig_llvm.cpp | |
| parent | ee263a15cc8fb52c2ac6053a29168fb15089839b (diff) | |
| download | zig-014cc60a72ac2d64935bf424459b5fa13e281ed9.tar.gz zig-014cc60a72ac2d64935bf424459b5fa13e281ed9.zip | |
rename --enable-timing-info to -ftime-report to match clang
and have it print llvm's internal timing info
Diffstat (limited to 'src/zig_llvm.cpp')
| -rw-r--r-- | src/zig_llvm.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/zig_llvm.cpp b/src/zig_llvm.cpp index a43d2d182c..61287f620c 100644 --- a/src/zig_llvm.cpp +++ b/src/zig_llvm.cpp @@ -30,6 +30,7 @@ #include <llvm/PassRegistry.h> #include <llvm/Support/FileSystem.h> #include <llvm/Support/TargetParser.h> +#include <llvm/Support/Timer.h> #include <llvm/Support/raw_ostream.h> #include <llvm/Target/TargetMachine.h> #include <llvm/Transforms/Coroutines.h> @@ -81,8 +82,11 @@ static const bool assertions_on = false; #endif bool ZigLLVMTargetMachineEmitToFile(LLVMTargetMachineRef targ_machine_ref, LLVMModuleRef module_ref, - const char *filename, ZigLLVM_EmitOutputType output_type, char **error_message, bool is_debug, bool is_small) + const char *filename, ZigLLVM_EmitOutputType output_type, char **error_message, bool is_debug, + bool is_small, bool time_report) { + TimePassesIsEnabled = time_report; + std::error_code EC; raw_fd_ostream dest(filename, EC, sys::fs::F_None); if (EC) { @@ -182,6 +186,9 @@ bool ZigLLVMTargetMachineEmitToFile(LLVMTargetMachineRef targ_machine_ref, LLVMM } } + if (time_report) { + TimerGroup::printAll(errs()); + } return false; } |
