[4/7] backend, src: Add ASM file name to gbe_program_new_from_llvm

Submitted by Manasi Navare on Aug. 12, 2015, 5:54 a.m.

Details

Message ID 1439358860-6874-5-git-send-email-manasi.d.navare@intel.com
State New
Headers show

Not browsing as part of any series.

Commit Message

Manasi Navare Aug. 12, 2015, 5:54 a.m.
From: Laura Ekstrand <laura.d.ekstrand@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@intel.com>
Signed-off-by: Laura Ekstrand <laura.d.ekstrand@intel.com>
---
 backend/src/backend/gen_program.cpp | 1 +
 backend/src/backend/program.cpp     | 2 +-
 backend/src/backend/program.h       | 1 +
 src/cl_program.c                    | 2 +-
 4 files changed, 4 insertions(+), 2 deletions(-)

Patch hide | download patch | download mbox

diff --git a/backend/src/backend/gen_program.cpp b/backend/src/backend/gen_program.cpp
index c761a2f..767db29 100644
--- a/backend/src/backend/gen_program.cpp
+++ b/backend/src/backend/gen_program.cpp
@@ -352,6 +352,7 @@  namespace gbe {
                                            const char *fileName,
                                            const void* module,
                                            const void* llvm_ctx,
+                                           const char* asm_file_name,
                                            size_t stringSize,
                                            char *err,
                                            size_t *errSize,
diff --git a/backend/src/backend/program.cpp b/backend/src/backend/program.cpp
index 404a668..6f64413 100644
--- a/backend/src/backend/program.cpp
+++ b/backend/src/backend/program.cpp
@@ -840,7 +840,7 @@  namespace gbe {
       }
       #endif
 
-      p = gbe_program_new_from_llvm(deviceID, NULL, out_module, llvm_ctx, stringSize,
+      p = gbe_program_new_from_llvm(deviceID, NULL, out_module, llvm_ctx, dumpASMFileName.c_str(), stringSize,
                                     err, errSize, optLevel);
       if (err != NULL)
         *errSize += clangErrSize;
diff --git a/backend/src/backend/program.h b/backend/src/backend/program.h
index 3637ebb..3267714 100644
--- a/backend/src/backend/program.h
+++ b/backend/src/backend/program.h
@@ -212,6 +212,7 @@  typedef gbe_program (gbe_program_new_from_llvm_cb)(uint32_t deviceID,
                                                    const char *fileName,
                                                    const void *module,
                                                    const void *llvm_ctx,
+                                                   const char *asm_file_name,
                                                    size_t string_size,
                                                    char *err,
                                                    size_t *err_size,
diff --git a/src/cl_program.c b/src/cl_program.c
index db53757..423cb5c 100644
--- a/src/cl_program.c
+++ b/src/cl_program.c
@@ -379,7 +379,7 @@  cl_program_create_from_llvm(cl_context ctx,
   INVALID_VALUE_IF (file_name == NULL);
 
   program = cl_program_new(ctx);
-  program->opaque = compiler_program_new_from_llvm(ctx->device->vendor_id, file_name, NULL, NULL, program->build_log_max_sz, program->build_log, &program->build_log_sz, 1);
+  program->opaque = compiler_program_new_from_llvm(ctx->device->vendor_id, file_name, NULL, NULL, NULL, program->build_log_max_sz, program->build_log, &program->build_log_sz, 1);
   if (UNLIKELY(program->opaque == NULL)) {
     err = CL_INVALID_PROGRAM;
     goto error;