llvmHeaders.hpp revision 1879:f95d63e2154a
1224133Sdim/*
2224133Sdim * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
3224133Sdim * Copyright 2008, 2009, 2010 Red Hat, Inc.
4224133Sdim * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5224133Sdim *
6224133Sdim * This code is free software; you can redistribute it and/or modify it
7224133Sdim * under the terms of the GNU General Public License version 2 only, as
8224133Sdim * published by the Free Software Foundation.
9224133Sdim *
10224133Sdim * This code is distributed in the hope that it will be useful, but WITHOUT
11224133Sdim * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12224133Sdim * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
13224133Sdim * version 2 for more details (a copy is included in the LICENSE file that
14263508Sdim * accompanied this code).
15224133Sdim *
16224133Sdim * You should have received a copy of the GNU General Public License version
17224133Sdim * 2 along with this work; if not, write to the Free Software Foundation,
18224133Sdim * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
19224133Sdim *
20224133Sdim * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
21224133Sdim * or visit www.oracle.com if you need additional information or have any
22224133Sdim * questions.
23224133Sdim *
24224133Sdim */
25224133Sdim
26263508Sdim#ifndef SHARE_VM_SHARK_LLVMHEADERS_HPP
27263508Sdim#define SHARE_VM_SHARK_LLVMHEADERS_HPP
28263508Sdim
29263508Sdim#ifdef assert
30263508Sdim  #undef assert
31263508Sdim#endif
32263508Sdim
33263508Sdim#ifdef DEBUG
34263508Sdim  #define SHARK_DEBUG
35263508Sdim  #undef DEBUG
36263508Sdim#endif
37263508Sdim
38263508Sdim#include <llvm/Argument.h>
39263508Sdim#include <llvm/Constants.h>
40263508Sdim#include <llvm/DerivedTypes.h>
41249423Sdim#include <llvm/ExecutionEngine/ExecutionEngine.h>
42249423Sdim#include <llvm/Instructions.h>
43249423Sdim#include <llvm/LLVMContext.h>
44249423Sdim#include <llvm/Module.h>
45224133Sdim#if SHARK_LLVM_VERSION < 27
46224133Sdim#include <llvm/ModuleProvider.h>
47224133Sdim#endif
48224133Sdim#include <llvm/Support/IRBuilder.h>
49224133Sdim#include <llvm/System/Threading.h>
50224133Sdim#include <llvm/Target/TargetSelect.h>
51224133Sdim#include <llvm/Type.h>
52224133Sdim#include <llvm/ExecutionEngine/JITMemoryManager.h>
53224133Sdim#include <llvm/Support/CommandLine.h>
54263508Sdim#if SHARK_LLVM_VERSION >= 27
55263508Sdim#include <llvm/ExecutionEngine/JIT.h>
56263508Sdim#include <llvm/ADT/StringMap.h>
57#include <llvm/Support/Debug.h>
58#include <llvm/System/Host.h>
59#endif
60
61#include <map>
62
63#ifdef assert
64  #undef assert
65#endif
66
67// from hotspot/src/share/vm/utilities/debug.hpp
68#ifdef ASSERT
69#ifndef USE_REPEATED_ASSERTS
70#define assert(p, msg)                                                       \
71do {                                                                         \
72  if (!(p)) {                                                                \
73    report_vm_error(__FILE__, __LINE__, "assert(" #p ") failed", msg);       \
74    BREAKPOINT;                                                              \
75  }                                                                          \
76} while (0)
77#else // #ifndef USE_REPEATED_ASSERTS
78#define assert(p, msg)
79do {                                                                         \
80  for (int __i = 0; __i < AssertRepeat; __i++) {                             \
81    if (!(p)) {                                                              \
82      report_vm_error(__FILE__, __LINE__, "assert(" #p ") failed", msg);     \
83      BREAKPOINT;                                                            \
84    }                                                                        \
85  }                                                                          \
86} while (0)
87#endif // #ifndef USE_REPEATED_ASSERTS
88#else
89  #define assert(p, msg)
90#endif
91
92#ifdef DEBUG
93  #undef DEBUG
94#endif
95#ifdef SHARK_DEBUG
96  #define DEBUG
97  #undef SHARK_DEBUG
98#endif
99
100#endif // SHARE_VM_SHARK_LLVMHEADERS_HPP
101