KolesnichenkoDS KolesnichenkoDS - 6 months ago 61
C++ Question

What these macros do (LLVM)?

I found this code in Sparc LLVM backend:

extern "C" void LLVMInitializeSparcTargetInfo() {
RegisterTarget<Triple::sparc, /*HasJIT=*/true> X(TheSparcTarget, "sparc",
RegisterTarget<Triple::sparcv9, /*HasJIT=*/true> Y(TheSparcV9Target,
"sparcv9", "Sparc V9");
RegisterTarget<Triple::sparcel, /*HasJIT=*/true> Z(TheSparcelTarget,
"sparcel", "Sparc LE");

I don't understand what
macros do and I cannot find any definition or documentation for them.


What makes you think that these are macros?

To me, X, Y and Z look like throwaway names for instantiation of registration objects.

You should instead be looking for the documentation of RegisterTarget.