Only an obscure case is moved.
Details
Diff Detail
- Repository
- rC Clang
Event Timeline
It appears we have no test coverage for this case -- can you introduce some?
lib/AST/ASTDumper.cpp | ||
---|---|---|
507–508 | Might as well clean this up to be if (const auto *DC = dyn_cast<DeclContext>(D)) | |
514–515 | Why did this condition get dropped? | |
1233 | Why is the isa<> test needed? D must be an ObjCMethodDecl which inherits from DeclContext, so this seems unneeded. | |
lib/AST/TextNodeDumper.cpp | ||
260 | const auto * | |
262 | const auto * |
I don't know what C++ code results in the undeserialized declarations output. Can you suggest some?
lib/AST/ASTDumper.cpp | ||
---|---|---|
514–515 | The condition is using internal knowledge of the dumpDeclContext method - that it doesn't do anything if these conditions are not met, so avoid calling the method in the first place. We can just call the method. The for loop which remains will simply do nothing. |
I haven't the foggiest idea. I'd recommend doing an svn blame to see what commit added that code and try to work backwards from there -- presumably there's some related test code that could be run under -ast-dump.
lib/AST/ASTDumper.cpp | ||
---|---|---|
514–515 | Ah, I see what's happening now, thank you. |
LGTM aside from the testing situation -- so long as the tests come out without changes, this is good to go. If there is a change in test behavior, let's do another round of review just to verify everyone's happy with the behavioral change.
lib/AST/ASTDumper.cpp | ||
---|---|---|
1233 | Since this is just formatting changes unrelated to the patch, feel free to revert and commit separately for commit hygiene. |
LGTM! At some point, we may want to revisit how we dump TranslationUnitDecl to make it a bit less inscrutable (I have no idea what those "invalid sloc" strings are telling me). At that point, we may want to turn <undeserialized declarations> into undeserialized_declarations as well so it stands out a bit more.
It looks like this change broke a number of the LLDB tests:
lab.llvm.org:8011/builders/lldb-x64-windows-ninja/builds/781
Could you look into this or revert the change, so that the bot can go back to green?
Why did this condition get dropped?