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

Submitted by Laura Ekstrand on July 27, 2015, 5:25 p.m.

Details

Message ID 1438017917-4304-5-git-send-email-laura.d.ekstrand@intel.com
State New
Headers show

Not browsing as part of any series.

Commit Message

Laura Ekstrand July 27, 2015, 5:25 p.m.
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 | 1 +
 backend/src/backend/program.cpp     | 3 ++-
 backend/src/backend/program.h       | 1 +
 src/cl_program.c                    | 2 +-
 4 files changed, 5 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..7054dea 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 bdccc22..9d6822f 100644
--- a/backend/src/backend/program.cpp
+++ b/backend/src/backend/program.cpp
@@ -829,7 +829,8 @@  namespace gbe {
         } //Otherwise, you'll have to make do without the dump.
       }
 
-      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;