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

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

Details

Message ID 1438017917-4304-2-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.
---
 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 b55f75a..bdccc22 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;
 
@@ -852,9 +859,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;