mirror of
https://github.com/intel/llvm.git
synced 2026-01-31 16:29:50 +08:00
Simplify code by combining ifs.
llvm-svn: 200893
This commit is contained in:
@@ -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()) {
|
||||
|
||||
Reference in New Issue
Block a user