[Lldb-commits] [PATCH] D53597: Don't type-erase the SymbolContextItem enum

Jim Ingham via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Oct 23 12:39:04 PDT 2018


jingham added a comment.

It would be great not to have to use comments to express what these values mean.  OTOH, having to put in static casts whenever you want to or values together would be a pain, so if there's no way to do it without magic, I'm a little less enthused...

But on the magic: It looks like BitMaskEnum.h pulls in MathTypes.h which pulls in Compiler.h which then pulls in llvm-config.h.  You are supposed to be able to build tools on top of lldb with just the headers that go in LLDB.framework, you are not required to have the full source tree for an lldb build.  I don't want to impose that restriction without very good reason, and fixing this wart doesn't rise to that level.  Anyway, so if we want to include BitMaskEnum.h we would be required to ship a bunch of llvm headers (including some build produced ones IIUC).  I don't think that's a very good idea.

It also looks to me like the value of the largest item + 1 gets baked into the operator overloading code.  What would happen if we decided to add an element to the enum?


https://reviews.llvm.org/D53597





More information about the lldb-commits mailing list