Why does Clang use GCCBuiltInFunctions? How can intrinsics that don't depend on GCC be added?


I noticed that there are a lot of intrinsice in include/llvm/IR/Intrinsics*.td that reference GCCBultIn, and looking at the functions they’re referencing it seems to be based on things already built into GCC. Why is it done this way instead of just building them from scratch (or importing the functions themselves) instead of depending on gcc? Is building target-specific intrinsics from scratch problematic?

It doesn't depend on GCC, it's just a way to provide a name for the intrinsic.