[clang] b61e8c5 - [clang][Interp][NFC] Add Record::getName()

Timm Bäder via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 28 03:49:53 PDT 2022


Author: Timm Bäder
Date: 2022-10-28T12:49:34+02:00
New Revision: b61e8c517eff2083252b1b74544bc25f7ad5a368

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

LOG: [clang][Interp][NFC] Add Record::getName()

Useful for debugging.

Added: 
    

Modified: 
    clang/lib/AST/Interp/Record.h

Removed: 
    


################################################################################
diff  --git a/clang/lib/AST/Interp/Record.h b/clang/lib/AST/Interp/Record.h
index 7743ad8dbb6fd..38920f75fe120 100644
--- a/clang/lib/AST/Interp/Record.h
+++ b/clang/lib/AST/Interp/Record.h
@@ -48,6 +48,8 @@ class Record final {
 public:
   /// Returns the underlying declaration.
   const RecordDecl *getDecl() const { return Decl; }
+  /// Returns the name of the underlying declaration.
+  const std::string getName() const { return Decl->getNameAsString(); }
   /// Checks if the record is a union.
   bool isUnion() const { return getDecl()->isUnion(); }
   /// Returns the size of the record.


        


More information about the cfe-commits mailing list