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: [email protected]
          Reporter: [email protected]
                CC: [email protected]

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.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to