1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 11:13:28 +01:00
llvm-mirror/lib/TableGen
Daniel Sanders a562501cd0 [tblgen] Add getOperatorAsDef() to Record
Summary:
While working with DagInit's, it's often the case that you expect the
operator to be a reference to a def. This patch adds a wrapper for this
common case to reduce the amount of boilerplate callers need to duplicate
repeatedly.

getOperatorAsDef() returns the record if the DagInit has an operator that is
a DefInit. Otherwise, it prints a fatal error.

There's only a few pre-existing examples in LLVM at the moment and I've
left a few instances of the code this simplifies as they had more specific
error messages than the generic one this produces. I'm going to be using
this a fair bit in my subsequent patches.

Reviewers: bogner, volkan, nhaehnle

Reviewed By: nhaehnle

Subscribers: nhaehnle, hiraditya, asb, rbar, johnrusso, simoncook, apazos, sabuasal, niosHD, jrtc27, MaskRay, zzheng, edward-jones, rogfer01, MartinMosbeck, brucehoult, the_o, PkmX, jocewei, lenary, s.egerton, pzheng, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D68424

llvm-svn: 374101
2019-10-08 18:41:32 +00:00
..
CMakeLists.txt
Error.cpp
JSONBackend.cpp
LLVMBuild.txt
Main.cpp Reland r349624: Let TableGen write output only if it changed, instead of doing so in cmake 2019-10-03 21:22:28 +00:00
Record.cpp [tblgen] Add getOperatorAsDef() to Record 2019-10-08 18:41:32 +00:00
SetTheory.cpp [llvm] Migrate llvm::make_unique to std::make_unique 2019-08-15 15:54:37 +00:00
StringMatcher.cpp
TableGenBackend.cpp
TGLexer.cpp [llvm] Migrate llvm::make_unique to std::make_unique 2019-08-15 15:54:37 +00:00
TGLexer.h
TGParser.cpp TGParser::ParseOperation - silence static analyzer dyn_cast<TypedInit> null dereference warning. NFCI. 2019-09-26 17:11:02 +00:00
TGParser.h TableGen: Handle nontrivial foreach range bounds 2019-05-22 21:28:20 +00:00