diff options
author | Jim Grosbach <grosbach@apple.com> | 2012-07-12 00:53:31 +0000 |
---|---|---|
committer | Jim Grosbach <grosbach@apple.com> | 2012-07-12 00:53:31 +0000 |
commit | e96ce46b4deabec1110fd9d58213cb884a33b61c (patch) | |
tree | 4d8828fe70c4017efe6e91311cc0dfa14fc5ee70 /lib/TableGen | |
parent | 9af64303fa887a3d9b75e715787ba587c3f18139 (diff) | |
download | llvm-e96ce46b4deabec1110fd9d58213cb884a33b61c.tar.gz llvm-e96ce46b4deabec1110fd9d58213cb884a33b61c.tar.bz2 llvm-e96ce46b4deabec1110fd9d58213cb884a33b61c.tar.xz |
TableGen: Location information for diagnostic.
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
Diffstat (limited to 'lib/TableGen')
-rw-r--r-- | lib/TableGen/Record.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/TableGen/Record.cpp b/lib/TableGen/Record.cpp index 93eed24b8d..99fdc1f6e9 100644 --- a/lib/TableGen/Record.cpp +++ b/lib/TableGen/Record.cpp @@ -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!"); } } |