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