Coverage Report

Created: 2019-07-24 05:18

/Users/buildslave/jenkins/workspace/clang-stage2-coverage-R/llvm/include/llvm/CodeGen/LinkAllAsmWriterComponents.h
Line
Count
Source (jump to first uncovered line)
1
//===- llvm/Codegen/LinkAllAsmWriterComponents.h ----------------*- C++ -*-===//
2
//
3
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4
// See https://llvm.org/LICENSE.txt for license information.
5
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6
//
7
//===----------------------------------------------------------------------===//
8
//
9
// This header file pulls in all assembler writer related passes for tools like
10
// llc that need this functionality.
11
//
12
//===----------------------------------------------------------------------===//
13
14
#ifndef LLVM_CODEGEN_LINKALLASMWRITERCOMPONENTS_H
15
#define LLVM_CODEGEN_LINKALLASMWRITERCOMPONENTS_H
16
17
#include "llvm/CodeGen/BuiltinGCs.h"
18
#include <cstdlib>
19
20
namespace {
21
  struct ForceAsmWriterLinking {
22
24.9k
    ForceAsmWriterLinking() {
23
24.9k
      // We must reference the plug-ins in such a way that compilers will not
24
24.9k
      // delete it all as dead code, even with whole program optimization,
25
24.9k
      // yet is effectively a NO-OP. As the compiler isn't smart enough
26
24.9k
      // to know that getenv() never returns -1, this will do the job.
27
24.9k
      if (std::getenv("bar") != (char*) -1)
28
24.9k
        return;
29
0
30
0
      llvm::linkOcamlGCPrinter();
31
0
      llvm::linkErlangGCPrinter();
32
0
33
0
    }
34
  } ForceAsmWriterLinking; // Force link by creating a global definition.
35
}
36
37
#endif // LLVM_CODEGEN_LINKALLASMWRITERCOMPONENTS_H