Skip to content

Commit 3598e67

Browse files
committed
add SPIRV prefix to function name
1 parent ca842d2 commit 3598e67

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

clang/lib/CodeGen/CGHLSLRuntime.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,8 @@ static Value *buildVectorInput(IRBuilder<> &B, Function *F, llvm::Type *Ty) {
384384
return B.CreateCall(F, {B.getInt32(0)});
385385
}
386386

387-
static void addBuiltinDecoration(llvm::GlobalVariable *GV, unsigned BuiltIn) {
387+
static void addSPIRVBuiltinDecoration(llvm::GlobalVariable *GV,
388+
unsigned BuiltIn) {
388389
LLVMContext &Ctx = GV->getContext();
389390
IRBuilder<> B(GV->getContext());
390391
MDNode *Operands = MDNode::get(
@@ -403,7 +404,7 @@ static llvm::Value *createSPIRVBuiltinLoad(IRBuilder<> &B, llvm::Module &M,
403404
/* Initializer= */ nullptr, Name, /* insertBefore= */ nullptr,
404405
llvm::GlobalVariable::GeneralDynamicTLSModel,
405406
/* AddressSpace */ 7, /* isExternallyInitialized= */ true);
406-
addBuiltinDecoration(GV, BuiltInID);
407+
addSPIRVBuiltinDecoration(GV, BuiltInID);
407408
return B.CreateLoad(Ty, GV);
408409
}
409410

@@ -657,7 +658,7 @@ void CGHLSLRuntime::initializeBufferFromBinding(const HLSLBufferDecl *BufDecl,
657658
void CGHLSLRuntime::handleGlobalVarDefinition(const VarDecl *VD,
658659
llvm::GlobalVariable *GV) {
659660
if (auto Attr = VD->getAttr<HLSLVkExtBuiltinInputAttr>())
660-
addBuiltinDecoration(GV, Attr->getBuiltIn());
661+
addSPIRVBuiltinDecoration(GV, Attr->getBuiltIn());
661662
}
662663

663664
llvm::Instruction *CGHLSLRuntime::getConvergenceToken(BasicBlock &BB) {

0 commit comments

Comments
 (0)