llvm.org GIT mirror llvm / 2b11004
Link GC metadata printers by default to llc git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54892 91177308-0d34-0410-b5e6-96231b3b80d8 Anton Korobeynikov 12 years ago
2 changed file(s) with 38 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
0 //===- llvm/Codegen/LinkAllAsmWriterComponents.h ----------------*- C++ -*-===//
1 //
2 // The LLVM Compiler Infrastructure
3 //
4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details.
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/GCs.h"
18
19 namespace {
20 struct ForceAsmWriterLinking {
21 ForceAsmWriterLinking() {
22 // We must reference the passes in such a way that compilers will not
23 // delete it all as dead code, even with whole program optimization,
24 // yet is effectively a NO-OP. As the compiler isn't smart enough
25 // to know that getenv() never returns -1, this will do the job.
26 if (std::getenv("bar") != (char*) -1)
27 return;
28
29 (void) llvm::createOcamlMetadataPrinter();
30
31 }
32 } ForceAsmWriterLinking; // Force link by creating a global definition.
33 }
34
35 #endif // LLVM_CODEGEN_LINKALLASMWRITERCOMPONENTS_H
36
1515 #include "llvm/Bitcode/ReaderWriter.h"
1616 #include "llvm/CodeGen/FileWriters.h"
1717 #include "llvm/CodeGen/LinkAllCodegenComponents.h"
18 #include "llvm/CodeGen/LinkAllAsmWriterComponents.h"
1819 #include "llvm/Target/SubtargetFeature.h"
1920 #include "llvm/Target/TargetData.h"
2021 #include "llvm/Target/TargetMachine.h"