diff options
Diffstat (limited to 'lib/CodeGen/CodeGenFunction.cpp')
| -rw-r--r-- | lib/CodeGen/CodeGenFunction.cpp | 16 |
1 files changed, 7 insertions, 9 deletions
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()) { |
