[all-commits] [llvm/llvm-project] a602f7: [clang][TargetInfo] Use LangAS for getPointer{Widt...

Alexander Richardson via All-commits all-commits at lists.llvm.org
Wed Nov 30 12:27:09 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: a602f76a2406cc3edd6b297ede3583b26513a34c
      https://github.com/llvm/llvm-project/commit/a602f76a2406cc3edd6b297ede3583b26513a34c
  Author: Alex Richardson <alexrichardson at google.com>
  Date:   2022-11-30 (Wed, 30 Nov 2022)

  Changed paths:
    M clang/include/clang/Basic/TargetInfo.h
    M clang/lib/AST/ASTContext.cpp
    M clang/lib/AST/ItaniumCXXABI.cpp
    M clang/lib/AST/Mangle.cpp
    M clang/lib/AST/MicrosoftCXXABI.cpp
    M clang/lib/AST/MicrosoftMangle.cpp
    M clang/lib/AST/RecordLayoutBuilder.cpp
    M clang/lib/AST/VTableBuilder.cpp
    M clang/lib/Basic/Targets/AMDGPU.cpp
    M clang/lib/Basic/Targets/AMDGPU.h
    M clang/lib/Basic/Targets/Mips.cpp
    M clang/lib/Basic/Targets/NVPTX.cpp
    M clang/lib/Basic/Targets/X86.h
    M clang/lib/CodeGen/CGBlocks.cpp
    M clang/lib/CodeGen/CGCall.cpp
    M clang/lib/CodeGen/CGDebugInfo.cpp
    M clang/lib/CodeGen/CGExprAgg.cpp
    M clang/lib/CodeGen/CGObjCGNU.cpp
    M clang/lib/CodeGen/CGObjCMac.cpp
    M clang/lib/CodeGen/CGVTables.cpp
    M clang/lib/CodeGen/CodeGenModule.cpp
    M clang/lib/CodeGen/ItaniumCXXABI.cpp
    M clang/lib/CodeGen/MicrosoftCXXABI.cpp
    M clang/lib/CodeGen/PatternInit.cpp
    M clang/lib/CodeGen/SwiftCallingConv.cpp
    M clang/lib/CodeGen/TargetInfo.cpp
    M clang/lib/Frontend/InitPreprocessor.cpp
    M clang/lib/Sema/SemaChecking.cpp
    M clang/lib/Sema/SemaDeclAttr.cpp
    M clang/lib/Sema/SemaExpr.cpp
    M clang/lib/Sema/SemaExprCXX.cpp
    M clang/lib/Sema/SemaType.cpp
    M clang/lib/StaticAnalyzer/Checkers/ObjCContainersASTChecker.cpp
    M clang/unittests/CodeGen/TestCompiler.h

  Log Message:
  -----------
  [clang][TargetInfo] Use LangAS for getPointer{Width,Align}()

Mixing LLVM and Clang address spaces can result in subtle bugs, and there
is no need for this hook to use the LLVM IR level address spaces.
Most of this change is just replacing zero with LangAS::Default,
but it also allows us to remove a few calls to getTargetAddressSpace().

This also removes a stale comment+workaround in
CGDebugInfo::CreatePointerLikeType(): ASTContext::getTypeSize() does
return the expected size for ReferenceType (and handles address spaces).

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




More information about the All-commits mailing list