|
27 | 27 | #include "clang/AST/Type.h" |
28 | 28 | #include "clang/Basic/TargetOptions.h" |
29 | 29 | #include "clang/Frontend/FrontendDiagnostic.h" |
| 30 | +#include "llvm/ADT/DenseMap.h" |
30 | 31 | #include "llvm/ADT/ScopeExit.h" |
31 | 32 | #include "llvm/ADT/SmallString.h" |
32 | 33 | #include "llvm/ADT/SmallVector.h" |
@@ -905,15 +906,15 @@ void CGHLSLRuntime::emitEntryFunction(const FunctionDecl *FD, |
905 | 906 | OB.emplace_back("convergencectrl", bundleArgs); |
906 | 907 | } |
907 | 908 |
|
908 | | - std::unordered_map<const DeclaratorDecl *, llvm::Value *> OutputSemantic; |
| 909 | + llvm::DenseMap<const DeclaratorDecl *, llvm::Value *> OutputSemantic; |
909 | 910 |
|
910 | 911 | unsigned SRetOffset = 0; |
911 | 912 | for (const auto &Param : Fn->args()) { |
912 | 913 | if (Param.hasStructRetAttr()) { |
913 | 914 | SRetOffset = 1; |
914 | 915 | llvm::Type *VarType = Param.getParamStructRetType(); |
915 | 916 | llvm::Value *Var = B.CreateAlloca(VarType); |
916 | | - OutputSemantic.emplace(FD, Var); |
| 917 | + OutputSemantic.try_emplace(FD, Var); |
917 | 918 | Args.push_back(Var); |
918 | 919 | continue; |
919 | 920 | } |
@@ -949,7 +950,7 @@ void CGHLSLRuntime::emitEntryFunction(const FunctionDecl *FD, |
949 | 950 | CI->setCallingConv(Fn->getCallingConv()); |
950 | 951 |
|
951 | 952 | if (Fn->getReturnType() != CGM.VoidTy) |
952 | | - OutputSemantic.emplace(FD, CI); |
| 953 | + OutputSemantic.try_emplace(FD, CI); |
953 | 954 |
|
954 | 955 | for (auto &[Decl, Source] : OutputSemantic) { |
955 | 956 | AllocaInst *AI = dyn_cast<AllocaInst>(Source); |
|
0 commit comments