Skip to content

Commit

Permalink
[clang][Interp][NFC] Fix allocateLocalPrimitive parameter name
Browse files Browse the repository at this point in the history
This is passed on to Program::createDescriptor, where it is used as a
value for IsConst.
  • Loading branch information
tbaederr committed May 4, 2023
1 parent 632fa37 commit c3f1faf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion clang/lib/AST/Interp/ByteCodeExprGen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -831,7 +831,7 @@ bool ByteCodeExprGen<Emitter>::VisitMaterializeTemporaryExpr(
// For everyhing else, use local variables.
if (SubExprT) {
if (std::optional<unsigned> LocalIndex = allocateLocalPrimitive(
SubExpr, *SubExprT, /*IsMutable=*/true, /*IsExtended=*/true)) {
SubExpr, *SubExprT, /*IsConst=*/true, /*IsExtended=*/true)) {
if (!this->visitInitializer(SubExpr))
return false;
this->emitSetLocal(*SubExprT, *LocalIndex, E);
Expand Down
2 changes: 1 addition & 1 deletion clang/lib/AST/Interp/ByteCodeExprGen.h
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ class ByteCodeExprGen : public ConstStmtVisitor<ByteCodeExprGen<Emitter>, bool>,
llvm::function_ref<bool(const Expr *)> V);

/// Creates a local primitive value.
unsigned allocateLocalPrimitive(DeclTy &&Decl, PrimType Ty, bool IsMutable,
unsigned allocateLocalPrimitive(DeclTy &&Decl, PrimType Ty, bool IsConst,
bool IsExtended = false);

/// Allocates a space storing a local given its type.
Expand Down

0 comments on commit c3f1faf

Please sign in to comment.