| 749 | } |
| 750 | |
| 751 | LogicalResult invalidLocError(Operation *op, Attribute attr) { |
| 752 | return op->emitError() |
| 753 | << "unsupported location, got " |
| 754 | << TypeSwitch<Attribute, StringRef>(attr) |
| 755 | .Case([&](OpaqueLoc loc) { return "OpaqueLoc"; }) |
| 756 | .Case([&](NameLoc loc) { return "NameLoc"; }) |
| 757 | .Case([&](FusedLoc loc) { return "FusedLoc"; }) |
| 758 | .Case([&](UnknownLoc loc) { return "UnknownLoc"; }) |
| 759 | .Case([&](FileLineColLoc loc) { return "FileLineColLoc"; }) |
| 760 | .Default([&](Attribute loc) { return "Unknown Attribute"; }) |
| 761 | << ", expected DILocAttr or CallSiteLoc"; |
| 762 | } |
| 763 | |
| 764 | Bytecode::DebugReserved getDebugReserved(Attribute attr) { |
| 765 | return TypeSwitch<Attribute, Bytecode::DebugReserved>(attr) |