1193323Sed//===- llvm/Codegen/LinkAllAsmWriterComponents.h ----------------*- C++ -*-===// 2193323Sed// 3193323Sed// The LLVM Compiler Infrastructure 4193323Sed// 5193323Sed// This file is distributed under the University of Illinois Open Source 6193323Sed// License. See LICENSE.TXT for details. 7193323Sed// 8193323Sed//===----------------------------------------------------------------------===// 9193323Sed// 10193323Sed// This header file pulls in all assembler writer related passes for tools like 11193323Sed// llc that need this functionality. 12193323Sed// 13193323Sed//===----------------------------------------------------------------------===// 14193323Sed 15193323Sed#ifndef LLVM_CODEGEN_LINKALLASMWRITERCOMPONENTS_H 16193323Sed#define LLVM_CODEGEN_LINKALLASMWRITERCOMPONENTS_H 17193323Sed 18193323Sed#include "llvm/CodeGen/GCs.h" 19199481Srdivacky#include <cstdlib> 20193323Sed 21193323Sednamespace { 22193323Sed struct ForceAsmWriterLinking { 23193323Sed ForceAsmWriterLinking() { 24193323Sed // We must reference the plug-ins in such a way that compilers will not 25193323Sed // delete it all as dead code, even with whole program optimization, 26193323Sed // yet is effectively a NO-OP. As the compiler isn't smart enough 27193323Sed // to know that getenv() never returns -1, this will do the job. 28193323Sed if (std::getenv("bar") != (char*) -1) 29193323Sed return; 30193323Sed 31193323Sed llvm::linkOcamlGCPrinter(); 32249423Sdim llvm::linkErlangGCPrinter(); 33193323Sed 34193323Sed } 35193323Sed } ForceAsmWriterLinking; // Force link by creating a global definition. 36193323Sed} 37193323Sed 38193323Sed#endif // LLVM_CODEGEN_LINKALLASMWRITERCOMPONENTS_H 39