Introduce new headers whose inclusion forces linking and
[oota-llvm.git] / include / llvm / InitializeAllTargets.h
1 //===- llvm/InitializeAllTargets.h - Initialize All Targets -----*- C++ -*-===//
2 //
3 //                      The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This header initializes all configured LLVM targets, ensuring that they
11 // are registered.
12 //
13 //===----------------------------------------------------------------------===//
14 #ifndef LLVM_INITIALIZE_ALL_TARGETS_H
15 #define LLVM_INITIALIZE_ALL_TARGETS_H
16
17 namespace llvm {
18
19   // Declare all of the target-initialization functions.
20 #define LLVM_TARGET(TargetName) void Initialize##TargetName##Target();
21 #include "llvm/Config/Targets.def"
22
23   namespace {
24     struct InitializeAllTargets {
25       InitializeAllTargets() {
26         // Call all of the target-initialization functions.
27 #define LLVM_TARGET(TargetName) llvm::Initialize##TargetName##Target();
28 #include "llvm/Config/Targets.def"
29       }
30     } DoInitializeAllTargets;
31   }
32 } // end namespace llvm
33
34 #endif // LLVM_INITIALIZE_ALL_TARGETS_H