2013-01-10 22:55:02 +01:00
|
|
|
//===----- LinkAllIR.h - Reference All VMCore Code --------------*- C++ -*-===//
|
2006-06-07 22:00:19 +02:00
|
|
|
//
|
2019-01-19 09:50:56 +01:00
|
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
2006-06-07 22:00:19 +02:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
2006-06-08 00:09:38 +02:00
|
|
|
// This header file pulls in all the object modules of the VMCore library so
|
|
|
|
// that tools like llc, opt, and lli can ensure they are linked with all symbols
|
|
|
|
// from libVMCore.a It should only be used from a tool's main program.
|
2006-06-07 22:00:19 +02:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2013-01-10 22:55:02 +01:00
|
|
|
#ifndef LLVM_LINKALLIR_H
|
|
|
|
#define LLVM_LINKALLIR_H
|
2006-06-07 22:00:19 +02:00
|
|
|
|
2017-06-07 05:48:56 +02:00
|
|
|
#include "llvm/BinaryFormat/Dwarf.h"
|
2013-01-02 12:36:10 +01:00
|
|
|
#include "llvm/IR/InlineAsm.h"
|
|
|
|
#include "llvm/IR/Instructions.h"
|
|
|
|
#include "llvm/IR/LLVMContext.h"
|
|
|
|
#include "llvm/IR/Module.h"
|
2014-01-13 10:26:24 +01:00
|
|
|
#include "llvm/IR/Verifier.h"
|
2010-11-29 19:16:10 +01:00
|
|
|
#include "llvm/Support/DynamicLibrary.h"
|
2012-12-03 18:02:12 +01:00
|
|
|
#include "llvm/Support/MathExtras.h"
|
2010-11-29 19:16:10 +01:00
|
|
|
#include "llvm/Support/Memory.h"
|
|
|
|
#include "llvm/Support/Mutex.h"
|
|
|
|
#include "llvm/Support/Path.h"
|
|
|
|
#include "llvm/Support/Process.h"
|
|
|
|
#include "llvm/Support/Program.h"
|
|
|
|
#include "llvm/Support/Signals.h"
|
2009-12-03 01:50:42 +01:00
|
|
|
#include <cstdlib>
|
2006-06-07 22:00:19 +02:00
|
|
|
|
|
|
|
namespace {
|
|
|
|
struct ForceVMCoreLinking {
|
|
|
|
ForceVMCoreLinking() {
|
2006-06-08 00:09:38 +02:00
|
|
|
// We must reference VMCore in such a way that compilers will not
|
2006-06-07 22:00:19 +02:00
|
|
|
// delete it all as dead code, even with whole program optimization,
|
|
|
|
// yet is effectively a NO-OP. As the compiler isn't smart enough
|
|
|
|
// to know that getenv() never returns -1, this will do the job.
|
|
|
|
if (std::getenv("bar") != (char*) -1)
|
|
|
|
return;
|
2016-04-14 23:59:01 +02:00
|
|
|
llvm::LLVMContext Context;
|
|
|
|
(void)new llvm::Module("", Context);
|
|
|
|
(void)new llvm::UnreachableInst(Context);
|
2018-07-30 21:41:25 +02:00
|
|
|
(void) llvm::createVerifierPass();
|
2006-06-07 22:00:19 +02:00
|
|
|
}
|
|
|
|
} ForceVMCoreLinking;
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|