[Beignet] [PATCH 5/7] backend: Add ASM file name to GenProgram object.

Manasi Navare manasi.d.navare at intel.com
Tue Aug 11 22:54:18 PDT 2015


From: Laura Ekstrand <laura.d.ekstrand at intel.com>

Part of the plumbing that passes the ASM file name from the compiler options
level down to the emitCode level so that the assembly can be written to that
file.

Signed-off-by: Manasi Navare <manasi.d.navare at intel.com>
Signed-off-by: Laura Ekstrand <laura.d.ekstrand at intel.com>
---
 backend/src/backend/gen_program.cpp | 2 +-
 backend/src/backend/gen_program.hpp | 4 +++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/backend/src/backend/gen_program.cpp b/backend/src/backend/gen_program.cpp
index 767db29..9546ab3 100644
--- a/backend/src/backend/gen_program.cpp
+++ b/backend/src/backend/gen_program.cpp
@@ -359,7 +359,7 @@ namespace gbe {
                                            int optLevel)
   {
     using namespace gbe;
-    GenProgram *program = GBE_NEW(GenProgram, deviceID, module, llvm_ctx);
+    GenProgram *program = GBE_NEW(GenProgram, deviceID, module, llvm_ctx, asm_file_name);
 #ifdef GBE_COMPILER_AVAILABLE
     std::string error;
     // Try to compile the program
diff --git a/backend/src/backend/gen_program.hpp b/backend/src/backend/gen_program.hpp
index af1a9fa..75d77ba 100644
--- a/backend/src/backend/gen_program.hpp
+++ b/backend/src/backend/gen_program.hpp
@@ -60,7 +60,8 @@ namespace gbe
   {
   public:
     /*! Create an empty program */
-    GenProgram(uint32_t deviceID, const void* mod = NULL, const void* ctx = NULL) : deviceID(deviceID),module((void*)mod), llvm_ctx((void*)ctx) {}
+    GenProgram(uint32_t deviceID, const void* mod = NULL, const void* ctx = NULL, const char* asm_fname = NULL) :
+      deviceID(deviceID),module((void*)mod), llvm_ctx((void*)ctx), asm_file_name(asm_fname) {}
     /*! Current device ID*/
     uint32_t deviceID;
     /*! Destroy the program */
@@ -75,6 +76,7 @@ namespace gbe
     }
     void* module;
     void* llvm_ctx;
+    const char* asm_file_name;
     /*! Use custom allocators */
     GBE_CLASS(GenProgram);
   };
-- 
1.9.1



More information about the Beignet mailing list