Skip to content

Commit 720e62d

Browse files
committed
[SYCL-PTX] Coding style fixes
Signed-off-by: Victor Lomuller <[email protected]>
1 parent 8a9f2de commit 720e62d

File tree

1 file changed

+14
-11
lines changed

1 file changed

+14
-11
lines changed

clang/utils/TableGen/ClangProgModelBuiltinEmitter.cpp

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -997,10 +997,10 @@ void JSONBuiltinInterfaceEmitter::ExpandType(const Record *Ty) {
997997

998998
bool IsCompound = Ty->isSubClassOf("CompoundType");
999999
if (IsCompound) {
1000-
auto *EltRecord = Ty->getValueAsDef("ElementType");
1000+
const Record *EltRecord = Ty->getValueAsDef("ElementType");
10011001
ExpandType(EltRecord);
10021002
Expansion = ExpandedTypes[EltRecord];
1003-
for (auto &TypeStr : Expansion) {
1003+
for (std::string &TypeStr : Expansion) {
10041004
if (TypeDesc.IsPointer) {
10051005
if (TypeDesc.IsConst)
10061006
TypeStr += " const";
@@ -1017,10 +1017,12 @@ void JSONBuiltinInterfaceEmitter::ExpandType(const Record *Ty) {
10171017

10181018
if (Ty->isSubClassOf("GenericType")) {
10191019
assert(!Expansion.size() && "Types already expanded");
1020-
auto NVec = Ty->getValueAsDef("VectorList")->getValueAsListOfInts("List");
1021-
auto NTypes = Ty->getValueAsDef("TypeList")->getValueAsListOfDefs("List");
1022-
for (auto SubT : NTypes) {
1023-
for (auto VecWidth : NVec) {
1020+
std::vector<long int> NVec =
1021+
Ty->getValueAsDef("VectorList")->getValueAsListOfInts("List");
1022+
std::vector<Record *> NTypes =
1023+
Ty->getValueAsDef("TypeList")->getValueAsListOfDefs("List");
1024+
for (const Record *SubT : NTypes) {
1025+
for (long int VecWidth : NVec) {
10241026
JSONBuiltinInterfaceEmitter::TypeDesc TypeDesc(SubT);
10251027
TypeDesc.VecWidth = VecWidth;
10261028
Expansion.emplace_back(TypeDesc.GetBaseTypeAsStr());
@@ -1034,7 +1036,7 @@ void JSONBuiltinInterfaceEmitter::ExpandType(const Record *Ty) {
10341036
}
10351037

10361038
void JSONBuiltinInterfaceEmitter::ExpandTypes() {
1037-
for (const auto *T : Records.getAllDerivedDefinitions("Type")) {
1039+
for (const Record *T : Records.getAllDerivedDefinitions("Type")) {
10381040
ExpandType(T);
10391041
}
10401042
}
@@ -1052,10 +1054,11 @@ void JSONBuiltinInterfaceEmitter::EmitBuiltins() {
10521054
// For each function names, gather the list of overloads
10531055
for (const auto &SLM : SignatureListMap) {
10541056
for (const auto &Name : SLM.second.Names) {
1055-
auto &PrototypeList = NameToProtoList[Name];
1057+
SmallVectorImpl<FnDesc> &PrototypeList = NameToProtoList[Name];
10561058

10571059
for (const auto &Overload : SLM.second.Signatures) {
1058-
auto Signature = Overload.first->getValueAsListOfDefs("Signature");
1060+
std::vector<Record *> Signature =
1061+
Overload.first->getValueAsListOfDefs("Signature");
10591062
auto SignatureTypesIt = llvm::map_range(
10601063
Signature, [this](const Record *Ty) -> llvm::ArrayRef<std::string> {
10611064
return ExpandedTypes[Ty];
@@ -1079,7 +1082,7 @@ void JSONBuiltinInterfaceEmitter::EmitBuiltins() {
10791082
Proto.IsConst = Overload.first->getValueAsBit("IsConst");
10801083
Proto.IsConv = Overload.first->getValueAsBit("IsConv");
10811084
Proto.IsVariadic = Overload.first->getValueAsBit("IsVariadic");
1082-
for (const auto &Types : SignatureTypesIt) {
1085+
for (llvm::ArrayRef<std::string> Types : SignatureTypesIt) {
10831086
Proto.Args.emplace_back(Types[idx >= Types.size() ? 0 : idx]);
10841087
}
10851088
PrototypeList.emplace_back(std::move(Proto));
@@ -1093,7 +1096,7 @@ void JSONBuiltinInterfaceEmitter::EmitBuiltins() {
10931096
NameToProtoList.keys(), OS,
10941097
[&](llvm::StringRef FnName) {
10951098
OS << " \"" << FnName << "\" : [\n";
1096-
auto &PrototypeList = NameToProtoList[FnName];
1099+
SmallVectorImpl<FnDesc> &PrototypeList = NameToProtoList[FnName];
10971100
// emit ["ty1", "ty2", "ty3"], ["pure"]
10981101
llvm::interleave(
10991102
PrototypeList, OS,

0 commit comments

Comments
 (0)