Coverage Report

Created: 2018-09-19 08:35

/Users/buildslave/jenkins/workspace/clang-stage2-coverage-R/llvm/include/llvm/CodeGen/LinkAllCodegenComponents.h
Line
Count
Source (jump to first uncovered line)
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/GCs.h"
19
#include "llvm/CodeGen/Passes.h"
20
#include "llvm/CodeGen/SchedulerRegistry.h"
21
#include "llvm/Target/TargetMachine.h"
22
#include <cstdlib>
23
24
namespace {
25
  struct ForceCodegenLinking {
26
20.6k
    ForceCodegenLinking() {
27
20.6k
      // We must reference the passes in such a way that compilers will not
28
20.6k
      // delete it all as dead code, even with whole program optimization,
29
20.6k
      // yet is effectively a NO-OP. As the compiler isn't smart enough
30
20.6k
      // to know that getenv() never returns -1, this will do the job.
31
20.6k
      if (std::getenv("bar") != (char*) -1)
32
20.6k
        return;
33
0
34
0
      (void) llvm::createFastRegisterAllocator();
35
0
      (void) llvm::createBasicRegisterAllocator();
36
0
      (void) llvm::createGreedyRegisterAllocator();
37
0
      (void) llvm::createDefaultPBQPRegisterAllocator();
38
0
39
0
      llvm::linkCoreCLRGC();
40
0
      llvm::linkOcamlGC();
41
0
      llvm::linkErlangGC();
42
0
      llvm::linkShadowStackGC();
43
0
      llvm::linkStatepointExampleGC();
44
0
45
0
      (void) llvm::createBURRListDAGScheduler(nullptr,
46
0
                                              llvm::CodeGenOpt::Default);
47
0
      (void) llvm::createSourceListDAGScheduler(nullptr,
48
0
                                                llvm::CodeGenOpt::Default);
49
0
      (void) llvm::createHybridListDAGScheduler(nullptr,
50
0
                                                llvm::CodeGenOpt::Default);
51
0
      (void) llvm::createFastDAGScheduler(nullptr, llvm::CodeGenOpt::Default);
52
0
      (void) llvm::createDefaultScheduler(nullptr, llvm::CodeGenOpt::Default);
53
0
      (void) llvm::createVLIWDAGScheduler(nullptr, llvm::CodeGenOpt::Default);
54
0
55
0
    }
56
  } ForceCodegenLinking; // Force link by creating a global definition.
57
}
58
59
#endif