summaryrefslogtreecommitdiff
path: root/ortho/llvm/ortho_llvm-main.ads
diff options
context:
space:
mode:
authorTristan Gingold2014-03-06 21:27:19 +0100
committerTristan Gingold2014-03-06 21:27:19 +0100
commit7b1e07c025bd01aad47bb78222a5e6b17682d4e4 (patch)
tree9bab215376b6cd0c0df0817d46f0bd12b880bc42 /ortho/llvm/ortho_llvm-main.ads
parent627f7b8313148cde9c372aca8b6cdc3d4d3dc78f (diff)
downloadghdl-7b1e07c025bd01aad47bb78222a5e6b17682d4e4.tar.gz
ghdl-7b1e07c025bd01aad47bb78222a5e6b17682d4e4.tar.bz2
ghdl-7b1e07c025bd01aad47bb78222a5e6b17682d4e4.zip
Add LLVM back-end for ortho.
Diffstat (limited to 'ortho/llvm/ortho_llvm-main.ads')
-rw-r--r--ortho/llvm/ortho_llvm-main.ads57
1 files changed, 57 insertions, 0 deletions
diff --git a/ortho/llvm/ortho_llvm-main.ads b/ortho/llvm/ortho_llvm-main.ads
new file mode 100644
index 0000000..56bbdb4
--- /dev/null
+++ b/ortho/llvm/ortho_llvm-main.ads
@@ -0,0 +1,57 @@
+-- LLVM back-end for ortho.
+-- Copyright (C) 2014 Tristan Gingold
+--
+-- GHDL is free software; you can redistribute it and/or modify it under
+-- the terms of the GNU General Public License as published by the Free
+-- Software Foundation; either version 2, or (at your option) any later
+-- version.
+--
+-- GHDL is distributed in the hope that it will be useful, but WITHOUT ANY
+-- WARRANTY; without even the implied warranty of MERCHANTABILITY or
+-- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+-- for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with GCC; see the file COPYING. If not, write to the Free
+-- Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+-- 02111-1307, USA.
+
+with GNAT.Directory_Operations;
+with LLVM.Target; use LLVM.Target;
+with LLVM.TargetMachine; use LLVM.TargetMachine;
+
+package Ortho_LLVM.Main is
+ use LLVM.Core;
+
+ -- LLVM specific: the module.
+ Module : ModuleRef;
+
+ -- Descriptor for the layout.
+ Target_Data : TargetDataRef;
+
+ Target_Machine : TargetMachineRef;
+
+ -- Optimization level
+ Optimization : CodeGenOptLevel := CodeGenLevelDefault;
+
+ -- Set by -g to generate debug info.
+ Flag_Debug : Boolean := False;
+
+ Debug_ID : unsigned;
+
+ -- Some predefined types and functions.
+ Char_Type : O_Tnode;
+ Char_Ptr_Type : O_Tnode;
+
+ Stacksave_Fun : ValueRef;
+ Stacksave_Name : constant String := "llvm.stacksave" & ASCII.NUL;
+ Stackrestore_Fun : ValueRef;
+ Stackrestore_Name : constant String := "llvm.stackrestore" & ASCII.NUL;
+
+ Current_Directory : constant String :=
+ GNAT.Directory_Operations.Get_Current_Dir;
+
+ function To_String (C : Cstring) return String;
+
+ procedure Init;
+end Ortho_LLVM.Main;