Skip to content

Commit 71d54fa

Browse files
authored
[DirectX] Revert specialized createOp methods part of #101250
In 8cf8565 "[DirectX] Make DXILOpBuilder's API more useable" we introduced specialized createOp methods for each DirectX op for convenience, but the API is buggy and untested. It also isn't actually as useful as I imagined it would be since we don't have argument names or const-ness represented in DXIL.td currently. Remove these methods for now and we can reintroduce them if we actually need them later. Pull Request: #104245
1 parent 1aa8a6f commit 71d54fa

File tree

2 files changed

+2
-14
lines changed

2 files changed

+2
-14
lines changed

llvm/lib/Target/DirectX/DXILOpBuilder.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@ Expected<CallInst *> DXILOpBuilder::tryCreateOp(dxil::OpCode OpCode,
424424
return B.CreateCall(DXILFn, OpArgs);
425425
}
426426

427-
CallInst *DXILOpBuilder::createOp(dxil::OpCode OpCode, ArrayRef<Value *> &Args,
427+
CallInst *DXILOpBuilder::createOp(dxil::OpCode OpCode, ArrayRef<Value *> Args,
428428
Type *RetTy) {
429429
Expected<CallInst *> Result = tryCreateOp(OpCode, Args, RetTy);
430430
if (Error E = Result.takeError())

llvm/lib/Target/DirectX/DXILOpBuilder.h

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -33,25 +33,13 @@ class DXILOpBuilder {
3333

3434
/// Create a call instruction for the given DXIL op. The arguments
3535
/// must be valid for an overload of the operation.
36-
CallInst *createOp(dxil::OpCode Op, ArrayRef<Value *> &Args,
36+
CallInst *createOp(dxil::OpCode Op, ArrayRef<Value *> Args,
3737
Type *RetTy = nullptr);
3838

39-
#define DXIL_OPCODE(Op, Name) \
40-
CallInst *create##Name##Op(ArrayRef<Value *> &Args, Type *RetTy = nullptr) { \
41-
return createOp(dxil::OpCode(Op), Args, RetTy); \
42-
}
43-
#include "DXILOperation.inc"
44-
4539
/// Try to create a call instruction for the given DXIL op. Fails if the
4640
/// overload is invalid.
4741
Expected<CallInst *> tryCreateOp(dxil::OpCode Op, ArrayRef<Value *> Args,
4842
Type *RetTy = nullptr);
49-
#define DXIL_OPCODE(Op, Name) \
50-
Expected<CallInst *> tryCreate##Name##Op(ArrayRef<Value *> &Args, \
51-
Type *RetTy = nullptr) { \
52-
return tryCreateOp(dxil::OpCode(Op), Args, RetTy); \
53-
}
54-
#include "DXILOperation.inc"
5543

5644
/// Return the name of the given opcode.
5745
static const char *getOpCodeName(dxil::OpCode DXILOp);

0 commit comments

Comments
 (0)