Simplify code by combining ifs.

llvm-svn: 200893
This commit is contained in:
Manman Ren
2014-02-06 00:08:15 +00:00
parent af4e64d095
commit 9724752f4b

View File

@@ -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()) {