aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CGHLSLRuntime.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/CodeGen/CGHLSLRuntime.cpp')
-rw-r--r--clang/lib/CodeGen/CGHLSLRuntime.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/clang/lib/CodeGen/CGHLSLRuntime.cpp b/clang/lib/CodeGen/CGHLSLRuntime.cpp
index fb15b19..c354e58 100644
--- a/clang/lib/CodeGen/CGHLSLRuntime.cpp
+++ b/clang/lib/CodeGen/CGHLSLRuntime.cpp
@@ -512,13 +512,17 @@ void CGHLSLRuntime::generateGlobalCtorDtorCalls() {
IP = Token->getNextNode();
}
IRBuilder<> B(IP);
- for (auto *Fn : CtorFns)
- B.CreateCall(FunctionCallee(Fn), {}, OB);
+ for (auto *Fn : CtorFns) {
+ auto CI = B.CreateCall(FunctionCallee(Fn), {}, OB);
+ CI->setCallingConv(Fn->getCallingConv());
+ }
// Insert global dtors before the terminator of the last instruction
B.SetInsertPoint(F.back().getTerminator());
- for (auto *Fn : DtorFns)
- B.CreateCall(FunctionCallee(Fn), {}, OB);
+ for (auto *Fn : DtorFns) {
+ auto CI = B.CreateCall(FunctionCallee(Fn), {}, OB);
+ CI->setCallingConv(Fn->getCallingConv());
+ }
}
// No need to keep global ctors/dtors for non-lib profile after call to