Author: Nathan Gauër Date: 2025-11-19T17:19:29Z New Revision: e6fc654bfd632a23574e18b43631470285a2cdf8
URL: https://github.com/llvm/llvm-project/commit/e6fc654bfd632a23574e18b43631470285a2cdf8 DIFF: https://github.com/llvm/llvm-project/commit/e6fc654bfd632a23574e18b43631470285a2cdf8.diff LOG: [HLSL] replace std::unordered_map with DenseMap (#168739) Broke some builds because of a missing include. Changing to a DenseMap and adding the missing include. Added: Modified: clang/lib/CodeGen/CGHLSLRuntime.cpp Removed: ################################################################################ diff --git a/clang/lib/CodeGen/CGHLSLRuntime.cpp b/clang/lib/CodeGen/CGHLSLRuntime.cpp index 0371af417bdab..9403d26576eb0 100644 --- a/clang/lib/CodeGen/CGHLSLRuntime.cpp +++ b/clang/lib/CodeGen/CGHLSLRuntime.cpp @@ -27,6 +27,7 @@ #include "clang/AST/Type.h" #include "clang/Basic/TargetOptions.h" #include "clang/Frontend/FrontendDiagnostic.h" +#include "llvm/ADT/DenseMap.h" #include "llvm/ADT/ScopeExit.h" #include "llvm/ADT/SmallString.h" #include "llvm/ADT/SmallVector.h" @@ -905,7 +906,7 @@ void CGHLSLRuntime::emitEntryFunction(const FunctionDecl *FD, OB.emplace_back("convergencectrl", bundleArgs); } - std::unordered_map<const DeclaratorDecl *, llvm::Value *> OutputSemantic; + llvm::DenseMap<const DeclaratorDecl *, llvm::Value *> OutputSemantic; unsigned SRetOffset = 0; for (const auto &Param : Fn->args()) { @@ -913,7 +914,7 @@ void CGHLSLRuntime::emitEntryFunction(const FunctionDecl *FD, SRetOffset = 1; llvm::Type *VarType = Param.getParamStructRetType(); llvm::Value *Var = B.CreateAlloca(VarType); - OutputSemantic.emplace(FD, Var); + OutputSemantic.try_emplace(FD, Var); Args.push_back(Var); continue; } @@ -949,7 +950,7 @@ void CGHLSLRuntime::emitEntryFunction(const FunctionDecl *FD, CI->setCallingConv(Fn->getCallingConv()); if (Fn->getReturnType() != CGM.VoidTy) - OutputSemantic.emplace(FD, CI); + OutputSemantic.try_emplace(FD, CI); for (auto &[Decl, Source] : OutputSemantic) { AllocaInst *AI = dyn_cast<AllocaInst>(Source); _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
