Summary: Some fairly simple changes to start with.
Reviewers: arsenm, craig.topper, tra, MartinO
Subscribers: wdng, llvm-commits
Differential Revision: https://reviews.llvm.org/D43552
Change-Id: I0c92731b36d309c6edfcae42595ae1a70cc051c9
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325795
91177308-0d34-0410-b5e6-
96231b3b80d8
if (BitList.empty())
if (VarInit *VI = dyn_cast<VarInit>(V))
if (VI->getNameInit() == ValName && !AllowSelfAssignment)
if (BitList.empty())
if (VarInit *VI = dyn_cast<VarInit>(V))
if (VI->getNameInit() == ValName && !AllowSelfAssignment)
+ return Error(Loc, "Recursion / self-assignment forbidden");
// If we are assigning to a subset of the bits in the value... then we must be
// assigning to a field of BitsRecTy, which must have a BitsInit
// If we are assigning to a subset of the bits in the value... then we must be
// assigning to a field of BitsRecTy, which must have a BitsInit
if (BitsInit *BI = dyn_cast<BitsInit>(V))
InitType = (Twine("' of type bit initializer with length ") +
Twine(BI->getNumBits())).str();
if (BitsInit *BI = dyn_cast<BitsInit>(V))
InitType = (Twine("' of type bit initializer with length ") +
Twine(BI->getNumBits())).str();
+ else if (TypedInit *TI = dyn_cast<TypedInit>(V))
+ InitType = (Twine("' of type '") + TI->getType()->getAsString()).str();
return Error(Loc, "Value '" + ValName->getAsUnquotedString() +
return Error(Loc, "Value '" + ValName->getAsUnquotedString() +
- "' of type '" + RV->getType()->getAsString() +
- "' is incompatible with initializer '" + V->getAsString() +
- InitType + "'");
+ "' of type '" + RV->getType()->getAsString() +
+ "' is incompatible with initializer '" +
+ V->getAsString() + InitType + "'");
// Make sure the deduced type is compatible with the given type
if (GivenListTy) {
if (!EltTy->typeIsConvertibleTo(GivenListTy->getElementType())) {
// Make sure the deduced type is compatible with the given type
if (GivenListTy) {
if (!EltTy->typeIsConvertibleTo(GivenListTy->getElementType())) {
- TokError("Element type mismatch for list");
+ TokError(Twine("Element type mismatch for list: element type '") +
+ EltTy->getAsString() + "' not convertible to '" +
+ GivenListTy->getElementType()->getAsString());