Skip to content

Commit fa22b40

Browse files
committed
fixup! doxygen comment; make structure more compact
1 parent c20fdc3 commit fa22b40

File tree

1 file changed

+17
-12
lines changed

1 file changed

+17
-12
lines changed

llvm/include/llvm/IR/DebugInfoMetadata.h

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -73,35 +73,40 @@ enum Tag : uint16_t;
7373
/// DISourceLanguageName may hold either of these.
7474
///
7575
class DISourceLanguageName {
76+
/// Language version. The version scheme is language
77+
/// dependent.
78+
uint32_t Version = 0;
79+
7680
/// Language name.
77-
/// If \ref Version is not std::nullopt, then this name
81+
/// If \ref HasVersion is \c true, then this name
7882
/// is version independent (i.e., doesn't include the language
7983
/// version in its name).
8084
uint16_t Name;
8185

82-
/// Language version. The version scheme is language
83-
/// dependent.
84-
std::optional<uint32_t> Version;
86+
/// If \c true, then \ref Version is interpretable and \ref Name
87+
/// is a version independent name.
88+
bool HasVersion;
8589

8690
public:
87-
bool hasVersionedName() const { return Version.has_value(); }
91+
bool hasVersionedName() const { return HasVersion; }
8892

8993
/// Returns a versioned or unversioned language name.
9094
uint16_t getName() const { return Name; }
9195

92-
// Transitional API for cases where we do not yet support
93-
// versioned source language names. Use \ref getName instead.
94-
//
95-
// FIXME: remove once all callers of this API account for versioned
96-
// names.
96+
/// Transitional API for cases where we do not yet support
97+
/// versioned source language names. Use \ref getName instead.
98+
///
99+
/// FIXME: remove once all callers of this API account for versioned
100+
/// names.
97101
uint16_t getUnversionedName() const {
98102
assert(!hasVersionedName());
99103
return Name;
100104
}
101105

102106
DISourceLanguageName(uint16_t Lang, uint32_t Version)
103-
: Name(Lang), Version(Version) {};
104-
DISourceLanguageName(uint16_t Lang) : Name(Lang), Version(std::nullopt) {};
107+
: Version(Version), Name(Lang), HasVersion(true) {};
108+
DISourceLanguageName(uint16_t Lang)
109+
: Version(0), Name(Lang), HasVersion(false) {};
105110
};
106111

107112
class DbgVariableRecord;

0 commit comments

Comments
 (0)