Skip to content

LLVMDIFlags need to be flags

LLVMDIFlags is presently defined as an enum, but these are intended to be used by BitOr'ing them together.

The llvm-sys interface has functions that take LLVMDIFlags typed values, and there's no way in safe rust to produce a value that isn't one of the ones listed in the enum. Callers would have to use mem::transmute and risk undefined behaviour.

Maybe these should be a list of static const i32? Or maybe we would like to keep the typesafety of the LLVMDIFlags, but then we would need to have our own type that defined BitOr, BitAnd, etc. There are crates that do this for us.