diff libinterp/corefcn/jit-ir.cc @ 20654:b65888ec820e draft default tip gccjit

dmalcom gcc jit import
author Stefan Mahr <dac922@gmx.de>
date Fri, 27 Feb 2015 16:59:36 +0100
parents 4197fc428c7d
children
line wrap: on
line diff
--- a/libinterp/corefcn/jit-ir.cc	Tue Oct 13 11:40:05 2015 +0100
+++ b/libinterp/corefcn/jit-ir.cc	Fri Feb 27 16:59:36 2015 +0100
@@ -30,10 +30,11 @@
 #include <config.h>
 #endif
 
-#ifdef HAVE_LLVM
+#ifdef HAVE_JIT
 
 #include "jit-ir.h"
 
+#if HAVE_LLVM
 #ifdef HAVE_LLVM_IR_FUNCTION_H
 #include <llvm/IR/BasicBlock.h>
 #include <llvm/IR/Instructions.h>
@@ -41,6 +42,7 @@
 #include <llvm/BasicBlock.h>
 #include <llvm/Instructions.h>
 #endif
+#endif
 
 #include "error.h"
 
@@ -208,11 +210,13 @@
   resize_arguments (0);
 }
 
+#if HAVE_LLVM
 llvm::BasicBlock *
 jit_instruction::parent_llvm (void) const
 {
   return mparent->to_llvm ();
 }
+#endif
 
 std::ostream&
 jit_instruction::short_print (std::ostream& os) const
@@ -388,11 +392,13 @@
   return term ? term->successor_count () : 0;
 }
 
+#if HAVE_LLVM
 llvm::BasicBlock *
 jit_block::to_llvm (void) const
 {
   return llvm::cast<llvm::BasicBlock> (llvm_value);
 }
+#endif
 
 std::ostream&
 jit_block::print_dom (std::ostream& os) const
@@ -661,11 +667,13 @@
   return false;
 }
 
+#if HAVE_LLVM
 llvm::PHINode *
 jit_phi::to_llvm (void) const
 {
   return llvm::cast<llvm::PHINode> (jit_value::to_llvm ());
 }
+#endif
 
 // -------------------- jit_terminator --------------------
 size_t
@@ -697,11 +705,13 @@
   return changed;
 }
 
+#if HAVE_LLVM
 llvm::TerminatorInst *
 jit_terminator::to_llvm (void) const
 {
   return llvm::cast<llvm::TerminatorInst> (jit_value::to_llvm ());
 }
+#endif
 
 // -------------------- jit_call --------------------
 bool
@@ -842,4 +852,4 @@
   return jit_typeinfo::end (ctx.value, ctx.index, ctx.count);
 }
 
-#endif
+#endif /* ifdef HAVE_JIT */