aboutsummaryrefslogtreecommitdiff
path: root/src/zig_llvm.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2018-09-16 10:51:58 -0400
committerAndrew Kelley <superjoe30@gmail.com>2018-09-16 10:51:58 -0400
commita2abdb185f9e47b663edce1bdfa3fa525502f321 (patch)
tree9027e6f6886937afa463563dae176e5757cf006e /src/zig_llvm.cpp
parenta6bf37f8ca5a2eabc7cacb22696d2a2c622a993d (diff)
parent780e5674467ebac4534cd3d3f2199ccaf1d0922c (diff)
downloadzig-a2abdb185f9e47b663edce1bdfa3fa525502f321.tar.gz
zig-a2abdb185f9e47b663edce1bdfa3fa525502f321.zip
Merge remote-tracking branch 'origin/master' into llvm7
Diffstat (limited to 'src/zig_llvm.cpp')
-rw-r--r--src/zig_llvm.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/zig_llvm.cpp b/src/zig_llvm.cpp
index ec46c37d96..ad8edb4cda 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>
@@ -82,8 +83,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) {
@@ -183,6 +187,9 @@ bool ZigLLVMTargetMachineEmitToFile(LLVMTargetMachineRef targ_machine_ref, LLVMM
}
}
+ if (time_report) {
+ TimerGroup::printAll(errs());
+ }
return false;
}