Skip to content

[clang] Don't use raw source location in DeclarationName, NFC #146412

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions clang/include/clang/AST/DeclarationName.h
Original file line number Diff line number Diff line change
Expand Up @@ -698,13 +698,13 @@ class DeclarationNameLoc {

// The location (if any) of the operator keyword is stored elsewhere.
struct CXXOpName {
SourceLocation::UIntTy BeginOpNameLoc;
SourceLocation::UIntTy EndOpNameLoc;
SourceLocation BeginOpNameLoc;
SourceLocation EndOpNameLoc;
};

// The location (if any) of the operator keyword is stored elsewhere.
struct CXXLitOpName {
SourceLocation::UIntTy OpNameLoc;
SourceLocation OpNameLoc;
};

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

void setCXXOperatorNameRange(SourceRange Range) {
CXXOperatorName.BeginOpNameLoc = Range.getBegin().getRawEncoding();
CXXOperatorName.EndOpNameLoc = Range.getEnd().getRawEncoding();
CXXOperatorName.BeginOpNameLoc = Range.getBegin();
CXXOperatorName.EndOpNameLoc = Range.getEnd();
}

void setCXXLiteralOperatorNameLoc(SourceLocation Loc) {
CXXLiteralOperatorName.OpNameLoc = Loc.getRawEncoding();
CXXLiteralOperatorName.OpNameLoc = Loc;
}

public:
Expand All @@ -739,12 +739,12 @@ class DeclarationNameLoc {

/// Return the beginning location of the getCXXOperatorNameRange() range.
SourceLocation getCXXOperatorNameBeginLoc() const {
return SourceLocation::getFromRawEncoding(CXXOperatorName.BeginOpNameLoc);
return CXXOperatorName.BeginOpNameLoc;
}

/// Return the end location of the getCXXOperatorNameRange() range.
SourceLocation getCXXOperatorNameEndLoc() const {
return SourceLocation::getFromRawEncoding(CXXOperatorName.EndOpNameLoc);
return CXXOperatorName.EndOpNameLoc;
}

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

/// Construct location information for a constructor, destructor or conversion
Expand Down
Loading