[llvm] r185020 - Debug Info: clean up usage of Verify.
Manman Ren
mren at apple.com
Wed Jun 26 14:26:10 PDT 2013
Author: mren
Date: Wed Jun 26 16:26:10 2013
New Revision: 185020
URL: http://llvm.org/viewvc/llvm-project?rev=185020&view=rev
Log:
Debug Info: clean up usage of Verify.
No functionality change.
It should suffice to check the type of a debug info metadata, instead of
calling Verify.
Modified:
llvm/trunk/lib/Target/NVPTX/NVPTXAsmPrinter.cpp
llvm/trunk/lib/Transforms/Instrumentation/GCOVProfiling.cpp
llvm/trunk/lib/Transforms/Utils/Local.cpp
llvm/trunk/tools/opt/opt.cpp
Modified: llvm/trunk/lib/Target/NVPTX/NVPTXAsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/NVPTX/NVPTXAsmPrinter.cpp?rev=185020&r1=185019&r2=185020&view=diff
==============================================================================
--- llvm/trunk/lib/Target/NVPTX/NVPTXAsmPrinter.cpp (original)
+++ llvm/trunk/lib/Target/NVPTX/NVPTXAsmPrinter.cpp Wed Jun 26 16:26:10 2013
@@ -279,7 +279,7 @@ void NVPTXAsmPrinter::emitLineNumberAsDo
const LLVMContext &ctx = MF->getFunction()->getContext();
DIScope Scope(curLoc.getScope(ctx));
- if (!Scope.Verify())
+ if (!Scope.isScope())
return;
StringRef fileName(Scope.getFilename());
Modified: llvm/trunk/lib/Transforms/Instrumentation/GCOVProfiling.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Instrumentation/GCOVProfiling.cpp?rev=185020&r1=185019&r2=185020&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Instrumentation/GCOVProfiling.cpp (original)
+++ llvm/trunk/lib/Transforms/Instrumentation/GCOVProfiling.cpp Wed Jun 26 16:26:10 2013
@@ -434,7 +434,7 @@ void GCOVProfiler::emitProfileNotes() {
DIArray SPs = CU.getSubprograms();
for (unsigned i = 0, e = SPs.getNumElements(); i != e; ++i) {
DISubprogram SP(SPs.getElement(i));
- if (!SP.Verify()) continue;
+ assert(SP.isSubprogram());
Function *F = SP.getFunction();
if (!F) continue;
@@ -483,7 +483,7 @@ bool GCOVProfiler::emitProfileArcs() {
SmallVector<std::pair<GlobalVariable *, MDNode *>, 8> CountersBySP;
for (unsigned i = 0, e = SPs.getNumElements(); i != e; ++i) {
DISubprogram SP(SPs.getElement(i));
- if (!SP.Verify()) continue;
+ assert(SP.isSubprogram());
Function *F = SP.getFunction();
if (!F) continue;
if (!Result) Result = true;
Modified: llvm/trunk/lib/Transforms/Utils/Local.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/Local.cpp?rev=185020&r1=185019&r2=185020&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Utils/Local.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/Local.cpp Wed Jun 26 16:26:10 2013
@@ -854,7 +854,7 @@ static bool LdStHasDebugValue(DIVariable
bool llvm::ConvertDebugDeclareToDebugValue(DbgDeclareInst *DDI,
StoreInst *SI, DIBuilder &Builder) {
DIVariable DIVar(DDI->getVariable());
- if (!DIVar.Verify())
+ if (!DIVar.isVariable())
return false;
if (LdStHasDebugValue(DIVar, SI))
@@ -888,7 +888,7 @@ bool llvm::ConvertDebugDeclareToDebugVal
bool llvm::ConvertDebugDeclareToDebugValue(DbgDeclareInst *DDI,
LoadInst *LI, DIBuilder &Builder) {
DIVariable DIVar(DDI->getVariable());
- if (!DIVar.Verify())
+ if (!DIVar.isVariable())
return false;
if (LdStHasDebugValue(DIVar, LI))
@@ -961,7 +961,7 @@ bool llvm::replaceDbgDeclareForAlloca(Al
if (!DDI)
return false;
DIVariable DIVar(DDI->getVariable());
- if (!DIVar.Verify())
+ if (!DIVar.isVariable())
return false;
// Create a copy of the original DIDescriptor for user variable, appending
Modified: llvm/trunk/tools/opt/opt.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/opt/opt.cpp?rev=185020&r1=185019&r2=185020&view=diff
==============================================================================
--- llvm/trunk/tools/opt/opt.cpp (original)
+++ llvm/trunk/tools/opt/opt.cpp Wed Jun 26 16:26:10 2013
@@ -389,8 +389,8 @@ struct BreakpointPrinter : public Module
for (unsigned i = 0, e = NMD->getNumOperands(); i != e; ++i) {
std::string Name;
DISubprogram SP(NMD->getOperand(i));
- if (SP.Verify())
- getContextName(SP.getContext(), Name);
+ assert(SP.isSubprogram());
+ getContextName(SP.getContext(), Name);
Name = Name + SP.getDisplayName().str();
if (!Name.empty() && Processed.insert(Name)) {
Out << Name << "\n";
More information about the llvm-commits
mailing list