[1/7] backend: Handle (but ignore) -dump-opt-asm=[PATH].

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

Details

Message ID 1439358860-6874-2-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>

Signed-off-by: Manasi Navare <manasi.d.navare@intel.com>
Signed-off-by: Laura Ekstrand <laura.d.ekstrand@intel.com>
---
 backend/src/backend/program.cpp | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

Patch hide | download patch | download mbox

diff --git a/backend/src/backend/program.cpp b/backend/src/backend/program.cpp
index 9caf1ac..404a668 100644
--- a/backend/src/backend/program.cpp
+++ b/backend/src/backend/program.cpp
@@ -641,6 +641,7 @@  namespace gbe {
                                      const char *temp_header_path,
                                      std::vector<std::string>& clOpt,
                                      std::string& dumpLLVMFileName,
+                                     std::string& dumpASMFileName,
                                      std::string& clName,
                                      int& optLevel,
                                      size_t stringSize,
@@ -725,6 +726,11 @@  namespace gbe {
           continue; // Don't push this str back; ignore it.
         }
 
+        if(str.find("-dump-opt-asm=") != std::string::npos) {
+          dumpASMFileName = str.substr(str.find("=") + 1);
+          continue; // Don't push this str back; ignore it.
+        }
+
         clOpt.push_back(str);
       }
       free(str);
@@ -787,9 +793,10 @@  namespace gbe {
     int optLevel = 1;
     std::vector<std::string> clOpt;
     std::string clName;
-    std::string dumpLLVMFileName;
+    std::string dumpLLVMFileName, dumpASMFileName;
     if (!processSourceAndOption(source, options, NULL, clOpt,
-                                dumpLLVMFileName, clName, optLevel,
+                                dumpLLVMFileName, dumpASMFileName,
+                                clName, optLevel,
                                 stringSize, err, errSize))
       return NULL;
 
@@ -863,9 +870,9 @@  namespace gbe {
     int optLevel = 1;
     std::vector<std::string> clOpt;
     std::string clName;
-    std::string dumpLLVMFileName;
+    std::string dumpLLVMFileName, dumpASMFileName;
     if (!processSourceAndOption(source, options, temp_header_path, clOpt,
-                                dumpLLVMFileName, clName,
+                                dumpLLVMFileName, dumpASMFileName, clName,
                                 optLevel, stringSize, err, errSize))
       return NULL;