The LLVMBitCodes.h header contains various enums that are updated whenever LLVM's bitcode fundamentally changes. It would be nice to track these changes in a semi-automated way, so that external tools that attempt to parse LLVM's bitstream and bitcode can remain in sync.
Before this change, LLVMBitCodes.h had a single dependency -- it needed the FIRST_APPLICATION_BLOCKID enum value from BitCodes.h. BitCodes.h, in turn, had a whole tree of include dependencies that boiled down to llvm-config.h, meaning that it was impossible to dump the AST of either file without having a partial or full LLVM build tree already present.
To eliminate that requirement, this patch introduces a new leaf-only header, BitCodeEnums.h, which includes the "core" enums originally in BitCodes.h. LLVMBitCodes.h and BitCodes.h both include this new header in turn, preserving the current header relationships while allowing LLVMBitCodes.h to be dumped fully independently with a command like this (run from the repository root):
clang -fsyntax-only -x c++ -Illvm/include -Xclang -ast-dump=json -Xclang -ast-dump-filter -Xclang llvm::bitc::BlockIDs llvm/include/llvm/Bitcode/LLVMBitCodes.h
I recognize that this is a pretty unusual change and perhaps not a guarantee that the LLVM authors would like to make in the general case (i.e., that individual files within LLVM can have their AST dumped with minimal dependencies). However, I believe the criticality/limited scope of the file(s) in this patch warrants an exception. Please let me know if there's any other information I can provide, or anything else I can do to improve this patch!