Skip to content

Commit

Permalink
[CIR] Change linkage name from private to cir_private
Browse files Browse the repository at this point in the history
Prevents clash with MLIR's symbol visibility "private".
  • Loading branch information
bcardosolopes committed May 13, 2023
1 parent 55ce197 commit 2ae0230
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions clang/include/clang/CIR/Dialect/IR/CIROps.td
Original file line number Diff line number Diff line change
Expand Up @@ -1093,9 +1093,10 @@ def Global_WeakODRLinkage :
// Rename collisions when linking (static functions).
def Global_InternalLinkage :
I32EnumAttrCase<"InternalLinkage", 7, "internal">;
// Like Internal, but omit from symbol table.
// Like Internal, but omit from symbol table, prefix it with
// "cir_" to prevent clash with MLIR's symbol "private".
def Global_PrivateLinkage :
I32EnumAttrCase<"PrivateLinkage", 8, "private">;
I32EnumAttrCase<"PrivateLinkage", 8, "cir_private">;
// ExternalWeak linkage description.
def Global_ExternalWeakLinkage :
I32EnumAttrCase<"ExternalWeakLinkage", 9, "extern_weak">;
Expand Down
2 changes: 1 addition & 1 deletion clang/test/CIR/IR/invalid.cir
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ module {
// -----

module {
cir.global @a = #cir.const_array<[0 : i8, -23 : i8, 33 : i8] : !cir.array<i32 x 3>> // expected-error {{expected string or keyword containing one of the following enum values for attribute 'linkage' [external, available_externally, linkonce, linkonce_odr, weak, weak_odr, internal, private, extern_weak, common]}}
cir.global @a = #cir.const_array<[0 : i8, -23 : i8, 33 : i8] : !cir.array<i32 x 3>> // expected-error {{expected string or keyword containing one of the following enum values for attribute 'linkage' [external, available_externally, linkonce, linkonce_odr, weak, weak_odr, internal, cir_private, extern_weak, common]}}
}

// -----
Expand Down

0 comments on commit 2ae0230

Please sign in to comment.