r200893 - Simplify code by combining ifs.
Manman Ren
manman.ren at gmail.com
Wed Feb 5 16:08:15 PST 2014
Author: mren
Date: Wed Feb 5 18:08:15 2014
New Revision: 200893
URL: http://llvm.org/viewvc/llvm-project?rev=200893&view=rev
Log:
Simplify code by combining ifs.
Modified:
cfe/trunk/lib/CodeGen/CodeGenFunction.cpp
Modified: cfe/trunk/lib/CodeGen/CodeGenFunction.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenFunction.cpp?rev=200893&r1=200892&r2=200893&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenFunction.cpp (original)
+++ cfe/trunk/lib/CodeGen/CodeGenFunction.cpp Wed Feb 5 18:08:15 2014
@@ -591,15 +591,13 @@ void CodeGenFunction::StartFunction(Glob
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()) {
More information about the cfe-commits
mailing list