Transforms: Stop using DIDescriptor::is*() and auto-casting

Same as r234255, but for lib/Analysis and lib/Transforms.

llvm-svn: 234257
This commit is contained in:
Duncan P. N. Exon Smith
2015-04-06 23:27:00 +00:00
parent c755128673
commit 6186fb2cd0
6 changed files with 23 additions and 35 deletions

View File

@@ -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