[clang] [Clang] Track alloca element types to avoid getAllocatedType() calls (PR #181740)
Oliver Hunt via cfe-commits
cfe-commits at lists.llvm.org
Sat Feb 21 12:36:47 PST 2026
================
@@ -992,12 +993,13 @@ void CGHLSLRuntime::emitEntryFunction(const FunctionDecl *FD,
CI->setCallingConv(Fn->getCallingConv());
if (Fn->getReturnType() != CGM.VoidTy)
- OutputSemantic.try_emplace(FD, CI);
+ OutputSemantic.try_emplace(FD, std::make_pair(CI, /*unused*/ nullptr));
----------------
ojhunt wrote:
yes, but this is the tuple constructor for what is semantically (ha!) this:
```cpp
struct OutputSemantic { // I recognize this conflicts with the semantic set name, but I think that should be plural :D
Value *Source;
Type *ElementType;
OutputSemantic(Value *Source, Type *ElementType) ///
}
```
In which case the style would be `OutputSemantic(CI, /*ElementType=*/nullptr)`
it wouldn't be `/*unused*/`
https://github.com/llvm/llvm-project/pull/181740
More information about the cfe-commits
mailing list