[llvm-dev] get instruction destination register

Tim Northover via llvm-dev llvm-dev at lists.llvm.org
Mon Dec 21 19:22:35 PST 2015


> Forgive me if this is a stupid question question, but I
> don't know how to include this information in my code. I think I have to
> include "ARMBaseInfo.h", and
> #include "../lib/Target/ARM/ARMBaseInfo.h" does not work!

If your pass is ARM-specific, you'd usually put it in the
lib/Target/ARM directory (e.g. ARMLoadStoreOptimizer.cpp). This is
mainly because generic libraries (e.g. libLLVMCodeGen.a) aren't
allowed to depend on individual targets being present. LLVM can be
built without any ARM support at all, in which case ARMBaseInfo.h
(etc) just couldn't be included.

>From lib/Target/ARM, you should just be able to '#include
"ARMBaseInfo.h"'. Though it's more likely to be ARMRegisterInfo.h you
want, for what you've mentioned at least.

Cheers.

Tim.


More information about the llvm-dev mailing list