Tue, 08 Apr 2014 14:55:16 -0700
8036619: Shark: add LLVM 3.4 support
Reviewed-by: twisti, kvn
twisti@2047 | 1 | /* |
twisti@2765 | 2 | * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved. |
twisti@2047 | 3 | * Copyright 2008, 2009, 2010 Red Hat, Inc. |
twisti@2047 | 4 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
twisti@2047 | 5 | * |
twisti@2047 | 6 | * This code is free software; you can redistribute it and/or modify it |
twisti@2047 | 7 | * under the terms of the GNU General Public License version 2 only, as |
twisti@2047 | 8 | * published by the Free Software Foundation. |
twisti@2047 | 9 | * |
twisti@2047 | 10 | * This code is distributed in the hope that it will be useful, but WITHOUT |
twisti@2047 | 11 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
twisti@2047 | 12 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
twisti@2047 | 13 | * version 2 for more details (a copy is included in the LICENSE file that |
twisti@2047 | 14 | * accompanied this code). |
twisti@2047 | 15 | * |
twisti@2047 | 16 | * You should have received a copy of the GNU General Public License version |
twisti@2047 | 17 | * 2 along with this work; if not, write to the Free Software Foundation, |
twisti@2047 | 18 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
twisti@2047 | 19 | * |
twisti@2047 | 20 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
twisti@2047 | 21 | * or visit www.oracle.com if you need additional information or have any |
twisti@2047 | 22 | * questions. |
twisti@2047 | 23 | * |
twisti@2047 | 24 | */ |
twisti@2047 | 25 | |
stefank@2314 | 26 | #ifndef SHARE_VM_SHARK_LLVMHEADERS_HPP |
stefank@2314 | 27 | #define SHARE_VM_SHARK_LLVMHEADERS_HPP |
stefank@2314 | 28 | |
twisti@2047 | 29 | #ifdef assert |
twisti@2047 | 30 | #undef assert |
twisti@2047 | 31 | #endif |
twisti@2047 | 32 | |
twisti@2047 | 33 | #ifdef DEBUG |
twisti@2047 | 34 | #define SHARK_DEBUG |
twisti@2047 | 35 | #undef DEBUG |
twisti@2047 | 36 | #endif |
twisti@2047 | 37 | |
twisti@4314 | 38 | #include <llvm/Analysis/Verifier.h> |
neugens@6551 | 39 | #include <llvm/ExecutionEngine/ExecutionEngine.h> |
neugens@6551 | 40 | |
neugens@6551 | 41 | // includes specific to each version |
neugens@6551 | 42 | #if SHARK_LLVM_VERSION <= 31 |
neugens@6551 | 43 | #include <llvm/Support/IRBuilder.h> |
neugens@6551 | 44 | #include <llvm/Type.h> |
twisti@2047 | 45 | #include <llvm/Argument.h> |
twisti@2047 | 46 | #include <llvm/Constants.h> |
twisti@2047 | 47 | #include <llvm/DerivedTypes.h> |
twisti@2047 | 48 | #include <llvm/Instructions.h> |
twisti@2047 | 49 | #include <llvm/LLVMContext.h> |
twisti@2047 | 50 | #include <llvm/Module.h> |
neugens@6551 | 51 | #elif SHARK_LLVM_VERSION <= 32 |
twisti@4314 | 52 | #include <llvm/IRBuilder.h> |
neugens@6551 | 53 | #include <llvm/Type.h> |
neugens@6551 | 54 | #include <llvm/Argument.h> |
neugens@6551 | 55 | #include <llvm/Constants.h> |
neugens@6551 | 56 | #include <llvm/DerivedTypes.h> |
neugens@6551 | 57 | #include <llvm/Instructions.h> |
neugens@6551 | 58 | #include <llvm/LLVMContext.h> |
neugens@6551 | 59 | #include <llvm/Module.h> |
neugens@6551 | 60 | #else // SHARK_LLVM_VERSION <= 34 |
neugens@6551 | 61 | #include <llvm/IR/IRBuilder.h> |
neugens@6551 | 62 | #include <llvm/IR/Argument.h> |
neugens@6551 | 63 | #include <llvm/IR/Constants.h> |
neugens@6551 | 64 | #include <llvm/IR/DerivedTypes.h> |
neugens@6551 | 65 | #include <llvm/ExecutionEngine/ExecutionEngine.h> |
neugens@6551 | 66 | #include <llvm/IR/Instructions.h> |
neugens@6551 | 67 | #include <llvm/IR/LLVMContext.h> |
neugens@6551 | 68 | #include <llvm/IR/Module.h> |
neugens@6551 | 69 | #include <llvm/ADT/StringRef.h> |
neugens@6551 | 70 | #include <llvm/IR/Type.h> |
twisti@2047 | 71 | #endif |
neugens@6551 | 72 | |
neugens@6551 | 73 | // common includes |
twisti@2765 | 74 | #include <llvm/Support/Threading.h> |
twisti@4314 | 75 | #include <llvm/Support/TargetSelect.h> |
twisti@2047 | 76 | #include <llvm/ExecutionEngine/JITMemoryManager.h> |
twisti@2047 | 77 | #include <llvm/Support/CommandLine.h> |
twisti@4314 | 78 | #include <llvm/ExecutionEngine/MCJIT.h> |
twisti@2047 | 79 | #include <llvm/ExecutionEngine/JIT.h> |
twisti@2047 | 80 | #include <llvm/ADT/StringMap.h> |
twisti@2047 | 81 | #include <llvm/Support/Debug.h> |
twisti@2765 | 82 | #include <llvm/Support/Host.h> |
twisti@2047 | 83 | |
twisti@2047 | 84 | #include <map> |
twisti@2047 | 85 | |
twisti@2047 | 86 | #ifdef assert |
twisti@2047 | 87 | #undef assert |
twisti@2047 | 88 | #endif |
twisti@2047 | 89 | |
twisti@2047 | 90 | // from hotspot/src/share/vm/utilities/debug.hpp |
twisti@2047 | 91 | #ifdef ASSERT |
twisti@2047 | 92 | #ifndef USE_REPEATED_ASSERTS |
twisti@2047 | 93 | #define assert(p, msg) \ |
twisti@2047 | 94 | do { \ |
twisti@2047 | 95 | if (!(p)) { \ |
twisti@2047 | 96 | report_vm_error(__FILE__, __LINE__, "assert(" #p ") failed", msg); \ |
twisti@2047 | 97 | BREAKPOINT; \ |
twisti@2047 | 98 | } \ |
twisti@2047 | 99 | } while (0) |
twisti@2047 | 100 | #else // #ifndef USE_REPEATED_ASSERTS |
twisti@2047 | 101 | #define assert(p, msg) |
twisti@2047 | 102 | do { \ |
twisti@2047 | 103 | for (int __i = 0; __i < AssertRepeat; __i++) { \ |
twisti@2047 | 104 | if (!(p)) { \ |
twisti@2047 | 105 | report_vm_error(__FILE__, __LINE__, "assert(" #p ") failed", msg); \ |
twisti@2047 | 106 | BREAKPOINT; \ |
twisti@2047 | 107 | } \ |
twisti@2047 | 108 | } \ |
twisti@2047 | 109 | } while (0) |
twisti@2047 | 110 | #endif // #ifndef USE_REPEATED_ASSERTS |
twisti@2047 | 111 | #else |
twisti@2047 | 112 | #define assert(p, msg) |
twisti@2047 | 113 | #endif |
twisti@2047 | 114 | |
twisti@2047 | 115 | #ifdef DEBUG |
twisti@2047 | 116 | #undef DEBUG |
twisti@2047 | 117 | #endif |
twisti@2047 | 118 | #ifdef SHARK_DEBUG |
twisti@2047 | 119 | #define DEBUG |
twisti@2047 | 120 | #undef SHARK_DEBUG |
twisti@2047 | 121 | #endif |
stefank@2314 | 122 | |
stefank@2314 | 123 | #endif // SHARE_VM_SHARK_LLVMHEADERS_HPP |