[clang] 0da7e40 - [clang][Interp][NFC] Context::classify() can be const

Timm Bäder via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 7 22:31:58 PDT 2022


Author: Timm Bäder
Date: 2022-09-08T07:31:08+02:00
New Revision: 0da7e409e0cb09ea955d9751d2601449244cc53f

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

LOG: [clang][Interp][NFC] Context::classify() can be const

Added: 
    

Modified: 
    clang/lib/AST/Interp/Context.cpp
    clang/lib/AST/Interp/Context.h

Removed: 
    


################################################################################
diff  --git a/clang/lib/AST/Interp/Context.cpp b/clang/lib/AST/Interp/Context.cpp
index 3bfcdfcd4c58..9f3f5542fe83 100644
--- a/clang/lib/AST/Interp/Context.cpp
+++ b/clang/lib/AST/Interp/Context.cpp
@@ -59,7 +59,7 @@ bool Context::evaluateAsInitializer(State &Parent, const VarDecl *VD,
 
 const LangOptions &Context::getLangOpts() const { return Ctx.getLangOpts(); }
 
-llvm::Optional<PrimType> Context::classify(QualType T) {
+llvm::Optional<PrimType> Context::classify(QualType T) const {
   if (T->isReferenceType() || T->isPointerType()) {
     return PT_Ptr;
   }

diff  --git a/clang/lib/AST/Interp/Context.h b/clang/lib/AST/Interp/Context.h
index 0627d9fb14f5..fbd781026850 100644
--- a/clang/lib/AST/Interp/Context.h
+++ b/clang/lib/AST/Interp/Context.h
@@ -60,7 +60,7 @@ class Context {
   unsigned getCharBit() const;
 
   /// Classifies an expression.
-  llvm::Optional<PrimType> classify(QualType T);
+  llvm::Optional<PrimType> classify(QualType T) const;
 
 private:
   /// Runs a function.


        


More information about the cfe-commits mailing list