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 | a18652fe1e8233fbf8b67484945c7f7b2bf272be (patch) | |
tree | 3ae4df564445e0b03d4d0111302b1809cc9960e2 /lib/CodeGen/CodeGenFunction.cpp | |
parent | cfbf1c7536e016dc275139dd842d4a5f059a749f (diff) |
IRgen: Fix an immediate-exit-from-fn style nit.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125289 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CodeGenFunction.cpp')
-rw-r--r-- | lib/CodeGen/CodeGenFunction.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/CodeGen/CodeGenFunction.cpp b/lib/CodeGen/CodeGenFunction.cpp index 364f2697e6..5a4f2b70e3 100644 --- a/lib/CodeGen/CodeGenFunction.cpp +++ b/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(); |