From dd54ffda263a17bddb0ad04a670916125972929a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Sj=C3=B6din?= Date: Wed, 9 Mar 2011 17:25:46 +0000 Subject: Add InitializeNativeAsmParser function. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127341 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/Config/config.h.in | 3 +++ include/llvm/Config/llvm-config.h.cmake | 3 +++ include/llvm/Config/llvm-config.h.in | 3 +++ include/llvm/Target/TargetSelect.h | 13 +++++++++++++ 4 files changed, 22 insertions(+) (limited to 'include') diff --git a/include/llvm/Config/config.h.in b/include/llvm/Config/config.h.in index 14c44b4..29f5c93 100644 --- a/include/llvm/Config/config.h.in +++ b/include/llvm/Config/config.h.in @@ -567,6 +567,9 @@ /* LLVM architecture name for the native architecture, if available */ #undef LLVM_NATIVE_ARCH +/* LLVM name for the native AsmParser init function, if available */ +#undef LLVM_NATIVE_ASMPARSER + /* LLVM name for the native AsmPrinter init function, if available */ #undef LLVM_NATIVE_ASMPRINTER diff --git a/include/llvm/Config/llvm-config.h.cmake b/include/llvm/Config/llvm-config.h.cmake index 33a4035..9a9cb3b 100644 --- a/include/llvm/Config/llvm-config.h.cmake +++ b/include/llvm/Config/llvm-config.h.cmake @@ -61,6 +61,9 @@ /* LLVM name for the native AsmPrinter init function, if available */ #cmakedefine LLVM_NATIVE_ASMPRINTER LLVMInitialize${LLVM_NATIVE_ARCH}AsmPrinter +/* LLVM name for the native AsmPrinter init function, if available */ +#cmakedefine LLVM_NATIVE_ASMPARSER LLVMInitialize${LLVM_NATIVE_ARCH}AsmParser + /* Define if this is Unixish platform */ #cmakedefine LLVM_ON_UNIX ${LLVM_ON_UNIX} diff --git a/include/llvm/Config/llvm-config.h.in b/include/llvm/Config/llvm-config.h.in index e7a04ee..4766a7a 100644 --- a/include/llvm/Config/llvm-config.h.in +++ b/include/llvm/Config/llvm-config.h.in @@ -61,6 +61,9 @@ /* LLVM name for the native AsmPrinter init function, if available */ #undef LLVM_NATIVE_ASMPRINTER +/* LLVM name for the native AsmPrinter init function, if available */ +#undef LLVM_NATIVE_ASMPARSER + /* Define if this is Unixish platform */ #undef LLVM_ON_UNIX diff --git a/include/llvm/Target/TargetSelect.h b/include/llvm/Target/TargetSelect.h index 1891f87..c5ab90b 100644 --- a/include/llvm/Target/TargetSelect.h +++ b/include/llvm/Target/TargetSelect.h @@ -120,6 +120,19 @@ namespace llvm { return true; #endif } + + /// InitializeNativeTargetAsmParser - The main program should call + /// this function to initialize the native target asm parser. + inline bool InitializeNativeTargetAsmParser() { + // If we have a native target, initialize the corresponding asm parser. +#ifdef LLVM_NATIVE_ASMPARSER + LLVM_NATIVE_ASMPARSER(); + return false; +#else + return true; +#endif + } + } #endif -- cgit v1.1