From 4f2c29708d3208197f706f6e8841a2f828aea89c Mon Sep 17 00:00:00 2001 From: Manman Ren Date: Tue, 23 Jul 2013 23:07:38 +0000 Subject: [PATCH] Debug Info: clean up. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187002 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/IR/DebugInfo.cpp | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/lib/IR/DebugInfo.cpp b/lib/IR/DebugInfo.cpp index 1168ef3c94f..0fbfd2da86c 100644 --- a/lib/IR/DebugInfo.cpp +++ b/lib/IR/DebugInfo.cpp @@ -661,9 +661,7 @@ MDNode *DISubprogram::getVariablesNodes() const { } DIArray DISubprogram::getVariables() const { - if (MDNode *T = getNodeField(DbgNode, 18)) - return DIArray(T); - return DIArray(); + return DIArray(getNodeField(DbgNode, 18)); } Value *DITemplateValueParameter::getValue() const { @@ -686,27 +684,21 @@ DIArray DICompileUnit::getEnumTypes() const { if (!DbgNode || DbgNode->getNumOperands() < 13) return DIArray(); - if (MDNode *N = getNodeField(DbgNode, 7)) - return DIArray(N); - return DIArray(); + return DIArray(getNodeField(DbgNode, 7)); } DIArray DICompileUnit::getRetainedTypes() const { if (!DbgNode || DbgNode->getNumOperands() < 13) return DIArray(); - if (MDNode *N = getNodeField(DbgNode, 8)) - return DIArray(N); - return DIArray(); + return DIArray(getNodeField(DbgNode, 8)); } DIArray DICompileUnit::getSubprograms() const { if (!DbgNode || DbgNode->getNumOperands() < 13) return DIArray(); - if (MDNode *N = getNodeField(DbgNode, 9)) - return DIArray(N); - return DIArray(); + return DIArray(getNodeField(DbgNode, 9)); } @@ -714,18 +706,14 @@ DIArray DICompileUnit::getGlobalVariables() const { if (!DbgNode || DbgNode->getNumOperands() < 13) return DIArray(); - if (MDNode *N = getNodeField(DbgNode, 10)) - return DIArray(N); - return DIArray(); + return DIArray(getNodeField(DbgNode, 10)); } DIArray DICompileUnit::getImportedEntities() const { if (!DbgNode || DbgNode->getNumOperands() < 13) return DIArray(); - if (MDNode *N = getNodeField(DbgNode, 11)) - return DIArray(N); - return DIArray(); + return DIArray(getNodeField(DbgNode, 11)); } /// fixupSubprogramName - Replace contains special characters used -- 2.34.1