diff options
author | Daniel Dunbar <daniel@zuster.org> | 2011-02-10 17:32:22 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2011-02-10 17:32:22 +0000 |
commit | 468a8f8756aad2c42807d916b96f95f98b417a91 (patch) | |
tree | 1c1bb84ff4b99d7e671338b8c5b3d8d55f8dbc35 /clang/lib/CodeGen/CodeGenFunction.cpp | |
parent | 09b6989ef0589d979c017eca2f3763a4170743f8 (diff) | |
download | bcm5719-llvm-468a8f8756aad2c42807d916b96f95f98b417a91.tar.gz bcm5719-llvm-468a8f8756aad2c42807d916b96f95f98b417a91.zip |
IRgen: Fix an immediate-exit-from-fn style nit.
llvm-svn: 125289
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp')
-rw-r--r-- | clang/lib/CodeGen/CodeGenFunction.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp index 364f2697e60..5a4f2b70e33 100644 --- a/clang/lib/CodeGen/CodeGenFunction.cpp +++ b/clang/lib/CodeGen/CodeGenFunction.cpp @@ -126,7 +126,8 @@ void CodeGenFunction::FinishFunction(SourceLocation EndLoc) { // Emit function epilog (to return). EmitReturnBlock(); - EmitFunctionInstrumentation("__cyg_profile_func_exit"); + if (ShouldInstrumentFunction()) + EmitFunctionInstrumentation("__cyg_profile_func_exit"); // Emit debug descriptor for function end. if (CGDebugInfo *DI = getDebugInfo()) { @@ -185,9 +186,6 @@ bool CodeGenFunction::ShouldInstrumentFunction() { /// instrumentation function with the current function and the call site, if /// function instrumentation is enabled. void CodeGenFunction::EmitFunctionInstrumentation(const char *Fn) { - if (!ShouldInstrumentFunction()) - return; - const llvm::PointerType *PointerTy; const llvm::FunctionType *FunctionTy; std::vector<const llvm::Type*> ProfileFuncArgs; @@ -267,7 +265,8 @@ void CodeGenFunction::StartFunction(GlobalDecl GD, QualType RetTy, DI->EmitFunctionStart(GD, FnType, CurFn, Builder); } - EmitFunctionInstrumentation("__cyg_profile_func_enter"); + if (ShouldInstrumentFunction()) + EmitFunctionInstrumentation("__cyg_profile_func_enter"); if (CGM.getCodeGenOpts().InstrumentForProfiling) EmitMCountInstrumentation(); |