[llvm-bugs] [Bug 49301] New: Hide some things from the debugger

via llvm-bugs llvm-bugs at lists.llvm.org
Sun Feb 21 12:28:52 PST 2021


https://bugs.llvm.org/show_bug.cgi?id=49301

            Bug ID: 49301
           Summary: Hide some things from the debugger
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Support Libraries
          Assignee: unassignedbugs at nondot.org
          Reporter: clattner at nondot.org
                CC: llvm-bugs at lists.llvm.org

LLVM has a bunch of stuff that relies on deep template instantiation, which
makes operating a debugger pretty annoying.  The most egregious of which lately
is TypeSwitch, which is used in MLIR pretty extensively (you get one frame for
every type you switchon, and you can have dozens).

I have this hack in my tree which solves the problem for me, it seems that we
should add a macro for this in Support/Compiler.h.  Is anyone opposed to that?

Hack to TypeSwitch.h:

 /// Invoke a case on the derived class with multiple case types.
  template <typename CaseT, typename CaseT2, typename... CaseTs,
            typename CallableT>
  __attribute__((__always_inline__,
                 __nodebug__)) // Hide from debugger.
  DerivedT &
  Case(CallableT &&caseFn) {
    DerivedT &derived = static_cast<DerivedT &>(*this);
    return derived.template Case<CaseT>(caseFn)
        .template Case<CaseT2, CaseTs...>(caseFn);
  }

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20210221/6a49e263/attachment.html>


More information about the llvm-bugs mailing list