junrushao1994 commented on a change in pull request #9311:
URL: https://github.com/apache/tvm/pull/9311#discussion_r731379485
##########
File path: src/ir/module.cc
##########
@@ -170,7 +170,7 @@ Constructor IRModuleNode::GetConstructor(const String& adt,
const String& cons)
}
LOG(FATAL) << adt << " does not contain constructor " << cons;
- throw std::runtime_error("Constructor Not Found.");
+ return {};
Review comment:
BTW, there is no essential difference though (so i'm not suggesting
change here), but just wanted to share an interesting trick I learned to avoid
faking return arguments after `LOG(FATAL)`: we might just use an empty throw
statement like:
```c++
throw;
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]