regarding TargetRegisterInfo.h

Dear,

I have been going through the Targets registered with llvm. As I was looking around, I found an include statement in the file XXXRegisterInfo.h (XXX is any target),

#include “llvm/Target/TargetRegisterInfo.h”

The question is there is no folder called Target in my llvm directory (file TargetRegistorInfo.h missing ) and still programs compile in the XXX architecture. I want access to TargetRegisterInfo.h.
Can someone point me in the right direction?

Hi Pratik,

The question is there is no folder called Target in my llvm directory (file
TargetRegistorInfo.h missing ) and still programs compile in the XXX
architecture. I want access to TargetRegisterInfo.h.
Can someone point me in the right direction?

Includes are mostly relative to "include/". In this case
"include/llvm/Target/TargetRegisterInfo.h".

Cheers.

Tim.

Dear Tim,

Thank you for replying back. I could find the file.

But when I try running tblgen on one of the .td’s which has such an include statement I get “file not found error”

eg: llvm-tblgen X86.td gives file not found where X86.td has an include statement namely "include “llvm\Target\Target.td”.

Can you please clear this too?

Regards,

Pratik

Can you please clear this too?

Yep. The easiest way is to run make in verbose mode ("make VERBOSE=1")
and copy its command-line, but basically you also need to specify the
include directories: "llvm-tblgen X86.td -I . -I ../../../include".

Cheers.

Tim.

Dear Tim,

Worked like a charm. Thank you very much.

Regards,

Pratik