summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/DebugInfo.cpp
diff options
context:
space:
mode:
authorManman Ren <manman.ren@gmail.com>2013-07-27 01:26:08 +0000
committerManman Ren <manman.ren@gmail.com>2013-07-27 01:26:08 +0000
commit921382ed786805c81a961a2f8ccf5c8fd05f5527 (patch)
tree4ba7bd4d0a81b8a19aae432d624f4014171bb798 /llvm/lib/IR/DebugInfo.cpp
parentcd1e8930ae3bb7c36d8b629b41bc960c55ea569f (diff)
downloadbcm5719-llvm-921382ed786805c81a961a2f8ccf5c8fd05f5527.tar.gz
bcm5719-llvm-921382ed786805c81a961a2f8ccf5c8fd05f5527.zip
Debug Info Verifier: verify SPs in llvm.dbg.sp.
Also always add DIType, DISubprogram and DIGlobalVariable to the list in DebugInfoFinder without checking them, so we can verify them later on. llvm-svn: 187285
Diffstat (limited to 'llvm/lib/IR/DebugInfo.cpp')
-rw-r--r--llvm/lib/IR/DebugInfo.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/llvm/lib/IR/DebugInfo.cpp b/llvm/lib/IR/DebugInfo.cpp
index 58f054cf9fb..e8334f5374e 100644
--- a/llvm/lib/IR/DebugInfo.cpp
+++ b/llvm/lib/IR/DebugInfo.cpp
@@ -908,6 +908,10 @@ void DebugInfoFinder::processModule(const Module &M) {
return;
}
}
+ if (NamedMDNode *SP_Nodes = M.getNamedMetadata("llvm.dbg.sp")) {
+ for (unsigned i = 0, e = SP_Nodes->getNumOperands(); i != e; ++i)
+ processSubprogram(DISubprogram(SP_Nodes->getOperand(i)));
+ }
}
/// processLocation - Process DILocation.
@@ -1029,7 +1033,7 @@ void DebugInfoFinder::processValue(const DbgValueInst *DVI) {
/// addType - Add type into Tys.
bool DebugInfoFinder::addType(DIType DT) {
- if (!DT.isValid())
+ if (!DT)
return false;
if (!NodesSeen.insert(DT))
@@ -1041,6 +1045,8 @@ bool DebugInfoFinder::addType(DIType DT) {
/// addCompileUnit - Add compile unit into CUs.
bool DebugInfoFinder::addCompileUnit(DICompileUnit CU) {
+ if (!CU)
+ return false;
if (!NodesSeen.insert(CU))
return false;
@@ -1050,7 +1056,7 @@ bool DebugInfoFinder::addCompileUnit(DICompileUnit CU) {
/// addGlobalVariable - Add global variable into GVs.
bool DebugInfoFinder::addGlobalVariable(DIGlobalVariable DIG) {
- if (!DIDescriptor(DIG).isGlobalVariable())
+ if (!DIG)
return false;
if (!NodesSeen.insert(DIG))
@@ -1062,7 +1068,7 @@ bool DebugInfoFinder::addGlobalVariable(DIGlobalVariable DIG) {
// addSubprogram - Add subprgoram into SPs.
bool DebugInfoFinder::addSubprogram(DISubprogram SP) {
- if (!DIDescriptor(SP).isSubprogram())
+ if (!SP)
return false;
if (!NodesSeen.insert(SP))
OpenPOWER on IntegriCloud