OSDN Git Service

[TableGen] Prevent invalid code generation when emitting AssemblerPredicate conditions.
authorToma Tabacu <toma.tabacu@imgtec.com>
Tue, 7 Apr 2015 12:10:11 +0000 (12:10 +0000)
committerToma Tabacu <toma.tabacu@imgtec.com>
Tue, 7 Apr 2015 12:10:11 +0000 (12:10 +0000)
commit0e407e7bbff8bb26f25a8c5bc5926902abc44e92
treeafce37ac71e3d5f4db288de9b5e3973e8e3c2df4
parent1fe75126274262c55648e802e47557ee0c7f9d90
[TableGen] Prevent invalid code generation when emitting AssemblerPredicate conditions.

Summary:
The loop which emits AssemblerPredicate conditions also links them together by emitting a '&&'.
If the 1st predicate is not an AssemblerPredicate, while the 2nd one is, nothing gets emitted for the 1st one, but we still emit the '&&' because of the 2nd predicate.
This generated code looks like "( && Cond2)" and is invalid.

Reviewers: dsanders

Reviewed By: dsanders

Subscribers: dsanders, llvm-commits

Differential Revision: http://reviews.llvm.org/D8294

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234312 91177308-0d34-0410-b5e6-96231b3b80d8
test/TableGen/AsmPredicateCondsEmission.td [new file with mode: 0644]
utils/TableGen/FixedLenDecoderEmitter.cpp