summaryrefslogtreecommitdiff
path: root/lib/CodeGen/CodeGenFunction.cpp
diff options
context:
space:
mode:
authorManman Ren <manman.ren@gmail.com>2014-02-06 00:08:15 +0000
committerManman Ren <manman.ren@gmail.com>2014-02-06 00:08:15 +0000
commitc957c9523e0a247d4c2db2ce4ac1f6671e456da9 (patch)
tree28304be69cea0ee0d63d71d76e41a86f64e6d333 /lib/CodeGen/CodeGenFunction.cpp
parenteebc8310220fc2cf11c5b54e0e9a98d158e96e3d (diff)
downloadclang-c957c9523e0a247d4c2db2ce4ac1f6671e456da9.tar.gz
clang-c957c9523e0a247d4c2db2ce4ac1f6671e456da9.tar.bz2
clang-c957c9523e0a247d4c2db2ce4ac1f6671e456da9.tar.xz
Simplify code by combining ifs.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@200893 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CodeGenFunction.cpp')
-rw-r--r--lib/CodeGen/CodeGenFunction.cpp16
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()) {