Skip to content

Commit

Permalink
[clang][Interp][NFC] Return a const Descriptor from a getter
Browse files Browse the repository at this point in the history
They are generally immutable anyway. Also fix some doc comments.
  • Loading branch information
tbaederr committed Jul 6, 2023
1 parent 2de812f commit f223c96
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions clang/lib/AST/Interp/InterpBlock.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ enum PrimType : unsigned;
///
class Block final {
public:
// Creates a new block.
/// Creates a new block.
Block(const std::optional<unsigned> &DeclID, Descriptor *Desc,
bool IsStatic = false, bool IsExtern = false)
: DeclID(DeclID), IsStatic(IsStatic), IsExtern(IsExtern), Desc(Desc) {}
Expand All @@ -58,7 +58,7 @@ class Block final {
Desc(Desc) {}

/// Returns the block's descriptor.
Descriptor *getDescriptor() const { return Desc; }
const Descriptor *getDescriptor() const { return Desc; }
/// Checks if the block has any live pointers.
bool hasPointers() const { return Pointers; }
/// Checks if the block is extern.
Expand Down Expand Up @@ -104,7 +104,7 @@ class Block final {
/*isActive=*/true, Desc);
}

// Invokes the Destructor.
/// Invokes the Destructor.
void invokeDtor() {
if (Desc->DtorFn)
Desc->DtorFn(this, data(), Desc);
Expand Down

0 comments on commit f223c96

Please sign in to comment.