diff options
author | Eli Friedman <efriedma@quicinc.com> | 2024-11-14 14:35:40 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-14 14:35:40 -0800 |
commit | 6bd3f2e8986f4eb7972bc0102ff4a706dacc0d48 (patch) | |
tree | fb49674c356ece81f111711f62f851b049a09dc5 /clang/lib/CodeGen/CodeGenModule.h | |
parent | 691bd184e628bac8a2d7385dba1057cfcd844689 (diff) | |
download | llvm-6bd3f2e8986f4eb7972bc0102ff4a706dacc0d48.zip llvm-6bd3f2e8986f4eb7972bc0102ff4a706dacc0d48.tar.gz llvm-6bd3f2e8986f4eb7972bc0102ff4a706dacc0d48.tar.bz2 |
[clang codegen] Add CreateRuntimeFunction overload that takes a clang type. (#113506)
Correctly computing the LLVM types/attributes is complicated in general,
so add a variant which does that for you.
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.h')
-rw-r--r-- | clang/lib/CodeGen/CodeGenModule.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.h b/clang/lib/CodeGen/CodeGenModule.h index 8d57877..741b0f1 100644 --- a/clang/lib/CodeGen/CodeGenModule.h +++ b/clang/lib/CodeGen/CodeGenModule.h @@ -1247,11 +1247,23 @@ public: /// Create or return a runtime function declaration with the specified type /// and name. If \p AssumeConvergent is true, the call will have the /// convergent attribute added. + /// + /// For new code, please use the overload that takes a QualType; it sets + /// function attributes more accurately. llvm::FunctionCallee CreateRuntimeFunction(llvm::FunctionType *Ty, StringRef Name, llvm::AttributeList ExtraAttrs = llvm::AttributeList(), bool Local = false, bool AssumeConvergent = false); + /// Create or return a runtime function declaration with the specified type + /// and name. If \p AssumeConvergent is true, the call will have the + /// convergent attribute added. + llvm::FunctionCallee + CreateRuntimeFunction(QualType ReturnTy, ArrayRef<QualType> ArgTys, + StringRef Name, + llvm::AttributeList ExtraAttrs = llvm::AttributeList(), + bool Local = false, bool AssumeConvergent = false); + /// Create a new runtime global variable with the specified type and name. llvm::Constant *CreateRuntimeVariable(llvm::Type *Ty, StringRef Name); |