~ubuntu-branches/ubuntu/feisty/clamav/feisty

« back to all changes in this revision

Viewing changes to libclamav/c++/llvm/include/llvm/CodeGen/LinkAllCodegenComponents.h

  • Committer: Bazaar Package Importer
  • Author(s): Kees Cook
  • Date: 2007-02-20 10:33:44 UTC
  • mto: This revision was merged to the branch mainline in revision 16.
  • Revision ID: james.westby@ubuntu.com-20070220103344-zgcu2psnx9d98fpa
Tags: upstream-0.90
ImportĀ upstreamĀ versionĀ 0.90

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
//===- llvm/Codegen/LinkAllCodegenComponents.h ------------------*- 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 file pulls in all codegen related passes for tools like lli and
11
 
// llc that need this functionality.
12
 
//
13
 
//===----------------------------------------------------------------------===//
14
 
 
15
 
#ifndef LLVM_CODEGEN_LINKALLCODEGENCOMPONENTS_H
16
 
#define LLVM_CODEGEN_LINKALLCODEGENCOMPONENTS_H
17
 
 
18
 
#include "llvm/CodeGen/Passes.h"
19
 
#include "llvm/CodeGen/SchedulerRegistry.h"
20
 
#include "llvm/CodeGen/GCs.h"
21
 
#include "llvm/Target/TargetMachine.h"
22
 
#include <cstdlib>
23
 
 
24
 
namespace {
25
 
  struct ForceCodegenLinking {
26
 
    ForceCodegenLinking() {
27
 
      // We must reference the passes in such a way that compilers will not
28
 
      // delete it all as dead code, even with whole program optimization,
29
 
      // yet is effectively a NO-OP. As the compiler isn't smart enough
30
 
      // to know that getenv() never returns -1, this will do the job.
31
 
      if (std::getenv("bar") != (char*) -1)
32
 
        return;
33
 
 
34
 
      (void) llvm::createDeadMachineInstructionElimPass();
35
 
 
36
 
      (void) llvm::createFastRegisterAllocator();
37
 
      (void) llvm::createLinearScanRegisterAllocator();
38
 
      (void) llvm::createPBQPRegisterAllocator();
39
 
 
40
 
      (void) llvm::createSimpleRegisterCoalescer();
41
 
      
42
 
      llvm::linkOcamlGC();
43
 
      llvm::linkShadowStackGC();
44
 
      
45
 
      (void) llvm::createBURRListDAGScheduler(NULL, llvm::CodeGenOpt::Default);
46
 
      (void) llvm::createTDRRListDAGScheduler(NULL, llvm::CodeGenOpt::Default);
47
 
      (void) llvm::createSourceListDAGScheduler(NULL,llvm::CodeGenOpt::Default);
48
 
      (void) llvm::createHybridListDAGScheduler(NULL,llvm::CodeGenOpt::Default);
49
 
      (void) llvm::createTDListDAGScheduler(NULL, llvm::CodeGenOpt::Default);
50
 
      (void) llvm::createFastDAGScheduler(NULL, llvm::CodeGenOpt::Default);
51
 
      (void) llvm::createDefaultScheduler(NULL, llvm::CodeGenOpt::Default);
52
 
 
53
 
    }
54
 
  } ForceCodegenLinking; // Force link by creating a global definition.
55
 
}
56
 
 
57
 
#endif