[clang] [clang][bytecode][NFC] Fix getting references to local function ptrs (PR #129852)
via cfe-commits
cfe-commits at lists.llvm.org
Wed Mar 5 01:03:22 PST 2025
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-clang
Author: Timm Baeder (tbaederr)
<details>
<summary>Changes</summary>
This is the same thing we do for globals and parameters.
---
Full diff: https://github.com/llvm/llvm-project/pull/129852.diff
1 Files Affected:
- (modified) clang/lib/AST/ByteCode/Compiler.cpp (+1-1)
``````````diff
diff --git a/clang/lib/AST/ByteCode/Compiler.cpp b/clang/lib/AST/ByteCode/Compiler.cpp
index 394e39e99a106..281fb7e14a57d 100644
--- a/clang/lib/AST/ByteCode/Compiler.cpp
+++ b/clang/lib/AST/ByteCode/Compiler.cpp
@@ -6325,7 +6325,7 @@ bool Compiler<Emitter>::visitDeclRef(const ValueDecl *D, const Expr *E) {
if (auto It = Locals.find(D); It != Locals.end()) {
const unsigned Offset = It->second.Offset;
if (IsReference)
- return this->emitGetLocal(PT_Ptr, Offset, E);
+ return this->emitGetLocal(classifyPrim(E), Offset, E);
return this->emitGetPtrLocal(Offset, E);
} else if (auto GlobalIndex = P.getGlobal(D)) {
if (IsReference) {
``````````
</details>
https://github.com/llvm/llvm-project/pull/129852
More information about the cfe-commits
mailing list