Skip to content

Commit 8aa6b3f

Browse files
committed
address comments
1 parent 7c40169 commit 8aa6b3f

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

clang/lib/Sema/SemaDeclAttr.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2951,10 +2951,14 @@ static void handleSectionAttr(Sema &S, Decl *D, const ParsedAttr &AL) {
29512951
}
29522952

29532953
static bool isValidCodeModelAttr(Sema &S, StringRef Str) {
2954-
bool IsX8664Target =
2955-
S.Context.getTargetInfo().getTriple().getArch() == llvm::Triple::x86_64;
2956-
bool IsX8664Spelling = Str == "small" || Str == "large";
2957-
return IsX8664Target == IsX8664Spelling;
2954+
if (S.Context.getTargetInfo().getTriple().isLoongArch()) {
2955+
return Str == "normal" || Str == "medium" || Str == "extreme";
2956+
} else {
2957+
assert(S.Context.getTargetInfo().getTriple().getArch() ==
2958+
llvm::Triple::x86_64 &&
2959+
"only loongarch/x86-64 supported");
2960+
return Str == "small" || Str == "large";
2961+
}
29582962
}
29592963

29602964
static void handleCodeModelAttr(Sema &S, Decl *D, const ParsedAttr &AL) {

0 commit comments

Comments
 (0)