Changeset 247551 in webkit
- Timestamp:
- Jul 17, 2019 6:18:55 PM (5 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 1 deleted
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r247549 r247551 1 2019-07-17 Robin Morisset <rmorisset@apple.com> 2 3 [WHLSL] Remove traps from the compiler 4 https://bugs.webkit.org/show_bug.cgi?id=195811 5 <rdar://problem/50746299> 6 7 Reviewed by Myles Maxfield. 8 9 Remove the Trap statement from the language, see https://github.com/gpuweb/WHLSL/issues/301. 10 11 No new tests, as this part of the language was already untested, and we are removing it, not adding anything. 12 13 * Modules/webgpu/WHLSL/AST/WHLSLAST.h: 14 * Modules/webgpu/WHLSL/AST/WHLSLStatement.h: 15 (WebCore::WHLSL::AST::Statement::isSwitchStatement const): 16 * Modules/webgpu/WHLSL/AST/WHLSLTrap.h: Removed. 17 * Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.cpp: 18 * Modules/webgpu/WHLSL/WHLSLASTDumper.cpp: 19 * Modules/webgpu/WHLSL/WHLSLASTDumper.h: 20 * Modules/webgpu/WHLSL/WHLSLLexer.cpp: 21 (WebCore::WHLSL::Token::typeName): 22 (WebCore::WHLSL::Lexer::recognizeKeyword): 23 * Modules/webgpu/WHLSL/WHLSLLexer.h: 24 * Modules/webgpu/WHLSL/WHLSLParser.cpp: 25 (WebCore::WHLSL::Parser::parseStatement): 26 * Modules/webgpu/WHLSL/WHLSLParser.h: 27 * Modules/webgpu/WHLSL/WHLSLStatementBehaviorChecker.cpp: 28 * Modules/webgpu/WHLSL/WHLSLVisitor.cpp: 29 (WebCore::WHLSL::Visitor::visit): 30 * Modules/webgpu/WHLSL/WHLSLVisitor.h: 31 * WebCore.xcodeproj/project.pbxproj: 32 1 33 2019-07-17 Robin Morisset <rmorisset@apple.com> 2 34 -
trunk/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLAST.h
r247499 r247551 91 91 #include "WHLSLSwitchStatement.h" 92 92 #include "WHLSLTernaryExpression.h" 93 #include "WHLSLTrap.h"94 93 #include "WHLSLType.h" 95 94 #include "WHLSLTypeArgument.h" -
trunk/Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLStatement.h
r247499 r247551 61 61 virtual bool isSwitchCase() const { return false; } 62 62 virtual bool isSwitchStatement() const { return false; } 63 virtual bool isTrap() const { return false; }64 63 virtual bool isVariableDeclarationsStatement() const { return false; } 65 64 virtual bool isWhileLoop() const { return false; } -
trunk/Source/WebCore/Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.cpp
r247499 r247551 127 127 void visit(AST::SwitchStatement&) override; 128 128 void visit(AST::SwitchCase&) override; 129 void visit(AST::Trap&) override;130 129 void visit(AST::VariableDeclarationsStatement&) override; 131 130 void visit(AST::WhileLoop&) override; … … 418 417 } 419 418 420 void FunctionDefinitionWriter::visit(AST::Trap&)421 {422 // FIXME: https://bugs.webkit.org/show_bug.cgi?id=195811 Implement this423 notImplemented();424 }425 426 419 void FunctionDefinitionWriter::visit(AST::VariableDeclarationsStatement& variableDeclarationsStatement) 427 420 { -
trunk/Source/WebCore/Modules/webgpu/WHLSL/WHLSLASTDumper.cpp
r247499 r247551 503 503 } 504 504 505 void ASTDumper::visit(AST::Trap&)506 {507 m_out.print("trap");508 }509 510 505 void ASTDumper::visit(AST::SwitchStatement& switchStatement) 511 506 { -
trunk/Source/WebCore/Modules/webgpu/WHLSL/WHLSLASTDumper.h
r247499 r247551 99 99 void visit(AST::SwitchCase&) override; 100 100 void visit(AST::SwitchStatement&) override; 101 void visit(AST::Trap&) override;102 101 void visit(AST::VariableDeclarationsStatement&) override; 103 102 void visit(AST::WhileLoop&) override; -
trunk/Source/WebCore/Modules/webgpu/WHLSL/WHLSLLexer.cpp
r247329 r247551 74 74 case Type::Return: 75 75 return "return"; 76 case Type::Trap:77 return "trap";78 76 case Type::Null: 79 77 return "null"; … … 290 288 if (substring == "return") 291 289 return Token::Type::Return; 292 if (substring == "trap")293 return Token::Type::Trap;294 290 if (substring == "null") 295 291 return Token::Type::Null; -
trunk/Source/WebCore/Modules/webgpu/WHLSL/WHLSLLexer.h
r247329 r247551 90 90 Do, 91 91 Return, 92 Trap,93 92 Null, 94 93 True, -
trunk/Source/WebCore/Modules/webgpu/WHLSL/WHLSLParser.cpp
r247499 r247551 1300 1300 auto fallthroughObject = AST::Fallthrough(WTFMove(fallthroughToken)); 1301 1301 return { makeUniqueRef<AST::Fallthrough>(WTFMove(fallthroughObject)) }; 1302 }1303 case Token::Type::Trap: {1304 auto trapToken = m_lexer.consumeToken();1305 CONSUME_TYPE(semicolon, Semicolon);1306 auto trapObject = AST::Trap(WTFMove(trapToken));1307 return { makeUniqueRef<AST::Trap>(WTFMove(trapObject)) };1308 1302 } 1309 1303 case Token::Type::Return: { -
trunk/Source/WebCore/Modules/webgpu/WHLSL/WHLSLParser.h
r247499 r247551 83 83 #include "WHLSLSwitchStatement.h" 84 84 #include "WHLSLTernaryExpression.h" 85 #include "WHLSLTrap.h"86 85 #include "WHLSLType.h" 87 86 #include "WHLSLTypeArgument.h" -
trunk/Source/WebCore/Modules/webgpu/WHLSL/WHLSLStatementBehaviorChecker.cpp
r247499 r247551 42 42 #include "WHLSLSwitchCase.h" 43 43 #include "WHLSLSwitchStatement.h" 44 #include "WHLSLTrap.h"45 44 #include "WHLSLVariableDeclarationsStatement.h" 46 45 #include "WHLSLVisitor.h" … … 87 86 88 87 void visit(AST::Return&) override 89 {90 m_stack.append({ Behavior::Return });91 }92 93 void visit(AST::Trap&) override94 88 { 95 89 m_stack.append({ Behavior::Return }); -
trunk/Source/WebCore/Modules/webgpu/WHLSL/WHLSLVisitor.cpp
r247499 r247551 330 330 else if (is<AST::SwitchStatement>(statement)) 331 331 checkErrorAndVisit(downcast<AST::SwitchStatement>(statement)); 332 else if (is<AST::Trap>(statement))333 checkErrorAndVisit(downcast<AST::Trap>(statement));334 332 else if (is<AST::VariableDeclarationsStatement>(statement)) 335 333 checkErrorAndVisit(downcast<AST::VariableDeclarationsStatement>(statement)); … … 468 466 } 469 467 470 void Visitor::visit(AST::Trap&)471 {472 }473 474 468 void Visitor::visit(AST::VariableDeclarationsStatement& variableDeclarationsStatement) 475 469 { -
trunk/Source/WebCore/Modules/webgpu/WHLSL/WHLSLVisitor.h
r247499 r247551 84 84 class SwitchCase; 85 85 class SwitchStatement; 86 class Trap;87 86 class VariableDeclarationsStatement; 88 87 class WhileLoop; … … 165 164 virtual void visit(AST::SwitchCase&); 166 165 virtual void visit(AST::SwitchStatement&); 167 virtual void visit(AST::Trap&);168 166 virtual void visit(AST::VariableDeclarationsStatement&); 169 167 virtual void visit(AST::WhileLoop&); -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r247530 r247551 13245 13245 C2138A1621DDECFB00F516BA /* WHLSLSpecializationConstantSemantic.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = WHLSLSpecializationConstantSemantic.cpp; sourceTree = "<group>"; }; 13246 13246 C2138A1721DDED0D00F516BA /* WHLSLStageInOutSemantic.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = WHLSLStageInOutSemantic.cpp; sourceTree = "<group>"; }; 13247 C21BF6F321CD89AD00227979 /* WHLSLTrap.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WHLSLTrap.h; sourceTree = "<group>"; };13248 13247 C21BF6F421CD89B300227979 /* WHLSLFunctionDefinition.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WHLSLFunctionDefinition.h; sourceTree = "<group>"; }; 13249 13248 C21BF6F521CD89B500227979 /* WHLSLContinue.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WHLSLContinue.h; sourceTree = "<group>"; }; … … 17142 17141 C21BF73121CD89EE00227979 /* WHLSLSwitchStatement.h */, 17143 17142 C21BF71C21CD89DA00227979 /* WHLSLTernaryExpression.h */, 17144 C21BF6F321CD89AD00227979 /* WHLSLTrap.h */,17145 17143 C21BF71D21CD89DB00227979 /* WHLSLType.h */, 17146 17144 C288C72D21C991DA002DF5CA /* WHLSLTypeArgument.cpp */,
Note: See TracChangeset
for help on using the changeset viewer.