[llvm] c24fdc1 - [TableGen] Fix error message that called Record::getName on a possibly anonymous record.

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 6 20:40:41 PST 2023


Author: Craig Topper
Date: 2023-03-06T19:58:47-08:00
New Revision: c24fdc1834aea1f836fa15148ba0663a4de33337

URL: https://github.com/llvm/llvm-project/commit/c24fdc1834aea1f836fa15148ba0663a4de33337
DIFF: https://github.com/llvm/llvm-project/commit/c24fdc1834aea1f836fa15148ba0663a4de33337.diff

LOG: [TableGen] Fix error message that called Record::getName on a possibly anonymous record.

Record::getName only works for named records. Use getNameInitAsString
to handle anonymous records without crashing.

Added: 
    

Modified: 
    llvm/lib/TableGen/Record.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/TableGen/Record.cpp b/llvm/lib/TableGen/Record.cpp
index 654857fc19fe2..363bf7b446d53 100644
--- a/llvm/lib/TableGen/Record.cpp
+++ b/llvm/lib/TableGen/Record.cpp
@@ -2259,7 +2259,7 @@ Init *CondOpInit::Fold(Record *CurRec) const {
   }
 
   PrintFatalError(CurRec->getLoc(),
-                  CurRec->getName() +
+                  CurRec->getNameInitAsString() +
                   " does not have any true condition in:" +
                   this->getAsString());
   return nullptr;


        


More information about the llvm-commits mailing list