TableGen: Location information for diagnostic.
authorJim Grosbach <grosbach@apple.com>
Thu, 12 Jul 2012 00:53:31 +0000 (00:53 +0000)
committerJim Grosbach <grosbach@apple.com>
Thu, 12 Jul 2012 00:53:31 +0000 (00:53 +0000)
def Pat<...>;

Results in 'record name is not a string!' diagnostic. Not the best,
but the lack of location information moves it from not very helpful
into completely useless. We're in the Record class when throwing the
error, so just add the location info directly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160098 91177308-0d34-0410-b5e6-96231b3b80d8

lib/TableGen/Record.cpp

index 93eed24b8dc7e418e51c8fd5b0ddf5f659bb46a9..99fdc1f6e99429e6a560083d56579e999380e96e 100644 (file)
@@ -1699,7 +1699,7 @@ void Record::checkName() {
   assert(TypedName && "Record name is not typed!");
   RecTy *Type = TypedName->getType();
   if (dynamic_cast<StringRecTy *>(Type) == 0) {
-    throw "Record name is not a string!";
+    throw TGError(getLoc(), "Record name is not a string!");
   }
 }