CliftEmitC: mark segments as commentable

This commit is contained in:
Ivan Krysak
2026-05-04 10:08:40 +00:00
committed by Pietro Fezzardi
parent ff53337edb
commit c01a553d23
+18 -11
View File
@@ -146,19 +146,26 @@ public:
CommentEmitted = true;
}
emitGlobalDoxygenComment(Segment);
{
using RegionKind = ptml::CTokenEmitter::RegionKind;
auto Guard = Tokens.enterRegion(RegionKind::Commentable,
Segment.getHandle());
using EntityKind = ptml::CTokenEmitter::EntityKind;
emitDeclaration(Segment.getType(),
CEmitter::DeclaratorInfo{
.Identifier = Segment.getName(),
.Location = Segment.getHandle(),
.CAttributes = {},
.Kind = EntityKind::GlobalVariable,
.Parameters = {} });
emitGlobalDoxygenComment(Segment);
using EntityKind = ptml::CTokenEmitter::EntityKind;
emitDeclaration(Segment.getType(),
CEmitter::DeclaratorInfo{
.Identifier = Segment.getName(),
.Location = Segment.getHandle(),
.CAttributes = {},
.Kind = EntityKind::GlobalVariable,
.Parameters = {} });
Tokens.emitPunctuator(ptml::CTokenEmitter::Punctuator::Semicolon);
Tokens.emitNewline();
}
Tokens.emitPunctuator(ptml::CTokenEmitter::Punctuator::Semicolon);
Tokens.emitNewline();
Tokens.emitNewline();
});
}