Skip to content

Commit

Permalink
[Frontend][OpenMP] Add suggested brackets in array initialization
Browse files Browse the repository at this point in the history
Fixes -Werror build after 40137ff.
  • Loading branch information
kparzysz committed Apr 22, 2024
1 parent e95e94a commit 14e6f63
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions llvm/utils/TableGen/DirectiveEmitter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,7 @@ static void EmitLeafTable(const DirectiveLanguage &DirLang, raw_ostream &OS,
<< "[][" << MaxLeafCount + 2 << "] = {\n";
for (size_t I = 0, E = Directives.size(); I != E; ++I) {
auto &Leaves = LeafTable[Ordering[I]];
OS << " " << GetDirectiveName(DirLang, Directives[Leaves[0]]);
OS << " {" << GetDirectiveName(DirLang, Directives[Leaves[0]]);
OS << ", static_cast<" << DirectiveType << ">(" << Leaves[1] << "),";
for (size_t I = 2, E = Leaves.size(); I != E; ++I) {
int Idx = Leaves[I];
Expand All @@ -587,7 +587,7 @@ static void EmitLeafTable(const DirectiveLanguage &DirLang, raw_ostream &OS,
else
OS << " static_cast<" << DirectiveType << ">(-1),";
}
OS << '\n';
OS << "},\n";
}
OS << "};\n\n";

Expand Down

1 comment on commit 14e6f63

@dyung
Copy link
Collaborator

@dyung dyung commented on 14e6f63 Apr 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @kparzysz, after this change, the two tests you modified in 40137ff are failing on many bots and appear that they need the CHECK lines to be updated accordingly?

For example from https://lab.llvm.org/buildbot/#/builders/139/builds/63958 directive1.td. Prior to your change, the test was passing and the check line was

// IMPL-NEXT:    llvm::tdl::TDLD_dira, static_cast<llvm::tdl::Directive>(0),

But after this change, the compiler now emits an extra pair of braces causing the match to fail:

          245: static_assert(sizeof(llvm::tdl::Directive) == sizeof(int)); 
next:371       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          246: [[maybe_unused]] static const llvm::tdl::Directive LeafConstructTable[][2] = { 
next:372       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
next:373'0                                                                                   X error: no match found
          247:  {llvm::tdl::TDLD_dira, static_cast<llvm::tdl::Directive>(0),}, 
next:373'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
next:373'1      ?                                                               possible intended match

It appears that the two tests directive1.td and directive2.td may need to be updated to account for the extra braces now being generated unless that is incorrect. Can you take a look and update/fix the failing tests?

Many bots are failing due to this issue including but not limited to the following:

Please sign in to comment.