diff options
Diffstat (limited to 'llvm/lib/Transforms/Scalar/SampleProfile.cpp')
-rw-r--r-- | llvm/lib/Transforms/Scalar/SampleProfile.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Scalar/SampleProfile.cpp b/llvm/lib/Transforms/Scalar/SampleProfile.cpp index f56e2f1d87c..705d042a809 100644 --- a/llvm/lib/Transforms/Scalar/SampleProfile.cpp +++ b/llvm/lib/Transforms/Scalar/SampleProfile.cpp @@ -642,8 +642,7 @@ void SampleProfileLoader::propagateWeights(Function &F) { /// \returns the line number where \p F is defined. If it returns 0, /// it means that there is no debug information available for \p F. unsigned SampleProfileLoader::getFunctionLoc(Function &F) { - DISubprogram S = getDISubprogram(&F); - if (S.isSubprogram()) + if (DISubprogram S = getDISubprogram(&F)) return S.getLineNumber(); // If could not find the start of \p F, emit a diagnostic to inform the user |