isASTErroneous in offlineasm should de-macroify before looking for Errors
authorkeith_miller@apple.com <keith_miller@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 16 Oct 2018 19:16:24 +0000 (19:16 +0000)
committerkeith_miller@apple.com <keith_miller@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 16 Oct 2018 19:16:24 +0000 (19:16 +0000)
https://bugs.webkit.org/show_bug.cgi?id=190634

Reviewed by Mark Lam.

If a macro isn't usable in a configuration it might still cause us to
think the ast is invalid. This change runs the de-macroifier before
looking for errors.

Also, it adds a missing include to Printer.h.

* assembler/Printer.h:
* offlineasm/settings.rb:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@237197 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/assembler/Printer.h
Source/JavaScriptCore/offlineasm/settings.rb

index 28a6fcb..4196008 100644 (file)
@@ -1,3 +1,19 @@
+2018-10-16  Keith Miller  <keith_miller@apple.com>
+
+        isASTErroneous in offlineasm should de-macroify before looking for Errors
+        https://bugs.webkit.org/show_bug.cgi?id=190634
+
+        Reviewed by Mark Lam.
+
+        If a macro isn't usable in a configuration it might still cause us to
+        think the ast is invalid. This change runs the de-macroifier before
+        looking for errors.
+
+        Also, it adds a missing include to Printer.h.
+
+        * assembler/Printer.h:
+        * offlineasm/settings.rb:
+
 2018-10-16  Justin Michaud  <justin_michaud@apple.com>
 
         Implement feature flag and bindings for CSS Painting API
index 6d46cd9..3318dfc 100644 (file)
@@ -25,6 +25,8 @@
 
 #pragma once
 
+#include "CPU.h"
+
 #include <wtf/PrintStream.h>
 #include <wtf/StringPrintStream.h>
 #include <wtf/Vector.h>
index 0647c82..ef57140 100644 (file)
@@ -165,7 +165,7 @@ end
 #
 
 def isASTErroneous(ast)
-    not ast.filter(Error).empty?
+    not ast.demacroify({}).filter(Error).empty?
 end
 
 #
@@ -203,7 +203,7 @@ def emitCodeInConfiguration(concreteSettings, ast, backend)
     end
     
     if isASTErroneous(ast)
-        $output.puts "#error \"Invalid configuration.\""
+        $output.puts "#error \"Invalid configuration. Error at: #{ast.filter(Error)[0].codeOrigin}\""
     elsif not WORKING_BACKENDS.include? backend
         $output.puts "#error \"This backend is not supported yet.\""
     else