Skip to content

Commit

Permalink
[clang][Interp][NFC] Rename a parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
tbaederr committed Oct 27, 2023
1 parent 051fade commit e64e478
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
9 changes: 4 additions & 5 deletions clang/lib/AST/Interp/Program.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand All @@ -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;
}

Expand Down
2 changes: 1 addition & 1 deletion clang/lib/AST/Interp/Program.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit e64e478

Please sign in to comment.