[all-commits] [llvm/llvm-project] e0582e: [TypeSwitch/Compiler.h] Provide a LLVM_NODEBUG mac...
Chris Lattner via All-commits
all-commits at lists.llvm.org
Mon Oct 11 13:10:11 PDT 2021
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: e0582e69f517c5d4a47f52130ae4bd066c3d8edd
https://github.com/llvm/llvm-project/commit/e0582e69f517c5d4a47f52130ae4bd066c3d8edd
Author: Chris Lattner <clattner at nondot.org>
Date: 2021-10-11 (Mon, 11 Oct 2021)
Changed paths:
M llvm/include/llvm/ADT/TypeSwitch.h
M llvm/include/llvm/Support/Compiler.h
Log Message:
-----------
[TypeSwitch/Compiler.h] Provide a LLVM_NODEBUG macro and use it in TypeSwitch.h
TypeSwitch.h is used pervasively in MLIR and often has dozens of types switched
over. It uses "zero cost" variadic templates to implement the dispatching
mechanism... which isn't zero cost in debug builds, and which causes a massive
problem for actually debugging things that use it - you get dozens of nonsense
frames in the debugger for simple things like a visitor.
Fix this by marking the key method in TypeSwitch as nodebug + alwaysinline.
This resolves LLVM PR49301
Differential Revision: https://reviews.llvm.org/D111520
More information about the All-commits
mailing list