forked from OSchip/llvm-project
Emit a more sensible error message if no subclasses of Target are defined.
Patch contributed by Vladimir Prus. llvm-svn: 14010
This commit is contained in:
parent
57c586cf78
commit
aff10d0461
|
@ -72,6 +72,8 @@ std::ostream &operator<<(std::ostream &OS, MVT::ValueType T) {
|
|||
///
|
||||
CodeGenTarget::CodeGenTarget() : PointerType(MVT::Other) {
|
||||
std::vector<Record*> Targets = Records.getAllDerivedDefinitions("Target");
|
||||
if (Targets.size() == 0)
|
||||
throw std::string("ERROR: No 'Target' subclasses defined!");
|
||||
if (Targets.size() != 1)
|
||||
throw std::string("ERROR: Multiple subclasses of Target defined!");
|
||||
TargetRec = Targets[0];
|
||||
|
|
Loading…
Reference in New Issue