Skip to content

Commit 14d3dbd

Browse files
committed
[SYCL-PTX] Review comment: moving code around
1 parent 720e62d commit 14d3dbd

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

clang/utils/TableGen/ClangProgModelBuiltinEmitter.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1043,6 +1043,12 @@ void JSONBuiltinInterfaceEmitter::ExpandTypes() {
10431043

10441044
void JSONBuiltinInterfaceEmitter::EmitBuiltins() {
10451045
struct FnDesc {
1046+
FnDesc(const Record *Rec)
1047+
: IsPure(Rec->getValueAsBit("IsPure")),
1048+
IsConst(Rec->getValueAsBit("IsConst")),
1049+
IsConv(Rec->getValueAsBit("IsConv")),
1050+
IsVariadic(Rec->getValueAsBit("IsVariadic")) {}
1051+
10461052
bool IsPure;
10471053
bool IsConst;
10481054
bool IsConv;
@@ -1077,11 +1083,7 @@ void JSONBuiltinInterfaceEmitter::EmitBuiltins() {
10771083
return NbTypes == NbOverload || NbTypes == 1;
10781084
}));
10791085
for (size_t idx = 0; idx < NbOverload; idx++) {
1080-
FnDesc Proto;
1081-
Proto.IsPure = Overload.first->getValueAsBit("IsPure");
1082-
Proto.IsConst = Overload.first->getValueAsBit("IsConst");
1083-
Proto.IsConv = Overload.first->getValueAsBit("IsConv");
1084-
Proto.IsVariadic = Overload.first->getValueAsBit("IsVariadic");
1086+
FnDesc Proto(Overload.first);
10851087
for (llvm::ArrayRef<std::string> Types : SignatureTypesIt) {
10861088
Proto.Args.emplace_back(Types[idx >= Types.size() ? 0 : idx]);
10871089
}

0 commit comments

Comments
 (0)