[clang] 9b2f2d8 - [clang][Interp][NFC] Remove unused function

Timm Bäder via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 14 04:39:24 PDT 2022


Author: Timm Bäder
Date: 2022-10-14T13:32:00+02:00
New Revision: 9b2f2d846345dfbc4256db1ebf2b6176553fa157

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

LOG: [clang][Interp][NFC] Remove unused function

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/clang/lib/AST/Interp/ByteCodeExprGen.cpp b/clang/lib/AST/Interp/ByteCodeExprGen.cpp
index 2a25380df607..448bea9ab267 100644
--- a/clang/lib/AST/Interp/ByteCodeExprGen.cpp
+++ b/clang/lib/AST/Interp/ByteCodeExprGen.cpp
@@ -815,18 +815,6 @@ bool ByteCodeExprGen<Emitter>::visitInitializer(const Expr *Initializer) {
   return this->Visit(Initializer);
 }
 
-template <class Emitter>
-bool ByteCodeExprGen<Emitter>::getPtrVarDecl(const VarDecl *VD, const Expr *E) {
-  // Generate a pointer to the local, loading refs.
-  if (Optional<unsigned> Idx = getGlobalIdx(VD)) {
-    if (VD->getType()->isReferenceType())
-      return this->emitGetGlobalPtr(*Idx, E);
-    else
-      return this->emitGetPtrGlobal(*Idx, E);
-  }
-  return this->bail(VD);
-}
-
 template <class Emitter>
 llvm::Optional<unsigned>
 ByteCodeExprGen<Emitter>::getGlobalIdx(const VarDecl *VD) {

diff  --git a/clang/lib/AST/Interp/ByteCodeExprGen.h b/clang/lib/AST/Interp/ByteCodeExprGen.h
index 5e5bbbd6948a..f55ac2ff433b 100644
--- a/clang/lib/AST/Interp/ByteCodeExprGen.h
+++ b/clang/lib/AST/Interp/ByteCodeExprGen.h
@@ -243,9 +243,6 @@ class ByteCodeExprGen : public ConstStmtVisitor<ByteCodeExprGen<Emitter>, bool>,
     return emitConst(*Ctx.classify(Ty), NumBits, WrappedValue, E);
   }
 
-  /// Returns a pointer to a variable declaration.
-  bool getPtrVarDecl(const VarDecl *VD, const Expr *E);
-
   /// Returns the index of a global.
   llvm::Optional<unsigned> getGlobalIdx(const VarDecl *VD);
 


        


More information about the cfe-commits mailing list