Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions clang/include/clang/AST/Type.h
Original file line number Diff line number Diff line change
Expand Up @@ -6404,7 +6404,7 @@ class SpirvOperand {
SpirvOperand() : Kind(Invalid), ResultType(), Value() {}

SpirvOperand(SpirvOperandKind Kind, QualType ResultType, llvm::APInt Value)
: Kind(Kind), ResultType(ResultType), Value(Value) {}
: Kind(Kind), ResultType(ResultType), Value(std::move(Value)) {}

SpirvOperand(const SpirvOperand &Other) { *this = Other; }
~SpirvOperand() {}
Expand Down Expand Up @@ -6438,11 +6438,11 @@ class SpirvOperand {
}

static SpirvOperand createConstant(QualType ResultType, llvm::APInt Val) {
return SpirvOperand(ConstantId, ResultType, Val);
return SpirvOperand(ConstantId, ResultType, std::move(Val));
}

static SpirvOperand createLiteral(llvm::APInt Val) {
return SpirvOperand(Literal, QualType(), Val);
return SpirvOperand(Literal, QualType(), std::move(Val));
}

static SpirvOperand createType(QualType T) {
Expand Down
6 changes: 2 additions & 4 deletions clang/lib/CodeGen/Targets/SPIR.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -421,14 +421,12 @@ static llvm::Type *getInlineSpirvType(CodeGenModule &CGM,
case SpirvOperandKind::ConstantId: {
llvm::Type *IntegralType =
CGM.getTypes().ConvertType(Operand.getResultType());
llvm::APInt Value = Operand.getValue();

Result = getInlineSpirvConstant(CGM, IntegralType, Value);
Result = getInlineSpirvConstant(CGM, IntegralType, Operand.getValue());
break;
}
case SpirvOperandKind::Literal: {
llvm::APInt Value = Operand.getValue();
Result = getInlineSpirvConstant(CGM, nullptr, Value);
Result = getInlineSpirvConstant(CGM, nullptr, Operand.getValue());
break;
}
case SpirvOperandKind::TypeId: {
Expand Down
Loading