[llvm-commits] [llvm] r76253 - /llvm/trunk/include/llvm/Target/TargetSelect.h

Daniel Dunbar daniel at zuster.org
Fri Jul 17 15:35:36 PDT 2009


Author: ddunbar
Date: Fri Jul 17 17:35:35 2009
New Revision: 76253

URL: http://llvm.org/viewvc/llvm-project?rev=76253&view=rev
Log:
Add llvm::InitializeAllTargetInfos and llvm::InitializeAllAsmParsers.

Modified:
    llvm/trunk/include/llvm/Target/TargetSelect.h

Modified: llvm/trunk/include/llvm/Target/TargetSelect.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetSelect.h?rev=76253&r1=76252&r2=76253&view=diff

==============================================================================
--- llvm/trunk/include/llvm/Target/TargetSelect.h (original)
+++ llvm/trunk/include/llvm/Target/TargetSelect.h Fri Jul 17 17:35:35 2009
@@ -26,29 +26,42 @@
 #define LLVM_TARGET(TargetName) void LLVMInitialize##TargetName##Target();
 #include "llvm/Config/Targets.def"
   
-  // Declare all of the available asm-printer initialization functions.
+  // Declare all of the available assembly printer initialization functions.
 #define LLVM_ASM_PRINTER(TargetName) void LLVMInitialize##TargetName##AsmPrinter();
 #include "llvm/Config/AsmPrinters.def"
+
+  // Declare all of the available assembly parser initialization functions.
+#define LLVM_ASM_PARSER(TargetName) void LLVMInitialize##TargetName##AsmParser();
+#include "llvm/Config/AsmParsers.def"
 }
 
 namespace llvm {
-  /// InitializeAllTargets - The main program should call this function if it
-  /// wants access to all available targets that LLVM is configured to
-  /// support. This allows the client to query the available targets using the
-  /// target registration mechanisms.
+  /// InitializeAllTargetInfos - The main program should call this function if
+  /// it wants access to all available targets that LLVM is configured to
+  /// support, to make them available via the TargetRegistry.
   ///
   /// It is legal for a client to make multiple calls to this function.
-  inline void InitializeAllTargets() {
+  inline void InitializeAllTargetInfos() {
 #define LLVM_TARGET(TargetName) LLVMInitialize##TargetName##TargetInfo();
 #include "llvm/Config/Targets.def"
+  }
+  
+  /// InitializeAllTargets - The main program should call this function if it
+  /// wants access to all available target machines that LLVM is configured to
+  /// support, to make them available via the TargetRegistry.
+  ///
+  /// It is legal for a client to make multiple calls to this function.
+  inline void InitializeAllTargets() {
+    // FIXME: Remove this, clients should do it.
+    InitializeAllTargetInfos();
 
 #define LLVM_TARGET(TargetName) LLVMInitialize##TargetName##Target();
 #include "llvm/Config/Targets.def"
   }
   
   /// InitializeAllAsmPrinters - The main program should call this function if
-  /// it wants all asm printers that LLVM is configured to support.  This will
-  /// cause them to be linked into its executable.
+  /// it wants all asm printers that LLVM is configured to support, to make them
+  /// available via the TargetRegistry.
   ///
   /// It is legal for a client to make multiple calls to this function.
   inline void InitializeAllAsmPrinters() {
@@ -56,6 +69,16 @@
 #include "llvm/Config/AsmPrinters.def"
   }
   
+  /// InitializeAllAsmParsers - The main program should call this function if it
+  /// wants all asm parsers that LLVM is configured to support, to make them
+  /// available via the TargetRegistry.
+  ///
+  /// It is legal for a client to make multiple calls to this function.
+  inline void InitializeAllAsmParsers() {
+#define LLVM_ASM_PARSER(TargetName) LLVMInitialize##TargetName##AsmParser();
+#include "llvm/Config/AsmParsers.def"
+  }
+  
   /// InitializeNativeTarget - The main program should call this function to
   /// initialize the native target corresponding to the host.  This is useful 
   /// for JIT applications to ensure that the target gets linked in correctly.





More information about the llvm-commits mailing list