From c957c9523e0a247d4c2db2ce4ac1f6671e456da9 Mon Sep 17 00:00:00 2001 From: Manman Ren Date: Thu, 6 Feb 2014 00:08:15 +0000 Subject: Simplify code by combining ifs. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@200893 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CodeGenFunction.cpp | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'lib/CodeGen/CodeGenFunction.cpp') diff --git a/lib/CodeGen/CodeGenFunction.cpp b/lib/CodeGen/CodeGenFunction.cpp index ffdbc99c61..4b3aa1abf3 100644 --- a/lib/CodeGen/CodeGenFunction.cpp +++ b/lib/CodeGen/CodeGenFunction.cpp @@ -591,15 +591,13 @@ void CodeGenFunction::StartFunction(GlobalDecl GD, EmitMCountInstrumentation(); PGO.assignRegionCounters(GD); - if (CGM.getPGOData()) { - if (D) { - // Turn on InlineHint attribute for hot functions. - if (CGM.getPGOData()->isHotFunction(CGM.getMangledName(GD))) - Fn->addFnAttr(llvm::Attribute::InlineHint); - // Turn on Cold attribute for cold functions. - else if (CGM.getPGOData()->isColdFunction(CGM.getMangledName(GD))) - Fn->addFnAttr(llvm::Attribute::Cold); - } + if (CGM.getPGOData() && D) { + // Turn on InlineHint attribute for hot functions. + if (CGM.getPGOData()->isHotFunction(CGM.getMangledName(GD))) + Fn->addFnAttr(llvm::Attribute::InlineHint); + // Turn on Cold attribute for cold functions. + else if (CGM.getPGOData()->isColdFunction(CGM.getMangledName(GD))) + Fn->addFnAttr(llvm::Attribute::Cold); } if (RetTy->isVoidType()) { -- cgit v1.2.3