mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 11:13:28 +01:00
951525e0a5
Summary: This allows you to make some of the defs in a multiclass or `foreach` conditional on an expression computed from the parameters or iteration variables. It was already possible to simulate an if statement using a `foreach` with a dummy iteration variable and a list constructed using `!if` so that it had length 0 or 1 depending on the condition, e.g. foreach unusedIterationVar = !if(condition, [1], []<int>) in { ... } But this syntax is nicer to read, and also more convenient because it allows an else clause. To avoid upheaval in the implementation, I've implemented `if` as pure syntactic sugar on the `foreach` implementation: internally, `ParseIf` actually does construct exactly the kind of foreach shown above (and another reversed one for the else clause if present). Reviewers: nhaehnle, hfinkel Reviewed By: hfinkel Subscribers: hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D71474 |
||
---|---|---|
.. | ||
CMakeLists.txt | ||
Error.cpp | ||
JSONBackend.cpp | ||
LLVMBuild.txt | ||
Main.cpp | ||
Record.cpp | ||
SetTheory.cpp | ||
StringMatcher.cpp | ||
TableGenBackend.cpp | ||
TGLexer.cpp | ||
TGLexer.h | ||
TGParser.cpp | ||
TGParser.h |