Skip to content

Commit a4b1dfb

Browse files
hokeinrlavaee
authored andcommitted
[clang] Don't use raw source location in DeclarationName, NFC (llvm#146412)
Converting back and forth for the source location raw encoding is unnecessary.
1 parent 57d84ea commit a4b1dfb

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

clang/include/clang/AST/DeclarationName.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -698,13 +698,13 @@ class DeclarationNameLoc {
698698

699699
// The location (if any) of the operator keyword is stored elsewhere.
700700
struct CXXOpName {
701-
SourceLocation::UIntTy BeginOpNameLoc;
702-
SourceLocation::UIntTy EndOpNameLoc;
701+
SourceLocation BeginOpNameLoc;
702+
SourceLocation EndOpNameLoc;
703703
};
704704

705705
// The location (if any) of the operator keyword is stored elsewhere.
706706
struct CXXLitOpName {
707-
SourceLocation::UIntTy OpNameLoc;
707+
SourceLocation OpNameLoc;
708708
};
709709

710710
// struct {} CXXUsingDirective;
@@ -720,12 +720,12 @@ class DeclarationNameLoc {
720720
void setNamedTypeLoc(TypeSourceInfo *TInfo) { NamedType.TInfo = TInfo; }
721721

722722
void setCXXOperatorNameRange(SourceRange Range) {
723-
CXXOperatorName.BeginOpNameLoc = Range.getBegin().getRawEncoding();
724-
CXXOperatorName.EndOpNameLoc = Range.getEnd().getRawEncoding();
723+
CXXOperatorName.BeginOpNameLoc = Range.getBegin();
724+
CXXOperatorName.EndOpNameLoc = Range.getEnd();
725725
}
726726

727727
void setCXXLiteralOperatorNameLoc(SourceLocation Loc) {
728-
CXXLiteralOperatorName.OpNameLoc = Loc.getRawEncoding();
728+
CXXLiteralOperatorName.OpNameLoc = Loc;
729729
}
730730

731731
public:
@@ -739,12 +739,12 @@ class DeclarationNameLoc {
739739

740740
/// Return the beginning location of the getCXXOperatorNameRange() range.
741741
SourceLocation getCXXOperatorNameBeginLoc() const {
742-
return SourceLocation::getFromRawEncoding(CXXOperatorName.BeginOpNameLoc);
742+
return CXXOperatorName.BeginOpNameLoc;
743743
}
744744

745745
/// Return the end location of the getCXXOperatorNameRange() range.
746746
SourceLocation getCXXOperatorNameEndLoc() const {
747-
return SourceLocation::getFromRawEncoding(CXXOperatorName.EndOpNameLoc);
747+
return CXXOperatorName.EndOpNameLoc;
748748
}
749749

750750
/// Return the range of the operator name (without the operator keyword).
@@ -759,7 +759,7 @@ class DeclarationNameLoc {
759759
/// keyword). Assumes that the object stores location information of a literal
760760
/// operator.
761761
SourceLocation getCXXLiteralOperatorNameLoc() const {
762-
return SourceLocation::getFromRawEncoding(CXXLiteralOperatorName.OpNameLoc);
762+
return CXXLiteralOperatorName.OpNameLoc;
763763
}
764764

765765
/// Construct location information for a constructor, destructor or conversion

0 commit comments

Comments
 (0)