Add new helpers for registering targets.

- Less boilerplate == good.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77052 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Daniel Dunbar
2009-07-25 06:49:55 +00:00
parent 92ccf70ad4
commit 0c795d6187
40 changed files with 188 additions and 344 deletions

View File

@@ -32,7 +32,6 @@
#include "llvm/Transforms/Scalar.h"
#include "llvm/Target/TargetAsmInfo.h"
#include "llvm/Target/TargetData.h"
#include "llvm/Target/TargetMachineRegistry.h"
#include "llvm/Target/TargetRegistry.h"
#include "llvm/Support/CallSite.h"
#include "llvm/Support/CFG.h"
@@ -50,11 +49,10 @@
#include <sstream>
using namespace llvm;
// Register the target.
static RegisterTarget<CTargetMachine> X(TheCBackendTarget, "c", "C backend");
// Force static initialization.
extern "C" void LLVMInitializeCBackendTarget() { }
extern "C" void LLVMInitializeCBackendTarget() {
// Register the target.
RegisterTargetMachine<CTargetMachine> X(TheCBackendTarget);
}
namespace {
/// CBackendNameAllUsedStructsAndMergeFunctions - This pass inserts names for