[PATCH] D138296: [clang] Avoid duplicating ProgramAddressSpace in TargetInfo. NFCI

Alexander Richardson via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 18 07:19:28 PST 2022


arichardson created this revision.
arichardson added reviewers: eandrews, dylanmckay, bader, rjmccall.
Herald added subscribers: jrtc27, luismarques, s.egerton, Jim, PkmX, atanasyan, simoncook, kristof.beyls, sdardis.
Herald added a project: All.
arichardson requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

This value was added to clang/Basic in D111566 <https://reviews.llvm.org/D111566>, but is only used during
codegen, where we can use the LLVM IR DataLayout instead. I noticed this
because the downstream CHERI targets would have to also set this value
for AArch64/RISC-V/MIPS. Instead of duplicating more information between
LLVM IR and Clang, this patch moves getTargetAddressSpace(QualType T) to
CodeGenTypes, where we can consult the DataLayout.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D138296

Files:
  clang/include/clang/AST/ASTContext.h
  clang/include/clang/Basic/TargetInfo.h
  clang/lib/AST/ASTContext.cpp
  clang/lib/Basic/TargetInfo.cpp
  clang/lib/Basic/Targets/AVR.h
  clang/lib/CodeGen/CGCall.cpp
  clang/lib/CodeGen/CGDebugInfo.cpp
  clang/lib/CodeGen/CGDeclCXX.cpp
  clang/lib/CodeGen/CGExpr.cpp
  clang/lib/CodeGen/CGOpenMPRuntimeGPU.cpp
  clang/lib/CodeGen/CodeGenModule.cpp
  clang/lib/CodeGen/CodeGenTypes.cpp
  clang/lib/CodeGen/CodeGenTypes.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D138296.476465.patch
Type: text/x-patch
Size: 12846 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20221118/351d8137/attachment-0001.bin>


More information about the cfe-commits mailing list