[llvm] Add missing include to X86MCTargetDesc.h (PR #123320)

Stephan Hageboeck via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 17 05:55:09 PST 2025


hageboeck wrote:

> @hageboeck I'm not clear on the motivation for this - why isn't including via SmallVector.h acceptable for gcc15?

Hello @RKSimon,

there is a double motivation:
1. If you follow "include what you use", you would include the standard headers to be "future proof" in case somebody would change the includes of SmallVector.h. This file would break due to its usage of fixed-size fp types if somebody removes the include from SmallVector.h. I find this enough motivation to accept this patch.
2. The real reason I made this PR is a bit more complicated:
  - The root-project uses llvm-18, and will be able to upgrade to the next version only in several months.
  - Due to the missing includes in SmallVector.h (fixed in main) and also in X86MCTargetDesc.h (fixed here), root-project doesn't compile with gcc-15. 
  - Now we could simply patch llvm-18 to get out of the dilemma, and never tell anybody about it. However, we try to  upstream almost all our patches if possible. To work with an older version like llvm-18, we backport these until we are able to upgrade. This will allow future upgrades of llvm to be rebases in which our "local" llvm patches disappear, because they are already in upstream. Let me know if I managed to explain this in an understandable manner ... 😅 
 
In order to do the above, however, I first have to upstream the patch. Once merged, we backport it to llvm-18, and live with a "local" patch until we manage to move to the next llvm version.

@hahnjo or @vgvassilev might be able to help me explain if I didn't manage. 🙂 

https://github.com/llvm/llvm-project/pull/123320


More information about the llvm-commits mailing list