gollvm: reorganization/refactoring in preparation for libgo cmake

Reorganize the gollvm source code in preparation for incorporating
cmake rules for the libgo build. The subdirectory that contained the
bridge code has been renamed from 'llvm-gofrontend' to 'bridge', and
'gofrontend' itself is now a child of 'gollvm' and not the bridge.
Minor updates to the README.md to track these changes.

Change-Id: I1ac3441160e680e6c09972e754ee18180f4b2701
Reviewed-on: https://go-review.googlesource.com/86236
Reviewed-by: Cherry Zhang <cherryyz@google.com>
diff --git a/CMakeLists.txt b/CMakeLists.txt
index af330e8..0591f77 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -67,49 +67,19 @@
   LOG_INSTALL 1
   )
 
-# Subdir for gofrontend itself and for the middle layer that translates
-# Backend method calls into LLVM IR.
-add_subdirectory(llvm-gofrontend)
+# Location of gofrontend source code.
+set(GOFRONTEND_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/gofrontend/go)
 
-# Subdir for unit tests that test the go middle layer
+# Location of bridge source code.
+set(BRIDGE_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/bridge)
+
+# Subdirectory for the middle layer that translates Backend method
+# calls into LLVM IR.
+add_subdirectory(bridge)
+
+# Subdirectory for llvm-goparse executable.
+add_subdirectory(driver)
+
+# Subdir for unit tests that test the middle layer
 add_subdirectory(unittests)
 
-# Things we need to link into llvm-goparse
-set(LLVM_LINK_COMPONENTS
-  ${LLVM_TARGETS_TO_BUILD}
-  CppGoFrontEnd
-  CodeGen
-  Core
-  IRReader
-  MC
-  Support
-  Target
-  Object
-  Passes
-  Support
-  )
-
-# Include directories needed by llvm-goparse
-include_directories(${CMAKE_CURRENT_SOURCE_DIR}/llvm-gofrontend/gofrontend/go)
-include_directories(${CMAKE_CURRENT_SOURCE_DIR}/llvm-gofrontend)
-
-# For gofrontend headers
-include_directories(${MPCINSTALL}/include)
-include_directories(${MPFRINSTALL}/include)
-include_directories(${GMPINSTALL}/include)
-
-# The llvm-goparse executable itself
-add_llvm_tool(llvm-goparse
-  goparse-llvm.cpp
-  )
-
-# Record the fact that llvm-goparse depends on these libs
-add_dependencies(llvm-goparse libmpfr libmpc libgmp)
-
-# Add in llvm-goparse dependencies.
-target_link_libraries(llvm-goparse
-  "-L${MPCLIBDIR}" "-lmpc"
-  "-L${MPFRLIBDIR}" "-lmpfr"
-  "-L${GMPLIBDIR}" "-lgmp")
-
-
diff --git a/README.md b/README.md
index fbadb05..4d3da70 100644
--- a/README.md
+++ b/README.md
@@ -1,8 +1,9 @@
+
 # gollvm
 
-LLVM IR generation "middle end" for LLVM-based go compiler. This is currently very much in a prototype phase, with a fairly brittle/fragile build process, so please take careful note of the setup instructions.
+Gollvm is an LLVM-based Go compiler. It incorporates "gofrontend" (a Go language front end written in C++ and shared with GCCGO), a bridge components (which translates from gofrontend IR to LLVM IR), and a driver that sends the resulting IR through the LLVM back end. Gollvm is still at an early stage of development.
 
-Gollvm (name still not finalized) is layered on top of LLVM, much in the same way that things work for "clang" or "compiler-rt": you check out a copy of the LLVM source tree and then within that tree you check out additional git repos. 
+Gollvm (name still not finalized) is set up to be a subprojects within the LLVM tools directory, similar to how things work for "clang" or "compiler-rt": you check out a copy of the LLVM source tree and then within that tree you check out additional git repos. 
 
 You'll need to have an up-to-date copy of cmake on your system (3.6 vintage).
 
@@ -15,11 +16,14 @@
 
 // Sources
 % git clone http://llvm.org/git/llvm.git
+...
 % cd llvm/tools
 % git clone https://go.googlesource.com/gollvm
-% cd gollvm/llvm-gofrontend
+...
+% cd gollvm
 % git clone https://go.googlesource.com/gofrontend
-% cd ../../../..
+...
+%
 
 // Additional steps needed for MacOS only:
 % brew install gmp mpfr mpc
@@ -29,10 +33,7 @@
 % cd build.opt
 % cmake -DCMAKE_BUILD_TYPE=Debug -G Ninja ../llvm
 
-// Prebuild
-ninja libgmp libmpfr libmpc
-
-// Now regular build
+// Build
 ninja <gollvm target(s)>
 ```
 
@@ -42,9 +43,18 @@
 
 .../llvm/tools/gollvm:
 
+ * contains rules to build third party libraries needed for gollvm, 
+   along with common definitions for subdirs.
+ 
+.../llvm/tools/gollvm/driver:
+
  * contains build rules and source code for llvm-goparse
  
-.../llvm/tools/gollvm/llvm-gofrontend:
+.../llvm/tools/gollvm/gofrontend:
+
+ * source code for gofrontend and libgo (note: no cmake files here)
+
+.../llvm/tools/gollvm/bridge:
 
  * contains build rules for the libLLVMCppGoFrontEnd.a, a library that contains both the gofrontend code and the LLVM-specific middle layer (for example, the definition of the class Llvm_backend, which inherits from Backend).
  
@@ -54,7 +64,7 @@
  
 ## Building and running llvm-goparse
 
-The executable llvm-goparse is a driver program that runs the gofrontend parser on a specific go program, with the LLVM-specific backend instance connected to the parser. This program is still mostly a skeleton -- it can create LLVM based on the Backend method calls made by the front end, however it doesn't actually do anything with the IR yet (just dumps it out). 
+The executable llvm-goparse is a driver program that runs the gofrontend parser on a specific go program, with the LLVM-specific backend instance connected to the parser. This program not fully usable on its own at the moment; using it requries a companion gccgo installation. 
 
 ```
 // From within <workarea>/build.opt:
@@ -62,20 +72,11 @@
 % ninja llvm-goparse
 % cat micro.go
 package foo
-func bar() int {
+func Bar() int {
 	return 1
 }
-% ./bin/llvm-goparse ~/micro.go
-...
-define hidden i64 @foo.bar() {
-entry:
-  %"$ret0" = alloca i64
-  store i64 0, i64* %"$ret0"
-  store i64 1, i64* %"$ret0"
-  %"$ret0.ld.0" = load i64, i64* %"$ret0"
-  ret i64 %"$ret0.ld.0"
-}
-%
+% ./bin/llvm-goparse -fgo-pkgpath=foo -O3 -o micro.s micro.go
+% 
 ```
 
 ## Using llvm-goparse in combination with a GCCGO installation
diff --git a/bridge/CMakeLists.txt b/bridge/CMakeLists.txt
new file mode 100644
index 0000000..086f212
--- /dev/null
+++ b/bridge/CMakeLists.txt
@@ -0,0 +1,59 @@
+
+# Rules for building LLVMCppGoFrontEnd library, which incorporates
+# both the Go frontend and the frontend -> LLVM-IR bridge component.
+
+set(LLVM_LINK_COMPONENTS
+  CodeGen
+  Core
+  Support
+  )
+
+add_llvm_library(LLVMCppGoFrontEnd
+  ${GOFRONTEND_SOURCE_DIR}/ast-dump.cc
+  ${GOFRONTEND_SOURCE_DIR}/escape.cc
+  ${GOFRONTEND_SOURCE_DIR}/export.cc
+  ${GOFRONTEND_SOURCE_DIR}/expressions.cc
+  ${GOFRONTEND_SOURCE_DIR}/go-diagnostics.cc
+  ${GOFRONTEND_SOURCE_DIR}/go-encode-id.cc
+  ${GOFRONTEND_SOURCE_DIR}/go-dump.cc
+  ${GOFRONTEND_SOURCE_DIR}/go-optimize.cc
+  ${GOFRONTEND_SOURCE_DIR}/go.cc
+  ${GOFRONTEND_SOURCE_DIR}/gogo.cc
+  ${GOFRONTEND_SOURCE_DIR}/import-archive.cc
+  ${GOFRONTEND_SOURCE_DIR}/import.cc
+  ${GOFRONTEND_SOURCE_DIR}/lex.cc
+  ${GOFRONTEND_SOURCE_DIR}/names.cc
+  ${GOFRONTEND_SOURCE_DIR}/parse.cc
+  ${GOFRONTEND_SOURCE_DIR}/runtime.cc
+  ${GOFRONTEND_SOURCE_DIR}/statements.cc
+  ${GOFRONTEND_SOURCE_DIR}/types.cc
+  ${GOFRONTEND_SOURCE_DIR}/unsafe.cc
+  ${GOFRONTEND_SOURCE_DIR}/wb.cc
+  go-backend.cpp
+  go-llvm-bexpression.cpp
+  go-llvm-bfunction.cpp
+  go-llvm-bnode.cpp
+  go-llvm-bstatement.cpp
+  go-llvm-btype.cpp
+  go-llvm-builtins.cpp
+  go-llvm-bvariable.cpp
+  go-llvm-cabi-oracle.cpp
+  go-llvm-diagnostics.cpp
+  go-llvm-dibuildhelper.cpp
+  go-llvm-genblocks.cpp
+  go-llvm-irbuilders.cpp
+  go-llvm-linemap.cpp
+  go-llvm-materialize.cpp
+  go-llvm-tree-integrity.cpp
+  go-llvm-typemanager.cpp
+  go-llvm.cpp
+  go-sha1.cpp
+)
+
+add_dependencies(LLVMCppGoFrontEnd intrinsics_gen)
+
+include_directories(${MPCINSTALL}/include)
+include_directories(${MPFRINSTALL}/include)
+include_directories(${GMPINSTALL}/include)
+include_directories(${GOFRONTEND_SOURCE_DIR})
+
diff --git a/llvm-gofrontend/filenames.h b/bridge/filenames.h
similarity index 100%
rename from llvm-gofrontend/filenames.h
rename to bridge/filenames.h
diff --git a/llvm-gofrontend/go-backend.cpp b/bridge/go-backend.cpp
similarity index 100%
rename from llvm-gofrontend/go-backend.cpp
rename to bridge/go-backend.cpp
diff --git a/llvm-gofrontend/go-c.h b/bridge/go-c.h
similarity index 100%
rename from llvm-gofrontend/go-c.h
rename to bridge/go-c.h
diff --git a/llvm-gofrontend/go-llvm-backend.h b/bridge/go-llvm-backend.h
similarity index 100%
rename from llvm-gofrontend/go-llvm-backend.h
rename to bridge/go-llvm-backend.h
diff --git a/llvm-gofrontend/go-llvm-bexpression.cpp b/bridge/go-llvm-bexpression.cpp
similarity index 100%
rename from llvm-gofrontend/go-llvm-bexpression.cpp
rename to bridge/go-llvm-bexpression.cpp
diff --git a/llvm-gofrontend/go-llvm-bexpression.h b/bridge/go-llvm-bexpression.h
similarity index 100%
rename from llvm-gofrontend/go-llvm-bexpression.h
rename to bridge/go-llvm-bexpression.h
diff --git a/llvm-gofrontend/go-llvm-bfunction.cpp b/bridge/go-llvm-bfunction.cpp
similarity index 100%
rename from llvm-gofrontend/go-llvm-bfunction.cpp
rename to bridge/go-llvm-bfunction.cpp
diff --git a/llvm-gofrontend/go-llvm-bfunction.h b/bridge/go-llvm-bfunction.h
similarity index 100%
rename from llvm-gofrontend/go-llvm-bfunction.h
rename to bridge/go-llvm-bfunction.h
diff --git a/llvm-gofrontend/go-llvm-bnode.cpp b/bridge/go-llvm-bnode.cpp
similarity index 100%
rename from llvm-gofrontend/go-llvm-bnode.cpp
rename to bridge/go-llvm-bnode.cpp
diff --git a/llvm-gofrontend/go-llvm-bnode.h b/bridge/go-llvm-bnode.h
similarity index 100%
rename from llvm-gofrontend/go-llvm-bnode.h
rename to bridge/go-llvm-bnode.h
diff --git a/llvm-gofrontend/go-llvm-bstatement.cpp b/bridge/go-llvm-bstatement.cpp
similarity index 100%
rename from llvm-gofrontend/go-llvm-bstatement.cpp
rename to bridge/go-llvm-bstatement.cpp
diff --git a/llvm-gofrontend/go-llvm-bstatement.h b/bridge/go-llvm-bstatement.h
similarity index 100%
rename from llvm-gofrontend/go-llvm-bstatement.h
rename to bridge/go-llvm-bstatement.h
diff --git a/llvm-gofrontend/go-llvm-btype.cpp b/bridge/go-llvm-btype.cpp
similarity index 100%
rename from llvm-gofrontend/go-llvm-btype.cpp
rename to bridge/go-llvm-btype.cpp
diff --git a/llvm-gofrontend/go-llvm-btype.h b/bridge/go-llvm-btype.h
similarity index 100%
rename from llvm-gofrontend/go-llvm-btype.h
rename to bridge/go-llvm-btype.h
diff --git a/llvm-gofrontend/go-llvm-builtins.cpp b/bridge/go-llvm-builtins.cpp
similarity index 100%
rename from llvm-gofrontend/go-llvm-builtins.cpp
rename to bridge/go-llvm-builtins.cpp
diff --git a/llvm-gofrontend/go-llvm-builtins.h b/bridge/go-llvm-builtins.h
similarity index 100%
rename from llvm-gofrontend/go-llvm-builtins.h
rename to bridge/go-llvm-builtins.h
diff --git a/llvm-gofrontend/go-llvm-bvariable.cpp b/bridge/go-llvm-bvariable.cpp
similarity index 100%
rename from llvm-gofrontend/go-llvm-bvariable.cpp
rename to bridge/go-llvm-bvariable.cpp
diff --git a/llvm-gofrontend/go-llvm-bvariable.h b/bridge/go-llvm-bvariable.h
similarity index 100%
rename from llvm-gofrontend/go-llvm-bvariable.h
rename to bridge/go-llvm-bvariable.h
diff --git a/llvm-gofrontend/go-llvm-cabi-oracle.cpp b/bridge/go-llvm-cabi-oracle.cpp
similarity index 100%
rename from llvm-gofrontend/go-llvm-cabi-oracle.cpp
rename to bridge/go-llvm-cabi-oracle.cpp
diff --git a/llvm-gofrontend/go-llvm-cabi-oracle.h b/bridge/go-llvm-cabi-oracle.h
similarity index 100%
rename from llvm-gofrontend/go-llvm-cabi-oracle.h
rename to bridge/go-llvm-cabi-oracle.h
diff --git a/llvm-gofrontend/go-llvm-containertypes.h b/bridge/go-llvm-containertypes.h
similarity index 100%
rename from llvm-gofrontend/go-llvm-containertypes.h
rename to bridge/go-llvm-containertypes.h
diff --git a/llvm-gofrontend/go-llvm-diagnostics.cpp b/bridge/go-llvm-diagnostics.cpp
similarity index 100%
rename from llvm-gofrontend/go-llvm-diagnostics.cpp
rename to bridge/go-llvm-diagnostics.cpp
diff --git a/llvm-gofrontend/go-llvm-diagnostics.h b/bridge/go-llvm-diagnostics.h
similarity index 100%
rename from llvm-gofrontend/go-llvm-diagnostics.h
rename to bridge/go-llvm-diagnostics.h
diff --git a/llvm-gofrontend/go-llvm-dibuildhelper.cpp b/bridge/go-llvm-dibuildhelper.cpp
similarity index 100%
rename from llvm-gofrontend/go-llvm-dibuildhelper.cpp
rename to bridge/go-llvm-dibuildhelper.cpp
diff --git a/llvm-gofrontend/go-llvm-dibuildhelper.h b/bridge/go-llvm-dibuildhelper.h
similarity index 100%
rename from llvm-gofrontend/go-llvm-dibuildhelper.h
rename to bridge/go-llvm-dibuildhelper.h
diff --git a/llvm-gofrontend/go-llvm-genblocks.cpp b/bridge/go-llvm-genblocks.cpp
similarity index 100%
rename from llvm-gofrontend/go-llvm-genblocks.cpp
rename to bridge/go-llvm-genblocks.cpp
diff --git a/llvm-gofrontend/go-llvm-genblocks.h b/bridge/go-llvm-genblocks.h
similarity index 100%
rename from llvm-gofrontend/go-llvm-genblocks.h
rename to bridge/go-llvm-genblocks.h
diff --git a/llvm-gofrontend/go-llvm-irbuilders.cpp b/bridge/go-llvm-irbuilders.cpp
similarity index 100%
rename from llvm-gofrontend/go-llvm-irbuilders.cpp
rename to bridge/go-llvm-irbuilders.cpp
diff --git a/llvm-gofrontend/go-llvm-irbuilders.h b/bridge/go-llvm-irbuilders.h
similarity index 100%
rename from llvm-gofrontend/go-llvm-irbuilders.h
rename to bridge/go-llvm-irbuilders.h
diff --git a/llvm-gofrontend/go-llvm-linemap.cpp b/bridge/go-llvm-linemap.cpp
similarity index 100%
rename from llvm-gofrontend/go-llvm-linemap.cpp
rename to bridge/go-llvm-linemap.cpp
diff --git a/llvm-gofrontend/go-llvm-linemap.h b/bridge/go-llvm-linemap.h
similarity index 100%
rename from llvm-gofrontend/go-llvm-linemap.h
rename to bridge/go-llvm-linemap.h
diff --git a/llvm-gofrontend/go-llvm-materialize.cpp b/bridge/go-llvm-materialize.cpp
similarity index 100%
rename from llvm-gofrontend/go-llvm-materialize.cpp
rename to bridge/go-llvm-materialize.cpp
diff --git a/llvm-gofrontend/go-llvm-tree-integrity.cpp b/bridge/go-llvm-tree-integrity.cpp
similarity index 100%
rename from llvm-gofrontend/go-llvm-tree-integrity.cpp
rename to bridge/go-llvm-tree-integrity.cpp
diff --git a/llvm-gofrontend/go-llvm-tree-integrity.h b/bridge/go-llvm-tree-integrity.h
similarity index 100%
rename from llvm-gofrontend/go-llvm-tree-integrity.h
rename to bridge/go-llvm-tree-integrity.h
diff --git a/llvm-gofrontend/go-llvm-typemanager.cpp b/bridge/go-llvm-typemanager.cpp
similarity index 100%
rename from llvm-gofrontend/go-llvm-typemanager.cpp
rename to bridge/go-llvm-typemanager.cpp
diff --git a/llvm-gofrontend/go-llvm-typemanager.h b/bridge/go-llvm-typemanager.h
similarity index 100%
rename from llvm-gofrontend/go-llvm-typemanager.h
rename to bridge/go-llvm-typemanager.h
diff --git a/llvm-gofrontend/go-llvm.cpp b/bridge/go-llvm.cpp
similarity index 100%
rename from llvm-gofrontend/go-llvm.cpp
rename to bridge/go-llvm.cpp
diff --git a/llvm-gofrontend/go-llvm.h b/bridge/go-llvm.h
similarity index 100%
rename from llvm-gofrontend/go-llvm.h
rename to bridge/go-llvm.h
diff --git a/llvm-gofrontend/go-location.h b/bridge/go-location.h
similarity index 100%
rename from llvm-gofrontend/go-location.h
rename to bridge/go-location.h
diff --git a/llvm-gofrontend/go-sha1.cpp b/bridge/go-sha1.cpp
similarity index 100%
rename from llvm-gofrontend/go-sha1.cpp
rename to bridge/go-sha1.cpp
diff --git a/llvm-gofrontend/go-system.h b/bridge/go-system.h
similarity index 100%
rename from llvm-gofrontend/go-system.h
rename to bridge/go-system.h
diff --git a/llvm-gofrontend/llvm-includes.h b/bridge/llvm-includes.h
similarity index 100%
rename from llvm-gofrontend/llvm-includes.h
rename to bridge/llvm-includes.h
diff --git a/llvm-gofrontend/namegen.h b/bridge/namegen.h
similarity index 100%
rename from llvm-gofrontend/namegen.h
rename to bridge/namegen.h
diff --git a/driver/CMakeLists.txt b/driver/CMakeLists.txt
new file mode 100644
index 0000000..5e8d87c
--- /dev/null
+++ b/driver/CMakeLists.txt
@@ -0,0 +1,43 @@
+
+# Rules for building llvm-goparse executable.
+
+#----------------------------------------------------------------------
+
+# Libraries that we need to link into llvm-goparse
+set(LLVM_LINK_COMPONENTS
+  ${LLVM_TARGETS_TO_BUILD}
+  CppGoFrontEnd
+  CodeGen
+  Core
+  IRReader
+  MC
+  Support
+  Target
+  Object
+  Passes
+  Support
+  )
+
+# Include directories needed by llvm-goparse
+include_directories(${GOFRONTEND_SOURCE_DIR})
+include_directories(${BRIDGE_SOURCE_DIR})
+
+# Gofrontend headers use headers from these packages.
+include_directories(${MPCINSTALL}/include)
+include_directories(${MPFRINSTALL}/include)
+include_directories(${GMPINSTALL}/include)
+
+# The llvm-goparse executable itself
+add_llvm_tool(llvm-goparse
+  goparse-llvm.cpp
+  )
+
+# Record the fact that llvm-goparse depends on these libs
+add_dependencies(llvm-goparse libmpfr libmpc libgmp)
+
+# Add in the libraries for the llvm-goparse dependencies.
+target_link_libraries(llvm-goparse
+  "-L${MPCLIBDIR}" "-lmpc"
+  "-L${MPFRLIBDIR}" "-lmpfr"
+  "-L${GMPLIBDIR}" "-lgmp")
+
diff --git a/goparse-llvm.cpp b/driver/goparse-llvm.cpp
similarity index 100%
rename from goparse-llvm.cpp
rename to driver/goparse-llvm.cpp
diff --git a/llvm-gofrontend/CMakeLists.txt b/llvm-gofrontend/CMakeLists.txt
deleted file mode 100644
index ff28d18..0000000
--- a/llvm-gofrontend/CMakeLists.txt
+++ /dev/null
@@ -1,56 +0,0 @@
-
-set(LLVM_LINK_COMPONENTS
-  CodeGen
-  Core
-  Support
-  )
-
-add_llvm_library(LLVMCppGoFrontEnd
-gofrontend/go/ast-dump.cc
-gofrontend/go/escape.cc
-gofrontend/go/export.cc
-gofrontend/go/expressions.cc
-gofrontend/go/go-diagnostics.cc
-gofrontend/go/go-encode-id.cc
-gofrontend/go/go-dump.cc
-gofrontend/go/go-optimize.cc
-gofrontend/go/go.cc
-gofrontend/go/gogo.cc
-gofrontend/go/import-archive.cc
-gofrontend/go/import.cc
-gofrontend/go/lex.cc
-gofrontend/go/names.cc
-gofrontend/go/parse.cc
-gofrontend/go/runtime.cc
-gofrontend/go/statements.cc
-gofrontend/go/types.cc
-gofrontend/go/unsafe.cc
-gofrontend/go/wb.cc
-go-backend.cpp
-go-llvm-bexpression.cpp
-go-llvm-bfunction.cpp
-go-llvm-bnode.cpp
-go-llvm-bstatement.cpp
-go-llvm-btype.cpp
-go-llvm-builtins.cpp
-go-llvm-bvariable.cpp
-go-llvm-cabi-oracle.cpp
-go-llvm-diagnostics.cpp
-go-llvm-dibuildhelper.cpp
-go-llvm-genblocks.cpp
-go-llvm-irbuilders.cpp
-go-llvm-linemap.cpp
-go-llvm-materialize.cpp
-go-llvm-tree-integrity.cpp
-go-llvm-typemanager.cpp
-go-llvm.cpp
-go-sha1.cpp
-)
-
-add_dependencies(LLVMCppGoFrontEnd intrinsics_gen)
-
-include_directories(${MPCINSTALL}/include)
-include_directories(${MPFRINSTALL}/include)
-include_directories(${GMPINSTALL}/include)
-include_directories(${CMAKE_CURRENT_SOURCE_DIR}/gofrontend/go)
-
diff --git a/unittests/CMakeLists.txt b/unittests/CMakeLists.txt
index 2026079..cb24fa0 100644
--- a/unittests/CMakeLists.txt
+++ b/unittests/CMakeLists.txt
@@ -12,11 +12,10 @@
   add_unittest(GoBackendUnitTests ${test_dirname} ${ARGN})
 endfunction()
 
-include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../llvm-gofrontend)
-include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../llvm-gofrontend/gofrontend/go)
-
 include_directories(${MPCINSTALL}/include)
 include_directories(${MPFRINSTALL}/include)
 include_directories(${GMPINSTALL}/include)
+include_directories(${BRIDGE_SOURCE_DIR})
+include_directories(${GOFRONTEND_SOURCE_DIR})
 
 add_subdirectory(BackendCore)