]> granicus.if.org Git - clang/commitdiff
Simplify code by combining ifs.
authorManman Ren <manman.ren@gmail.com>
Thu, 6 Feb 2014 00:08:15 +0000 (00:08 +0000)
committerManman Ren <manman.ren@gmail.com>
Thu, 6 Feb 2014 00:08:15 +0000 (00:08 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@200893 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CodeGenFunction.cpp

index ffdbc99c614c681189d46ee0cf03f7b9ba9a91ab..4b3aa1abf369fdd510295e3cdc0e50215b4b941c 100644 (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()) {