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

Laura Ekstrand laura.d.ekstrand at intel.com
Mon Jul 27 10:25:15 PDT 2015


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.
---
 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 7054dea..b30ed8d 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);
   };
-- 
2.1.0



More information about the Beignet mailing list