[llvm] r185020 - Debug Info: clean up usage of Verify.
Eric Christopher
echristo at gmail.com
Wed Jun 26 15:46:32 PDT 2013
On Wed, Jun 26, 2013 at 2:59 PM, Eric Christopher <echristo at gmail.com> wrote:
> Hi Manman,
>
> Few comments on this:
>
> <snip>
>
> Dave got his email sent out before I did so all of that, plus:
>
> a) You appear to have broken the ppc64-linux bot:
>
> http://lab.llvm.org:8011/builders/llvm-ppc64-linux1/builds/6484/steps/test-llvm/logs/LLVM%3A%3Adebuginfo.ll
>
Actually a lot more than that bot. I've reverted that here:
M lib/Target/NVPTX/NVPTXAsmPrinter.cpp
M lib/Transforms/Utils/Local.cpp
M lib/Transforms/Instrumentation/GCOVProfiling.cpp
M tools/opt/opt.cpp
r185032 = 43cdd7c3695cdd35277b5e39754b329e14c9868e (refs/remotes/origin/master)
Thanks!
-eric
> b)
>
>> + assert(SP.isSubprogram());
>
> Some sort of descriptive text is really useful here. A comment, or
> something (we often will use && "<some condition failed>" in the
> assert to be descriptive.
>
> Thanks!
>
> -eric
>
>>
>> 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";
>>
>>
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
More information about the llvm-commits
mailing list