[llvm] r194140 - [llvm-c] Add functions for initializing native AsmPrinter, AsmParser & Disassembler

Peter Zotov whitequark at whitequark.org
Wed Nov 6 01:21:35 PST 2013


Author: whitequark
Date: Wed Nov  6 03:21:35 2013
New Revision: 194140

URL: http://llvm.org/viewvc/llvm-project?rev=194140&view=rev
Log:
[llvm-c] Add functions for initializing native AsmPrinter, AsmParser & Disassembler

Original patch by Chris Wailes

Modified:
    llvm/trunk/include/llvm-c/Target.h

Modified: llvm/trunk/include/llvm-c/Target.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm-c/Target.h?rev=194140&r1=194139&r2=194140&view=diff
==============================================================================
--- llvm/trunk/include/llvm-c/Target.h (original)
+++ llvm/trunk/include/llvm-c/Target.h Wed Nov  6 03:21:35 2013
@@ -146,6 +146,42 @@ static inline LLVMBool LLVMInitializeNat
 #endif
 }
 
+/** LLVMInitializeNativeTargetAsmParser - The main program should call this
+    function to initialize the parser for the native target corresponding to the
+    host. */
+static inline LLVMBool LLVMInitializeNativeTargetAsmParser(void) {
+#ifdef LLVM_NATIVE_TARGET
+  LLVM_NATIVE_ASMPARSER();
+  return 0;
+#else
+  return 1;
+#endif
+}
+
+/** LLVMInitializeNativeTargetAsmPrinter - The main program should call this
+    function to initialize the printer for the native target corresponding to
+    the host. */
+static inline LLVMBool LLVMInitializeNativeTargetAsmPrinter(void) {
+#ifdef LLVM_NATIVE_TARGET
+  LLVM_NATIVE_ASMPRINTER();
+  return 0;
+#else
+  return 1;
+#endif
+}
+
+/** LLVMInitializeNativeTargetDisassembler - The main program should call this
+    function to initialize the disassembler for the native target corresponding
+    to the host. */
+static inline LLVMBool LLVMInitializeNativeTargetDisassembler(void) {
+#ifdef LLVM_NATIVE_TARGET
+  LLVM_NATIVE_DISASSEMBLER();
+  return 0;
+#else
+  return 1;
+#endif
+}
+
 /*===-- Target Data -------------------------------------------------------===*/
 
 /** Creates target data from a target layout string.





More information about the llvm-commits mailing list