Skip to content

Commit c7ead3e

Browse files
committed
Formatting, and missing comment
1 parent f264179 commit c7ead3e

File tree

2 files changed

+16
-10
lines changed

2 files changed

+16
-10
lines changed

llvm/lib/Target/DirectX/DXILOpLowering.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,9 @@ class OpLowerer {
109109
#define DXIL_OP_INTRINSIC_ARG_SELECT_TYPES
110110
#include "DXILOperation.inc"
111111

112-
[[nodiscard]] bool replaceFunctionWithOp(Function &F, dxil::OpCode DXILOp,
113-
ArrayRef<IntrinArgSelect> ArgSelects) {
112+
[[nodiscard]] bool
113+
replaceFunctionWithOp(Function &F, dxil::OpCode DXILOp,
114+
ArrayRef<IntrinArgSelect> ArgSelects) {
114115
bool IsVectorArgExpansion = isVectorArgExpansion(F);
115116
return replaceFunction(F, [&](CallInst *CI) -> Error {
116117
OpBuilder.getIRB().SetInsertPoint(CI);
@@ -660,8 +661,8 @@ class OpLowerer {
660661
continue;
661662
#define DXIL_OP_INTRINSIC(OpCode, Intrin, ...) \
662663
case Intrin: \
663-
HasErrors |= \
664-
replaceFunctionWithOp(F, OpCode, ArrayRef<IntrinArgSelect>{__VA_ARGS__}); \
664+
HasErrors |= replaceFunctionWithOp( \
665+
F, OpCode, ArrayRef<IntrinArgSelect>{__VA_ARGS__}); \
665666
break;
666667
#include "DXILOperation.inc"
667668
case Intrinsic::dx_handle_fromBinding:

llvm/utils/TableGen/DXILEmitter.cpp

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ struct DXILIntrinsicSelect {
4040
static StringRef StripIntrinArgSelectTypePrefix(StringRef Type) {
4141
StringRef Prefix = "IntrinArgSelect_";
4242
if (!Type.starts_with(Prefix)) {
43-
PrintFatalError("IntrinArgSelectType definintion must be prefixed with 'IntrinArgSelect_'");
43+
PrintFatalError("IntrinArgSelectType definintion must be prefixed with "
44+
"'IntrinArgSelect_'");
4445
}
4546
return Type.substr(Prefix.size());
4647
}
@@ -421,11 +422,12 @@ static void emitDXILIntrinsicMap(ArrayRef<DXILOperationDesc> Ops,
421422
OS << "DXIL_OP_INTRINSIC(dxil::OpCode::" << Op.OpName
422423
<< ", Intrinsic::" << MappedIntr.Intrinsic << ", ";
423424
for (const Record *ArgSelect : MappedIntr.ArgSelectRecords) {
424-
std::string Type = ArgSelect->getValueAsDef("type")->getNameInitAsString();
425+
std::string Type =
426+
ArgSelect->getValueAsDef("type")->getNameInitAsString();
425427
int Value = ArgSelect->getValueAsInt("value");
426428
OS << "(IntrinArgSelect{"
427-
<< "IntrinArgSelect::Type::" << StripIntrinArgSelectTypePrefix(Type) << ","
428-
<< Value << "}), ";
429+
<< "IntrinArgSelect::Type::" << StripIntrinArgSelectTypePrefix(Type)
430+
<< "," << Value << "}), ";
429431
}
430432
OS << ")\n";
431433
}
@@ -435,11 +437,14 @@ static void emitDXILIntrinsicMap(ArrayRef<DXILOperationDesc> Ops,
435437
OS << "#endif\n\n";
436438
}
437439

438-
static void emitDXILIntrinsicArgSelectTypes(const RecordKeeper &Records, raw_ostream &OS) {
440+
/// Emit the IntrinArgSelect type for DirectX intrinsic to DXIL Op lowering
441+
static void emitDXILIntrinsicArgSelectTypes(const RecordKeeper &Records,
442+
raw_ostream &OS) {
439443
OS << "#ifdef DXIL_OP_INTRINSIC_ARG_SELECT_TYPES\n";
440444
OS << "struct IntrinArgSelect {\n";
441445
OS << " enum class Type {\n";
442-
for (const Record *Records : Records.getAllDerivedDefinitions("IntrinArgSelectType")) {
446+
for (const Record *Records :
447+
Records.getAllDerivedDefinitions("IntrinArgSelectType")) {
443448
StringRef StrippedName = StripIntrinArgSelectTypePrefix(Records->getName());
444449
OS << " " << StrippedName << ",\n";
445450
}

0 commit comments

Comments
 (0)