Skip to content

Commit bbd6992

Browse files
committed
Address review feedback
1 parent 70aa8d6 commit bbd6992

File tree

4 files changed

+13
-14
lines changed

4 files changed

+13
-14
lines changed

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

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -280,17 +280,16 @@ def ConstPtrAttr : CIR_Attr<"ConstPtr", "ptr", [TypedAttrInterface]> {
280280
// VisibilityAttr
281281
//===----------------------------------------------------------------------===//
282282

283-
def VK_Default : I32EnumAttrCase<"Default", 1, "default">;
284-
def VK_Hidden : I32EnumAttrCase<"Hidden", 2, "hidden">;
285-
def VK_Protected : I32EnumAttrCase<"Protected", 3, "protected">;
286-
287-
def VisibilityKind : I32EnumAttr<"VisibilityKind", "C/C++ visibility", [
288-
VK_Default, VK_Hidden, VK_Protected
283+
def CIR_VisibilityKind : I32EnumAttr<"VisibilityKind", "C/C++ visibility", [
284+
I32EnumAttrCase<"Default", 1, "default">,
285+
I32EnumAttrCase<"Hidden", 2, "hidden">,
286+
I32EnumAttrCase<"Protected", 3, "protected">
289287
]> {
288+
let genSpecializedAttr = 0;
290289
let cppNamespace = "::cir";
291290
}
292291

293-
def VisibilityAttr : CIR_Attr<"Visibility", "visibility"> {
292+
def CIR_VisibilityAttr : CIR_Attr<"Visibility", "visibility"> {
294293
let summary = "Visibility attribute";
295294
let description = [{
296295
Visibility attributes.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1653,7 +1653,7 @@ def GlobalOp : CIR_Op<"global",
16531653
// necessary Symbol's interface in terms of linkage instead.
16541654
let arguments = (ins SymbolNameAttr:$sym_name,
16551655
DefaultValuedAttr<
1656-
VisibilityAttr,
1656+
CIR_VisibilityAttr,
16571657
"VisibilityKind::Default"
16581658
>:$global_visibility,
16591659
OptionalAttr<StrAttr>:$sym_visibility,

clang/lib/CIR/CodeGen/CIRGenModule.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1103,7 +1103,7 @@ static bool shouldAssumeDSOLocal(const CIRGenModule &cgm,
11031103
assert(!cir::MissingFeatures::opGlobalDLLImportExport());
11041104

11051105
const llvm::Triple &tt = cgm.getTriple();
1106-
const auto &cgOpts = cgm.getCodeGenOpts();
1106+
const CodeGenOptions &cgOpts = cgm.getCodeGenOpts();
11071107
if (tt.isWindowsGNUEnvironment()) {
11081108
// In MinGW, variables without DLLImport can still be automatically
11091109
// imported from a DLL by the linker; don't mark variables that
@@ -1135,7 +1135,7 @@ static bool shouldAssumeDSOLocal(const CIRGenModule &cgm,
11351135
return false;
11361136

11371137
llvm::Reloc::Model rm = cgOpts.RelocationModel;
1138-
const auto &lOpts = cgm.getLangOpts();
1138+
const LangOptions &lOpts = cgm.getLangOpts();
11391139
if (rm != llvm::Reloc::Static && !lOpts.PIE) {
11401140
// On ELF, if -fno-semantic-interposition is specified and the target
11411141
// supports local aliases, there will be neither CC1
@@ -1144,8 +1144,8 @@ static bool shouldAssumeDSOLocal(const CIRGenModule &cgm,
11441144
// PLT indirection).
11451145
if (!(isa<cir::FuncOp>(gv) && gv.canBenefitFromLocalAlias()))
11461146
return false;
1147-
return !(cgm.getLangOpts().SemanticInterposition ||
1148-
cgm.getLangOpts().HalfNoSemanticInterposition);
1147+
return !(lOpts.SemanticInterposition ||
1148+
lOpts.HalfNoSemanticInterposition);
11491149
}
11501150

11511151
// A definition cannot be preempted from an executable.

clang/lib/CIR/Lowering/DirectToLLVM/LowerToLLVM.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -966,7 +966,7 @@ void CIRToLLVMGlobalOpLowering::setupRegionInitializedLLVMGlobalOp(
966966
const bool isConst = false;
967967
assert(!cir::MissingFeatures::addressSpace());
968968
const unsigned addrSpace = 0;
969-
const auto isDsoLocal = op.getDsolocal();
969+
const bool isDsoLocal = op.getDsolocal();
970970
assert(!cir::MissingFeatures::opGlobalThreadLocal());
971971
const bool isThreadLocal = false;
972972
const uint64_t alignment = op.getAlignment().value_or(0);
@@ -1020,7 +1020,7 @@ mlir::LogicalResult CIRToLLVMGlobalOpLowering::matchAndRewrite(
10201020
const bool isConst = false;
10211021
assert(!cir::MissingFeatures::addressSpace());
10221022
const unsigned addrSpace = 0;
1023-
const auto isDsoLocal = op.getDsolocal();
1023+
const bool isDsoLocal = op.getDsolocal();
10241024
assert(!cir::MissingFeatures::opGlobalThreadLocal());
10251025
const bool isThreadLocal = false;
10261026
const uint64_t alignment = op.getAlignment().value_or(0);

0 commit comments

Comments
 (0)