[clang] 4016e5d - [clang][Interp][NFC] Call emit*Ptr directly

Timm Bäder via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 6 01:26:07 PDT 2023


Author: Timm Bäder
Date: 2023-04-06T10:25:57+02:00
New Revision: 4016e5d9499e3cbcde32dbfe1d0a5085a9b16c96

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

LOG: [clang][Interp][NFC] Call emit*Ptr directly

Instead of the version that uses a switch statement to figure this out.

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/clang/lib/AST/Interp/ByteCodeExprGen.cpp b/clang/lib/AST/Interp/ByteCodeExprGen.cpp
index 2f9f99cc0648..a1f6f72c9bfc 100644
--- a/clang/lib/AST/Interp/ByteCodeExprGen.cpp
+++ b/clang/lib/AST/Interp/ByteCodeExprGen.cpp
@@ -1881,13 +1881,13 @@ bool ByteCodeExprGen<Emitter>::VisitDeclRefExpr(const DeclRefExpr *E) {
     return this->emitGetPtrLocal(Offset, E);
   } else if (auto GlobalIndex = P.getGlobal(D)) {
     if (IsReference)
-      return this->emitGetGlobal(PT_Ptr, *GlobalIndex, E);
+      return this->emitGetGlobalPtr(*GlobalIndex, E);
 
     return this->emitGetPtrGlobal(*GlobalIndex, E);
   } else if (const auto *PVD = dyn_cast<ParmVarDecl>(D)) {
     if (auto It = this->Params.find(PVD); It != this->Params.end()) {
       if (IsReference)
-        return this->emitGetParam(PT_Ptr, It->second, E);
+        return this->emitGetParamPtr(It->second, E);
       return this->emitGetPtrParam(It->second, E);
     }
   }


        


More information about the cfe-commits mailing list