[all-commits] [llvm/llvm-project] f3a17d: [clang] Avoid duplicating ProgramAddressSpace in T...

Alexander Richardson via All-commits all-commits at lists.llvm.org
Thu Dec 1 12:41:43 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f3a17d059509c133d8d90d305c0b40bdcbfc1fef
      https://github.com/llvm/llvm-project/commit/f3a17d059509c133d8d90d305c0b40bdcbfc1fef
  Author: Alex Richardson <alexrichardson at google.com>
  Date:   2022-12-01 (Thu, 01 Dec 2022)

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

  Log Message:
  -----------
  [clang] Avoid duplicating ProgramAddressSpace in TargetInfo. NFCI

This value was added to clang/Basic in 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.

Reviewed By: rjmccall

Differential Revision: https://reviews.llvm.org/D138296




More information about the All-commits mailing list