[llvm-commits] [patch] pr7852 - Make LLVM robust to #define ARCH pollution by removing fragile macros.

Xerxes Rånby xerxes at zafena.se
Tue Aug 10 05:33:48 PDT 2010


On 2010-08-10 12:45, Xerxes Rånby wrote:
> patch: http://llvm.org/bugs/attachment.cgi?id=5357
>
> Remove use of fragile macros to define native target init function names in
> include/llvm/Target/TargetSelect.h and llvm/include/llvm-c/Target.h
>
> Instead of using macros the native target init function names are
> resolved at config.h generation time by setting three new defines.
> /* LLVM name for the native Target init function, if available */
> #cmakedefine LLVM_NATIVE_TARGET LLVMInitialize${LLVM_NATIVE_ARCH}Target
>
> /* LLVM name for the native TargetInfo init function, if available */
> #cmakedefine LLVM_NATIVE_TARGETINFO
> LLVMInitialize${LLVM_NATIVE_ARCH}TargetInfo
>
> /* LLVM name for the native AsmPrinter init function, if available */
> #cmakedefine LLVM_NATIVE_ASMPRINTER
> LLVMInitialize${LLVM_NATIVE_ARCH}AsmPrinter
>
> Updated include/llvm/Target/TargetSelect.h and
> llvm/include/llvm-c/Target.h use the new defines.
>
> Changed LLVM_NATIVE_ARCH define to actually contain the
> ${LLVM_NATIVE_ARCH} value.
>
> I have tested this patch using cmake and configure.
> I need help regenerating the configure using autotools 2.60 since i have
> changed autoconf/configure.ac.
>
> Cheers
> Xerxes
>   

Updated patch to include changes to llvm/cmake/config-ix.cmake

LLVM_NATIVE_ARCHNAME are removed since it got replaced by LLVM_NATIVE_ARCH.

Cheers
Xerxes
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 10aug-v4-llvm-config-no-arch-macro.patch
Type: text/x-patch
Size: 8431 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20100810/d17302f0/attachment.bin>


More information about the llvm-commits mailing list