@@ -375,15 +375,15 @@ class StringSectionReader {
375
375
376
376
// / Parse a shared string from the string section. The shared string is
377
377
// / encoded using an index to a corresponding string in the string section.
378
- LogicalResult parseString (EncodingReader &reader, StringRef &result) {
378
+ LogicalResult parseString (EncodingReader &reader, StringRef &result) const {
379
379
return parseEntry (reader, strings, result, " string" );
380
380
}
381
381
382
382
// / Parse a shared string from the string section. The shared string is
383
383
// / encoded using an index to a corresponding string in the string section.
384
384
// / This variant parses a flag compressed with the index.
385
385
LogicalResult parseStringWithFlag (EncodingReader &reader, StringRef &result,
386
- bool &flag) {
386
+ bool &flag) const {
387
387
uint64_t entryIdx;
388
388
if (failed (reader.parseVarIntWithFlag (entryIdx, flag)))
389
389
return failure ();
@@ -393,7 +393,7 @@ class StringSectionReader {
393
393
// / Parse a shared string from the string section. The shared string is
394
394
// / encoded using an index to a corresponding string in the string section.
395
395
LogicalResult parseStringAtIndex (EncodingReader &reader, uint64_t index,
396
- StringRef &result) {
396
+ StringRef &result) const {
397
397
return resolveEntry (reader, strings, index, result, " string" );
398
398
}
399
399
@@ -544,7 +544,7 @@ class ResourceSectionReader {
544
544
545
545
// / Parse a dialect resource handle from the resource section.
546
546
LogicalResult parseResourceHandle (EncodingReader &reader,
547
- AsmDialectResourceHandle &result) {
547
+ AsmDialectResourceHandle &result) const {
548
548
return parseEntry (reader, dialectResources, result, " resource handle" );
549
549
}
550
550
@@ -800,8 +800,8 @@ class AttrTypeReader {
800
800
using TypeEntry = Entry<Type>;
801
801
802
802
public:
803
- AttrTypeReader (StringSectionReader &stringReader,
804
- ResourceSectionReader &resourceReader,
803
+ AttrTypeReader (const StringSectionReader &stringReader,
804
+ const ResourceSectionReader &resourceReader,
805
805
const llvm::StringMap<BytecodeDialect *> &dialectsMap,
806
806
uint64_t &bytecodeVersion, Location fileLoc,
807
807
const ParserConfig &config)
@@ -881,11 +881,11 @@ class AttrTypeReader {
881
881
882
882
// / The string section reader used to resolve string references when parsing
883
883
// / custom encoded attribute/type entries.
884
- StringSectionReader &stringReader;
884
+ const StringSectionReader &stringReader;
885
885
886
886
// / The resource section reader used to resolve resource references when
887
887
// / parsing custom encoded attribute/type entries.
888
- ResourceSectionReader &resourceReader;
888
+ const ResourceSectionReader &resourceReader;
889
889
890
890
// / The map of the loaded dialects used to retrieve dialect information, such
891
891
// / as the dialect version.
@@ -908,8 +908,8 @@ class AttrTypeReader {
908
908
class DialectReader : public DialectBytecodeReader {
909
909
public:
910
910
DialectReader (AttrTypeReader &attrTypeReader,
911
- StringSectionReader &stringReader,
912
- ResourceSectionReader &resourceReader,
911
+ const StringSectionReader &stringReader,
912
+ const ResourceSectionReader &resourceReader,
913
913
const llvm::StringMap<BytecodeDialect *> &dialectsMap,
914
914
EncodingReader &reader, uint64_t &bytecodeVersion)
915
915
: attrTypeReader(attrTypeReader), stringReader(stringReader),
@@ -1042,8 +1042,8 @@ class DialectReader : public DialectBytecodeReader {
1042
1042
1043
1043
private:
1044
1044
AttrTypeReader &attrTypeReader;
1045
- StringSectionReader &stringReader;
1046
- ResourceSectionReader &resourceReader;
1045
+ const StringSectionReader &stringReader;
1046
+ const ResourceSectionReader &resourceReader;
1047
1047
const llvm::StringMap<BytecodeDialect *> &dialectsMap;
1048
1048
EncodingReader &reader;
1049
1049
uint64_t &bytecodeVersion;
@@ -1082,7 +1082,7 @@ class PropertiesSectionReader {
1082
1082
}
1083
1083
1084
1084
LogicalResult read (Location fileLoc, DialectReader &dialectReader,
1085
- OperationName *opName, OperationState &opState) {
1085
+ OperationName *opName, OperationState &opState) const {
1086
1086
uint64_t propertiesIdx;
1087
1087
if (failed (dialectReader.readVarInt (propertiesIdx)))
1088
1088
return failure ();
0 commit comments