Index: llvm/trunk/lib/Target/WebAssembly/WebAssemblyAddMissingPrototypes.cpp =================================================================== --- llvm/trunk/lib/Target/WebAssembly/WebAssemblyAddMissingPrototypes.cpp +++ llvm/trunk/lib/Target/WebAssembly/WebAssemblyAddMissingPrototypes.cpp @@ -60,7 +60,7 @@ } bool WebAssemblyAddMissingPrototypes::runOnModule(Module &M) { - LLVM_DEBUG(dbgs() << "runnning AddMissingPrototypes\n"); + LLVM_DEBUG(dbgs() << "********** Add Missing Prototypes **********\n"); std::vector> Replacements; Index: llvm/trunk/lib/Target/WebAssembly/WebAssemblyCallIndirectFixup.cpp =================================================================== --- llvm/trunk/lib/Target/WebAssembly/WebAssemblyCallIndirectFixup.cpp +++ llvm/trunk/lib/Target/WebAssembly/WebAssemblyCallIndirectFixup.cpp @@ -98,7 +98,7 @@ bool WebAssemblyCallIndirectFixup::runOnMachineFunction(MachineFunction &MF) { LLVM_DEBUG(dbgs() << "********** Fixing up CALL_INDIRECTs **********\n" - << MF.getName() << '\n'); + << "********** Function: " << MF.getName() << '\n'); bool Changed = false; const WebAssemblyInstrInfo *TII = Index: llvm/trunk/lib/Target/WebAssembly/WebAssemblyEHRestoreStackPointer.cpp =================================================================== --- llvm/trunk/lib/Target/WebAssembly/WebAssemblyEHRestoreStackPointer.cpp +++ llvm/trunk/lib/Target/WebAssembly/WebAssemblyEHRestoreStackPointer.cpp @@ -53,6 +53,10 @@ bool WebAssemblyEHRestoreStackPointer::runOnMachineFunction( MachineFunction &MF) { + LLVM_DEBUG(dbgs() << "********** EH Restore Stack Pointer **********\n" + "********** Function: " + << MF.getName() << '\n'); + const auto *FrameLowering = static_cast( MF.getSubtarget().getFrameLowering()); if (!FrameLowering->needsPrologForEH(MF)) Index: llvm/trunk/lib/Target/WebAssembly/WebAssemblyExceptionInfo.cpp =================================================================== --- llvm/trunk/lib/Target/WebAssembly/WebAssemblyExceptionInfo.cpp +++ llvm/trunk/lib/Target/WebAssembly/WebAssemblyExceptionInfo.cpp @@ -32,7 +32,10 @@ INITIALIZE_PASS_END(WebAssemblyExceptionInfo, DEBUG_TYPE, "WebAssembly Exception Information", true, true) -bool WebAssemblyExceptionInfo::runOnMachineFunction(MachineFunction &F) { +bool WebAssemblyExceptionInfo::runOnMachineFunction(MachineFunction &MF) { + LLVM_DEBUG(dbgs() << "********** Exception Info Calculation **********\n" + "********** Function: " + << MF.getName() << '\n'); releaseMemory(); auto &MDT = getAnalysis(); auto &MDF = getAnalysis(); Index: llvm/trunk/lib/Target/WebAssembly/WebAssemblyFixFunctionBitcasts.cpp =================================================================== --- llvm/trunk/lib/Target/WebAssembly/WebAssemblyFixFunctionBitcasts.cpp +++ llvm/trunk/lib/Target/WebAssembly/WebAssemblyFixFunctionBitcasts.cpp @@ -228,6 +228,8 @@ } bool FixFunctionBitcasts::runOnModule(Module &M) { + LLVM_DEBUG(dbgs() << "********** Fix Function Bitcasts **********\n"); + Function *Main = nullptr; CallInst *CallMain = nullptr; SmallVector, 0> Uses; Index: llvm/trunk/lib/Target/WebAssembly/WebAssemblyISelDAGToDAG.cpp =================================================================== --- llvm/trunk/lib/Target/WebAssembly/WebAssemblyISelDAGToDAG.cpp +++ llvm/trunk/lib/Target/WebAssembly/WebAssemblyISelDAGToDAG.cpp @@ -50,6 +50,10 @@ } bool runOnMachineFunction(MachineFunction &MF) override { + LLVM_DEBUG(dbgs() << "********** ISelDAGToDAG **********\n" + "********** Function: " + << MF.getName() << '\n'); + ForCodeSize = MF.getFunction().hasFnAttribute(Attribute::OptimizeForSize) || MF.getFunction().hasFnAttribute(Attribute::MinSize); Subtarget = &MF.getSubtarget(); Index: llvm/trunk/lib/Target/WebAssembly/WebAssemblyLateEHPrepare.cpp =================================================================== --- llvm/trunk/lib/Target/WebAssembly/WebAssemblyLateEHPrepare.cpp +++ llvm/trunk/lib/Target/WebAssembly/WebAssemblyLateEHPrepare.cpp @@ -103,6 +103,10 @@ } bool WebAssemblyLateEHPrepare::runOnMachineFunction(MachineFunction &MF) { + LLVM_DEBUG(dbgs() << "********** Late EH Prepare **********\n" + "********** Function: " + << MF.getName() << '\n'); + if (MF.getTarget().getMCAsmInfo()->getExceptionHandlingType() != ExceptionHandling::Wasm) return false; Index: llvm/trunk/lib/Target/WebAssembly/WebAssemblyLowerEmscriptenEHSjLj.cpp =================================================================== --- llvm/trunk/lib/Target/WebAssembly/WebAssemblyLowerEmscriptenEHSjLj.cpp +++ llvm/trunk/lib/Target/WebAssembly/WebAssemblyLowerEmscriptenEHSjLj.cpp @@ -623,6 +623,8 @@ } bool WebAssemblyLowerEmscriptenEHSjLj::runOnModule(Module &M) { + LLVM_DEBUG(dbgs() << "********** Lower Emscripten EH & SjLj **********\n"); + LLVMContext &C = M.getContext(); IRBuilder<> IRB(C); Index: llvm/trunk/lib/Target/WebAssembly/WebAssemblyLowerGlobalDtors.cpp =================================================================== --- llvm/trunk/lib/Target/WebAssembly/WebAssemblyLowerGlobalDtors.cpp +++ llvm/trunk/lib/Target/WebAssembly/WebAssemblyLowerGlobalDtors.cpp @@ -59,6 +59,8 @@ } bool LowerGlobalDtors::runOnModule(Module &M) { + LLVM_DEBUG(dbgs() << "********** Lower Global Destructors **********\n"); + GlobalVariable *GV = M.getGlobalVariable("llvm.global_dtors"); if (!GV) return false; Index: llvm/trunk/lib/Target/WebAssembly/WebAssemblyOptimizeReturned.cpp =================================================================== --- llvm/trunk/lib/Target/WebAssembly/WebAssemblyOptimizeReturned.cpp +++ llvm/trunk/lib/Target/WebAssembly/WebAssemblyOptimizeReturned.cpp @@ -74,6 +74,10 @@ } bool OptimizeReturned::runOnFunction(Function &F) { + LLVM_DEBUG(dbgs() << "********** Optimize returned Attributes **********\n" + "********** Function: " + << F.getName() << '\n'); + DT = &getAnalysis().getDomTree(); visit(F); return true;