diff options
author | Manman Ren <manman.ren@gmail.com> | 2014-02-06 00:08:15 +0000 |
---|---|---|
committer | Manman Ren <manman.ren@gmail.com> | 2014-02-06 00:08:15 +0000 |
commit | 9724752f4b8864c599feffe11849075d83f26953 (patch) | |
tree | 4309064db0efc90ef2d49d1549ea66ba53d68de8 /clang/lib/CodeGen/CodeGenFunction.cpp | |
parent | af4e64d0955aa47fd6e286ce48eeeed9a9ec7a4a (diff) | |
download | llvm-9724752f4b8864c599feffe11849075d83f26953.zip llvm-9724752f4b8864c599feffe11849075d83f26953.tar.gz llvm-9724752f4b8864c599feffe11849075d83f26953.tar.bz2 |
Simplify code by combining ifs.
llvm-svn: 200893
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp')
-rw-r--r-- | clang/lib/CodeGen/CodeGenFunction.cpp | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp index ffdbc99..4b3aa1a 100644 --- a/clang/lib/CodeGen/CodeGenFunction.cpp +++ b/clang/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()) { |