diff options
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp')
-rw-r--r-- | clang/lib/CodeGen/CodeGenFunction.cpp | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp index ffdbc99..4b3aa1a 100644 --- a/clang/lib/CodeGen/CodeGenFunction.cpp +++ b/clang/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()) { |