[llvm-commits] [llvm] r160098 - /llvm/trunk/lib/TableGen/Record.cpp

Jim Grosbach grosbach at apple.com
Wed Jul 11 17:53:31 PDT 2012


Author: grosbach
Date: Wed Jul 11 19:53:31 2012
New Revision: 160098

URL: http://llvm.org/viewvc/llvm-project?rev=160098&view=rev
Log:
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.

Modified:
    llvm/trunk/lib/TableGen/Record.cpp

Modified: llvm/trunk/lib/TableGen/Record.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/TableGen/Record.cpp?rev=160098&r1=160097&r2=160098&view=diff
==============================================================================
--- llvm/trunk/lib/TableGen/Record.cpp (original)
+++ llvm/trunk/lib/TableGen/Record.cpp Wed Jul 11 19:53:31 2012
@@ -1699,7 +1699,7 @@
   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!");
   }
 }
 





More information about the llvm-commits mailing list