KolesnichenkoDS KolesnichenkoDS - 1 year ago 125
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.

Answer Source

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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download