Originally the loop hint is not displayed correctly in the diagnostic.
This patch fixes it.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Unit Tests
Time | Test | |
---|---|---|
2,860 ms | x64 debian > Clang.Parser::pragma-unroll-and-jam.cpp | |
2,900 ms | x64 debian > Clang.Parser::pragma-unroll.cpp |
Event Timeline
clang/lib/Parse/ParsePragma.cpp | ||
---|---|---|
1306 | We've got some duplication now, as "loop" is also checked in line 1310. Can you see if you can merge these checks, simplify things here a bit? |
clang/lib/Parse/ParsePragma.cpp | ||
---|---|---|
1306 | Yes, the case for loop in below can now be removed. Thank you. |
clang/lib/Parse/ParsePragma.cpp | ||
---|---|---|
1306 | I was hoping that modifying the "loop" case would work: .Case("loop", (llvm::Twine("clang loop ") + Option.getIdentifierInfo()->getName()).str()); |
clang/lib/Parse/ParsePragma.cpp | ||
---|---|---|
1306 | Your suggestion is better than mine, thank you :) |
Update code to handle when IdentifierInfo is null.
The .Case syntax seems to evaulate expression in other non-trigger cases.
The "loop" case was triggered for test case in loop unroll and jam, resulting
in segmentation fault. Anyway the updated code shall be safe now.
We've got some duplication now, as "loop" is also checked in line 1310. Can you see if you can merge these checks, simplify things here a bit?