This patch tries to refactor ODR checking process for default template argument in ASTReader. We could save about 100 lines of code after the refactoring. The patch is intended to be NFC.
Test Plan:
check-all
Paths
| Differential D118437
[NFC] [Modules] Refactor ODR checking for default template argument in ASTReader ClosedPublic Authored by ChuanqiXu on Jan 27 2022, 11:40 PM.
Details Summary This patch tries to refactor ODR checking process for default template argument in ASTReader. We could save about 100 lines of code after the refactoring. The patch is intended to be NFC. Test Plan:
Diff Detail
Event TimelineComment Actions Looks like a good cleanup. Let me know what you think about the idea of retaining the switch.
This revision is now accepted and ready to land.Feb 9 2022, 6:39 AM This revision was landed with ongoing or failed builds.Feb 9 2022, 6:11 PM Closed by commit rG8c930cef0e4c: [NFC] [Modules] Refactor ODR checking for default template argument in (authored by ChuanqiXu). · Explain Why This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 407359 clang/include/clang/Basic/DiagnosticSerializationKinds.td
clang/lib/Serialization/ASTReader.cpp
|
Rather than use dyn_cast, can't you use the switch(getKind()) idiom of the original? That'll reduce the number of virtual calls won't it? Bonus points for passing getKind() into the lambda so the compiler has a chance of noticing a loop unswitching possibility?