| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
[NFC] Trim trailing whitespace in *.rst | 4 年前 | |
[NFC] Trim trailing whitespace in *.rst | 4 年前 | |
[TableGen] Add new operator !exists We can cast a string to a record via !cast, but we have no mechanism to check if it is valid and TableGen will raise an error if failed to cast. Besides, we have no semantic null in TableGen (we have ? but different backends handle uninitialized value differently), so operator like dyn_cast<> is hard to implement. In this patch, we add a new operator !exists<T>(s) to check whether a record with type T and name s exists. Self-references are allowed just like !cast. By doing these, we can write code like: class dyn_cast_to_record<string name> { R value = !if(!exists<R>(name), !cast<R>(name), default_value); } defvar v = dyn_cast_to_record<"R0">.value; // R0 or default_value. Reviewed By: tra, nhaehnle Differential Revision: https://reviews.llvm.org/D127948 | 4 年前 | |
[NFC] Trim trailing whitespace in *.rst | 4 年前 |
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
| 4 年前 | ||
| 4 年前 | ||
| 4 年前 | ||
| 4 年前 |