[clang] e64e478 - [clang][Interp][NFC] Rename a parameter

Timm Bäder via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 27 01:43:46 PDT 2023


Author: Timm Bäder
Date: 2023-10-27T10:43:35+02:00
New Revision: e64e4784ee1c3ed9bb06458e9c427542927224ab

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

LOG: [clang][Interp][NFC] Rename a parameter

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/clang/lib/AST/Interp/Program.cpp b/clang/lib/AST/Interp/Program.cpp
index c6d19afd7d2219d..52e13398163ecf7 100644
--- a/clang/lib/AST/Interp/Program.cpp
+++ b/clang/lib/AST/Interp/Program.cpp
@@ -138,14 +138,13 @@ std::optional<unsigned> Program::getOrCreateGlobal(const ValueDecl *VD,
   return std::nullopt;
 }
 
-std::optional<unsigned> Program::getOrCreateDummy(const ValueDecl *PD) {
+std::optional<unsigned> Program::getOrCreateDummy(const ValueDecl *VD) {
   // Dedup blocks since they are immutable and pointers cannot be compared.
-  if (auto It = DummyParams.find(PD);
-      It != DummyParams.end())
+  if (auto It = DummyParams.find(VD); It != DummyParams.end())
     return It->second;
 
   // Create dummy descriptor.
-  Descriptor *Desc = allocateDescriptor(PD, std::nullopt);
+  Descriptor *Desc = allocateDescriptor(VD, std::nullopt);
   // Allocate a block for storage.
   unsigned I = Globals.size();
 
@@ -154,7 +153,7 @@ std::optional<unsigned> Program::getOrCreateDummy(const ValueDecl *PD) {
   G->block()->invokeCtor();
 
   Globals.push_back(G);
-  DummyParams[PD] = I;
+  DummyParams[VD] = I;
   return I;
 }
 

diff  --git a/clang/lib/AST/Interp/Program.h b/clang/lib/AST/Interp/Program.h
index d843fa06538f514..17342680102cffb 100644
--- a/clang/lib/AST/Interp/Program.h
+++ b/clang/lib/AST/Interp/Program.h
@@ -83,7 +83,7 @@ class Program final {
                                             const Expr *Init = nullptr);
 
   /// Returns or creates a dummy value for unknown declarations.
-  std::optional<unsigned> getOrCreateDummy(const ValueDecl *PD);
+  std::optional<unsigned> getOrCreateDummy(const ValueDecl *VD);
 
   /// Creates a global and returns its index.
   std::optional<unsigned> createGlobal(const ValueDecl *VD, const Expr *E);


        


More information about the cfe-commits mailing list