[PATCH] D77119: [AVR] Fix function pointer address space

Dylan McKay via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 1 01:37:34 PDT 2020


This revision was automatically updated to reflect the committed changes.
Closed by commit rG57fd86de879c: [AVR] Fix function pointer address space (authored by vlastik, committed by dylanmckay).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D77119/new/

https://reviews.llvm.org/D77119

Files:
  clang/lib/CodeGen/CodeGenTypes.cpp


Index: clang/lib/CodeGen/CodeGenTypes.cpp
===================================================================
--- clang/lib/CodeGen/CodeGenTypes.cpp
+++ clang/lib/CodeGen/CodeGenTypes.cpp
@@ -595,7 +595,11 @@
     llvm::Type *PointeeType = ConvertTypeForMem(ETy);
     if (PointeeType->isVoidTy())
       PointeeType = llvm::Type::getInt8Ty(getLLVMContext());
-    unsigned AS = Context.getTargetAddressSpace(ETy);
+
+    unsigned AS = PointeeType->isFunctionTy()
+                      ? getDataLayout().getProgramAddressSpace()
+                      : Context.getTargetAddressSpace(ETy);
+
     ResultType = llvm::PointerType::get(PointeeType, AS);
     break;
   }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D77119.254112.patch
Type: text/x-patch
Size: 669 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200401/2494f671/attachment.bin>


More information about the cfe-commits mailing list