Skip to content

Commit 860ac4d

Browse files
committed
address comments on renaming
1 parent 4a993e8 commit 860ac4d

34 files changed

+162
-161
lines changed

clang/include/clang/CIR/Dialect/Builder/CIRBaseBuilder.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ class CIRBaseBuilderTy : public mlir::OpBuilder {
121121
return getPointerTo(ty);
122122

123123
mlir::ptr::MemorySpaceAttrInterface addrSpaceAttr =
124-
cir::toCIRLanguageAddressSpaceAttr(getContext(), langAS);
124+
cir::toCIRLangAddressSpaceAttr(getContext(), langAS);
125125
return getPointerTo(ty, addrSpaceAttr);
126126
}
127127

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

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -964,36 +964,37 @@ def CIR_DynamicCastInfoAttr : CIR_Attr<"DynamicCastInfo", "dyn_cast_info"> {
964964
// AddressSpaceAttr
965965
//===----------------------------------------------------------------------===//
966966

967-
def CIR_LanguageAddressSpaceAttr : CIR_EnumAttr<CIR_LanguageAddressSpace, "language_address_space", [
967+
def CIR_LangAddressSpaceAttr :
968+
CIR_EnumAttr<CIR_LangAddressSpace, "lang_address_space", [
968969
DeclareAttrInterfaceMethods<MemorySpaceAttrInterface>
969970
]> {
970971

971972
let summary = "Represents a language address space";
972973
let description = [{
973974
Encodes the semantic address spaces defined by the front-end language
974975
(e.g. `__shared__`, `__constant__`, `__local__`). Values are stored using the
975-
`cir::LanguageAddressSpace` enum, keeping the representation compact while and
976+
`cir::LangAddressSpace` enum, keeping the representation compact while and
976977
preserves the qualifier until it is mapped onto target/LLVM address-space numbers.
977978

978979
Example:
979980
``` mlir
980-
!cir.ptr<!s32i, language_address_space(offload_local)>
981-
cir.global constant external language_address_space(offload_constant)
981+
!cir.ptr<!s32i, lang_address_space(offload_local)>
982+
cir.global constant external lang_address_space(offload_constant)
982983

983984
```
984985
}];
985986

986987
let builders = [
987988
AttrBuilder<(ins "clang::LangAS":$langAS), [{
988-
return $_get($_ctxt, cir::toCIRLanguageAddressSpace(langAS));
989+
return $_get($_ctxt, cir::toCIRLangAddressSpace(langAS));
989990
}]>
990991
];
991992

992993
let assemblyFormat = [{
993994
`(` custom<AddressSpaceValue>($value) `)`
994995
}];
995996

996-
let defaultValue = "cir::LanguageAddressSpace::Default";
997+
let defaultValue = "cir::LangAddressSpace::Default";
997998

998999
let extraClassDeclaration = [{
9991000
unsigned getAsUnsignedValue() const;

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ class CIR_DefaultValuedEnumParameter<EnumAttrInfo info, string value = "">
4141
let defaultValue = value;
4242
}
4343

44-
def CIR_LanguageAddressSpace : CIR_I32EnumAttr<
45-
"LanguageAddressSpace", "language address space kind", [
44+
def CIR_LangAddressSpace : CIR_I32EnumAttr<
45+
"LangAddressSpace", "language address space kind", [
4646
I32EnumAttrCase<"Default", 0, "default">,
4747
I32EnumAttrCase<"OffloadPrivate", 1, "offload_private">,
4848
I32EnumAttrCase<"OffloadLocal", 2, "offload_local">,
@@ -57,7 +57,7 @@ def CIR_LanguageAddressSpace : CIR_I32EnumAttr<
5757

5858
The `value` parameter is an extensible enum, which encodes target address
5959
space as an offset to the last language address space. For that reason, the
60-
attribute is implemented as custom LanguageAddressSpaceAttr, which provides custom
60+
attribute is implemented as custom LangAddressSpaceAttr, which provides custom
6161
printer and parser for the `value` parameter.
6262
}];
6363

clang/include/clang/CIR/Dialect/IR/CIRTypes.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,17 @@ bool isSized(mlir::Type ty);
3535
// AddressSpace helpers
3636
//===----------------------------------------------------------------------===//
3737

38-
cir::LanguageAddressSpace toCIRLanguageAddressSpace(clang::LangAS langAS);
38+
cir::LangAddressSpace toCIRLangAddressSpace(clang::LangAS langAS);
3939

4040
/// Convert a LangAS to the appropriate address space attribute interface.
4141
/// Returns a MemorySpaceAttrInterface.
4242
mlir::ptr::MemorySpaceAttrInterface
43-
toCIRLanguageAddressSpaceAttr(mlir::MLIRContext *ctx, clang::LangAS langAS);
43+
toCIRLangAddressSpaceAttr(mlir::MLIRContext *ctx, clang::LangAS langAS);
4444

4545
bool isSupportedCIRMemorySpaceAttr(
4646
mlir::ptr::MemorySpaceAttrInterface memorySpace);
4747

48-
constexpr unsigned getAsUnsignedValue(cir::LanguageAddressSpace as) {
48+
constexpr unsigned getAsUnsignedValue(cir::LangAddressSpace as) {
4949
return static_cast<unsigned>(as);
5050
}
5151

clang/lib/CIR/CodeGen/CIRGenBuiltin.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1730,7 +1730,7 @@ RValue CIRGenFunction::emitBuiltinExpr(const GlobalDecl GD, unsigned BuiltinID,
17301730
// builtin / dynamic alloca we have to handle it here.
17311731
assert(!cir::MissingFeatures::addressSpace());
17321732
mlir::ptr::MemorySpaceAttrInterface AAS = getCIRAllocaAddressSpace();
1733-
mlir::ptr::MemorySpaceAttrInterface EAS = cir::toCIRLanguageAddressSpaceAttr(
1733+
mlir::ptr::MemorySpaceAttrInterface EAS = cir::toCIRLangAddressSpaceAttr(
17341734
&getMLIRContext(), E->getType()->getPointeeType().getAddressSpace());
17351735
if (EAS != AAS) {
17361736
assert(false && "Non-default address space for alloca NYI");

clang/lib/CIR/CodeGen/CIRGenDecl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,7 @@ CIRGenModule::getOrCreateStaticVarDecl(const VarDecl &D,
483483
Name = getStaticDeclName(*this, D);
484484

485485
mlir::Type LTy = getTypes().convertTypeForMem(Ty);
486-
mlir::ptr::MemorySpaceAttrInterface AS = cir::toCIRLanguageAddressSpaceAttr(
486+
mlir::ptr::MemorySpaceAttrInterface AS = cir::toCIRLangAddressSpaceAttr(
487487
&getMLIRContext(), getGlobalVarAddressSpace(&D));
488488

489489
// OpenCL variables in local address space and CUDA shared

clang/lib/CIR/CodeGen/CIRGenExpr.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2082,9 +2082,9 @@ LValue CIRGenFunction::emitCastLValue(const CastExpr *E) {
20822082
case CK_AddressSpaceConversion: {
20832083
LValue LV = emitLValue(E->getSubExpr());
20842084
QualType DestTy = getContext().getPointerType(E->getType());
2085-
mlir::Attribute SrcAS = cir::toCIRLanguageAddressSpaceAttr(
2085+
mlir::Attribute SrcAS = cir::toCIRLangAddressSpaceAttr(
20862086
&getMLIRContext(), E->getSubExpr()->getType().getAddressSpace());
2087-
mlir::Attribute DestAS = cir::toCIRLanguageAddressSpaceAttr(
2087+
mlir::Attribute DestAS = cir::toCIRLangAddressSpaceAttr(
20882088
&getMLIRContext(), E->getType().getAddressSpace());
20892089
mlir::Value V = getTargetHooks().performAddrSpaceCast(
20902090
*this, LV.getPointer(), SrcAS, DestAS, convertType(DestTy));
@@ -3145,7 +3145,7 @@ Address CIRGenFunction::CreateTempAlloca(mlir::Type Ty, CharUnits Align,
31453145
// be different from the type defined by the language. For example,
31463146
// in C++ the auto variables are in the default address space. Therefore
31473147
// cast alloca to the default address space when necessary.
3148-
if (auto ASTAS = cir::toCIRLanguageAddressSpaceAttr(
3148+
if (auto ASTAS = cir::toCIRLangAddressSpaceAttr(
31493149
&getMLIRContext(), CGM.getLangTempAllocaAddressSpace());
31503150
getCIRAllocaAddressSpace() != ASTAS) {
31513151
llvm_unreachable("Requires address space cast which is NYI");

clang/lib/CIR/CodeGen/CIRGenExprScalar.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1882,10 +1882,10 @@ mlir::Value ScalarExprEmitter::VisitCastExpr(CastExpr *CE) {
18821882
}
18831883
// Since target may map different address spaces in AST to the same address
18841884
// space, an address space conversion may end up as a bitcast.
1885-
mlir::Attribute SrcAS = cir::toCIRLanguageAddressSpaceAttr(
1885+
mlir::Attribute SrcAS = cir::toCIRLangAddressSpaceAttr(
18861886
&CGF.getMLIRContext(),
18871887
E->getType()->getPointeeType().getAddressSpace());
1888-
mlir::Attribute DestAS = cir::toCIRLanguageAddressSpaceAttr(
1888+
mlir::Attribute DestAS = cir::toCIRLangAddressSpaceAttr(
18891889
&CGF.getMLIRContext(), DestTy->getPointeeType().getAddressSpace());
18901890

18911891
return CGF.CGM.getTargetCIRGenInfo().performAddrSpaceCast(

clang/lib/CIR/CodeGen/CIRGenModule.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1098,7 +1098,7 @@ CIRGenModule::getOrCreateCIRGlobal(StringRef mangledName, mlir::Type ty,
10981098
}
10991099

11001100
mlir::Attribute cirAS =
1101-
cir::toCIRLanguageAddressSpaceAttr(&getMLIRContext(), langAS);
1101+
cir::toCIRLangAddressSpaceAttr(&getMLIRContext(), langAS);
11021102
if (entry) {
11031103
mlir::ptr::MemorySpaceAttrInterface entryCIRAS = entry.getAddrSpaceAttr();
11041104
if (WeakRefReferences.erase(entry)) {
@@ -1155,7 +1155,7 @@ CIRGenModule::getOrCreateCIRGlobal(StringRef mangledName, mlir::Type ty,
11551155
}
11561156

11571157
mlir::ptr::MemorySpaceAttrInterface declCIRAS =
1158-
cir::toCIRLanguageAddressSpaceAttr(&getMLIRContext(),
1158+
cir::toCIRLangAddressSpaceAttr(&getMLIRContext(),
11591159
getGlobalVarAddressSpace(d));
11601160
// TODO(cir): do we need to strip pointer casts for Entry?
11611161

@@ -1766,7 +1766,7 @@ generateStringLiteral(mlir::Location loc, mlir::TypedAttr c,
17661766
cir::GlobalLinkageKind lt, CIRGenModule &cgm,
17671767
StringRef globalName, CharUnits alignment) {
17681768
mlir::ptr::MemorySpaceAttrInterface addrSpace =
1769-
cir::toCIRLanguageAddressSpaceAttr(&cgm.getMLIRContext(),
1769+
cir::toCIRLangAddressSpaceAttr(&cgm.getMLIRContext(),
17701770
cgm.getGlobalConstantAddressSpace());
17711771

17721772
// Create a global variable for this string
@@ -1984,7 +1984,7 @@ CIRGenModule::getAddrOfGlobalTemporary(const MaterializeTemporaryExpr *expr,
19841984
}
19851985
}
19861986
mlir::ptr::MemorySpaceAttrInterface targetAS =
1987-
cir::toCIRLanguageAddressSpaceAttr(&getMLIRContext(), addrSpace);
1987+
cir::toCIRLangAddressSpaceAttr(&getMLIRContext(), addrSpace);
19881988

19891989
auto loc = getLoc(expr->getSourceRange());
19901990
auto gv = createGlobalOp(*this, loc, name, type, isConstant, targetAS,

clang/lib/CIR/CodeGen/TargetInfo.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,9 +269,9 @@ class CommonSPIRTargetCIRGenInfo : public TargetCIRGenInfo {
269269

270270
mlir::ptr::MemorySpaceAttrInterface
271271
getCIRAllocaAddressSpace() const override {
272-
return cir::LanguageAddressSpaceAttr::get(
272+
return cir::LangAddressSpaceAttr::get(
273273
&getABIInfo().CGT.getMLIRContext(),
274-
cir::LanguageAddressSpace::OffloadPrivate);
274+
cir::LangAddressSpace::OffloadPrivate);
275275
}
276276

277277
cir::CallingConv getOpenCLKernelCallingConv() const override {

0 commit comments

Comments
 (0)