Skip to content

Commit 6871490

Browse files
committed
use std::array and add the comment for default map
1 parent a5d1699 commit 6871490

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

clang/include/clang/CIR/Dialect/IR/CIRAttrs.td

+1-1
Original file line numberDiff line numberDiff line change
@@ -707,7 +707,7 @@ def AddressSpaceAttr : CIR_Attr<"AddressSpace", "addrspace"> {
707707
let extraClassDeclaration = [{
708708
static constexpr char kTargetKeyword[] = "}]#targetASCase.symbol#[{";
709709
static constexpr int32_t kFirstTargetASValue = }]#targetASCase.value#[{;
710-
using MapTy = unsigned[kFirstTargetASValue];
710+
using MapTy = std::array<unsigned, kFirstTargetASValue>;
711711

712712
bool isLang() const;
713713
bool isTarget() const;

clang/lib/CIR/Dialect/Transforms/TargetLowering/TargetInfo.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ TargetLoweringInfo::TargetLoweringInfo(std::unique_ptr<ABIInfo> Info)
99
TargetLoweringInfo::~TargetLoweringInfo() = default;
1010

1111
AddressSpaceAttr::MapTy const &TargetLoweringInfo::getCIRAddrSpaceMap() const {
12-
static AddressSpaceAttr::MapTy defaultAddrSpaceMap = {0};
12+
// Flatten all non-target address spaces to addrspace(0)
13+
static AddressSpaceAttr::MapTy defaultAddrSpaceMap = {};
1314
return defaultAddrSpaceMap;
1415
}
1516

0 commit comments

Comments
 (0)