Skip to content

Commit a64632f

Browse files
committed
[NFC][Clang] Address comments
Change-Id: I99a618d8127680cb91146e1a82e0e0b6c0717888
1 parent ce67d44 commit a64632f

File tree

2 files changed

+10
-16
lines changed

2 files changed

+10
-16
lines changed

clang/include/clang/Basic/AttributeCommonInfo.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ class AttributeCommonInfo {
6767
IgnoredAttribute,
6868
UnknownAttribute,
6969
};
70-
enum class Scope { NONE, CLANG, GNU, MSVC, OMP, HLSL, GSL, RISCV, INVALID };
70+
enum class Scope { NONE, CLANG, GNU, MSVC, OMP, HLSL, GSL, RISCV };
7171

7272
private:
7373
const IdentifierInfo *AttrName = nullptr;

clang/lib/Basic/Attributes.cpp

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -158,21 +158,15 @@ std::string AttributeCommonInfo::getNormalizedFullName() const {
158158

159159
AttributeCommonInfo::Scope
160160
getScopeFromNormalizedScopeName(StringRef ScopeName) {
161-
AttributeCommonInfo::Scope ParsedScope =
162-
llvm::StringSwitch<AttributeCommonInfo::Scope>(ScopeName)
163-
.Case("", AttributeCommonInfo::Scope::NONE)
164-
.Case("clang", AttributeCommonInfo::Scope::CLANG)
165-
.Case("gnu", AttributeCommonInfo::Scope::GNU)
166-
.Case("gsl", AttributeCommonInfo::Scope::GSL)
167-
.Case("hlsl", AttributeCommonInfo::Scope::HLSL)
168-
.Case("msvc", AttributeCommonInfo::Scope::MSVC)
169-
.Case("omp", AttributeCommonInfo::Scope::OMP)
170-
.Case("riscv", AttributeCommonInfo::Scope::RISCV)
171-
.Default(AttributeCommonInfo::Scope::INVALID);
172-
173-
assert(ParsedScope != AttributeCommonInfo::Scope::INVALID);
174-
175-
return ParsedScope;
161+
return llvm::StringSwitch<AttributeCommonInfo::Scope>(ScopeName)
162+
.Case("", AttributeCommonInfo::Scope::NONE)
163+
.Case("clang", AttributeCommonInfo::Scope::CLANG)
164+
.Case("gnu", AttributeCommonInfo::Scope::GNU)
165+
.Case("gsl", AttributeCommonInfo::Scope::GSL)
166+
.Case("hlsl", AttributeCommonInfo::Scope::HLSL)
167+
.Case("msvc", AttributeCommonInfo::Scope::MSVC)
168+
.Case("omp", AttributeCommonInfo::Scope::OMP)
169+
.Case("riscv", AttributeCommonInfo::Scope::RISCV);
176170
}
177171

178172
unsigned AttributeCommonInfo::calculateAttributeSpellingListIndex() const {

0 commit comments

Comments
 (0)