1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 02:52:53 +02:00
llvm-mirror/lib/TableGen
Simon Tatham 4450b91ba1 [TableGen] Fix spurious type error in bit assignment.
Summary:
The following example gives the error message "expected value of type
'bits<32>', got 'bit'" on the assignment.

    class Instruction { bits<32> encoding; }
    def foo: Instruction { let encoding{10} = !eq(0, 1); }

But there's nothing wrong with this code: 'bit' is a perfectly good
type for the RHS of an assignment to a //single bit// of an
instruction encoding.

The problem is that `ParseBodyItem` is accidentally type-checking the
RHS against the full type of the `encoding` field, without adjusting
it in the case where we're only assigning to a subset of the bits. The
fix is trivial.

Reviewers: nhaehnle, hfinkel

Reviewed By: hfinkel

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D74220
2020-02-07 15:11:42 +00:00
..
CMakeLists.txt [cmake] Explicitly mark libraries defined in lib/ as "Component Libraries" 2019-11-21 10:48:08 -08:00
Error.cpp [gicombiner] Hoist pure C++ combine into the tablegen definition 2019-10-16 23:53:35 +00:00
JSONBackend.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
LLVMBuild.txt Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
Main.cpp Tablegen: Remove the error for duplicate include files. 2019-11-20 18:24:10 -08:00
Record.cpp Make llvm::StringRef to std::string conversions explicit. 2020-01-28 23:25:25 +01:00
SetTheory.cpp Make llvm::StringRef to std::string conversions explicit. 2020-01-28 23:25:25 +01:00
StringMatcher.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
TableGenBackend.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
TGLexer.cpp [TableGen] Introduce an if/then/else statement. 2020-01-14 10:19:53 +00:00
TGLexer.h [TableGen] Introduce an if/then/else statement. 2020-01-14 10:19:53 +00:00
TGParser.cpp [TableGen] Fix spurious type error in bit assignment. 2020-02-07 15:11:42 +00:00
TGParser.h A bunch more implicit string conversions that my Clang didn't detect. 2020-01-29 00:30:16 +01:00