[PATCH] D79428: [WebAssembly] Added Debug Fixup pass

Paolo Severini via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 15 00:52:33 PDT 2020


paolosev added a comment.

I get assertion failures in debug builds:

  assert(cast<DILocalVariable>(Variable)->isValidLocationForIntrinsic(DL) &&
         "Expected inlined-at fields to agree");

fails, when I compile a test program with -O3, with the following call stack, where MachineFunctionPass is a WebAssemblyDebugFixup:

  >	clang++.exe!llvm::BuildMI(llvm::MachineFunction & MF, const llvm::DebugLoc & DL, const llvm::MCInstrDesc & MCID, bool IsIndirect, llvm::Register Reg, const llvm::MDNode * Variable, const llvm::MDNode * Expr) Line 2040	C++
   	clang++.exe!llvm::BuildMI(llvm::MachineBasicBlock & BB, llvm::MachineInstrBundleIterator<llvm::MachineInstr,0> I, const llvm::DebugLoc & DL, const llvm::MCInstrDesc & MCID, bool IsIndirect, llvm::Register Reg, const llvm::MDNode * Variable, const llvm::MDNode * Expr) Line 2073	C++
   	clang++.exe!`anonymous namespace'::WebAssemblyDebugFixup::runOnMachineFunction(llvm::MachineFunction & MF) Line 125	C++
   	clang++.exe!llvm::MachineFunctionPass::runOnFunction(llvm::Function & F) Line 73	C++
   	clang++.exe!llvm::FPPassManager::runOnFunction(llvm::Function & F) Line 1482	C++

The assertion fails because in llvm/include/llvm/IR/DebugInfoMetadata.h

   bool isValidLocationForIntrinsic(const DILocation *DL) const {
    return DL && getScope()->getSubprogram() == DL->getScope()->getSubprogram();
  }

the DISubprogram* don't match:

  0x0000020cdabea990 {Line=0x00000075 ScopeLine=0x00000076 VirtualIndex=0x00000000 ...}	const llvm::DISubprogram *
  0x0000020cdabefe20 {Line=0x0000004b ScopeLine=0x0000004b VirtualIndex=0x00000000 ...}	const llvm::DISubprogram *


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D79428/new/

https://reviews.llvm.org/D79428





More information about the llvm-commits mailing list