[clang] 3fed3bf - [clang][bytecode][NFC] Fix getting references to local function ptrs (#129852)
via cfe-commits
cfe-commits at lists.llvm.org
Wed Mar 5 02:26:46 PST 2025
Author: Timm Baeder
Date: 2025-03-05T11:26:43+01:00
New Revision: 3fed3bfef2f620d9423733298ee1e99d6c7d3068
URL: https://github.com/llvm/llvm-project/commit/3fed3bfef2f620d9423733298ee1e99d6c7d3068
DIFF: https://github.com/llvm/llvm-project/commit/3fed3bfef2f620d9423733298ee1e99d6c7d3068.diff
LOG: [clang][bytecode][NFC] Fix getting references to local function ptrs (#129852)
This is the same thing we do for globals and parameters.
Added:
Modified:
clang/lib/AST/ByteCode/Compiler.cpp
Removed:
################################################################################
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) {
More information about the cfe-commits
mailing list