Exactly what it says on the tin!
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
clang/unittests/Analysis/CFGDominatorTree.cpp | ||
---|---|---|
95 ↗ | (On Diff #201977) | Why not have a constructor that takes the cfg and constructs a domtree straight away? But this should probably go into a separate patch. |
113 ↗ | (On Diff #201977) | A tastcase with a virtual root postdominating other nodes would be welcome. |
clang/unittests/Analysis/CFGDominatorTree.cpp | ||
---|---|---|
37 ↗ | (On Diff #201977) | You can use a raw string literal to make it more readable: https://en.cppreference.com/w/cpp/language/string_literal |
clang/unittests/Analysis/CFGDominatorTree.cpp | ||
---|---|---|
37 ↗ | (On Diff #201977) | ...or just omit \ns because the compiler doesn't really care. |
clang/unittests/Analysis/CFGDominatorTree.cpp | ||
---|---|---|
95 ↗ | (On Diff #201977) | Yea, it's been bothering me for a while, but apparently not enough to fix it (just yet!). |
Oh, I realized later that code I commented on were only moved from somewhere else. If you feel like tackling these comments feel free to do so in a separate patch so this one stays clean (no changes to moved code).
clang/unittests/Analysis/CFGBuilder.h | ||
---|---|---|
18 ↗ | (On Diff #202004) | Is it actually sensible to write tests where the tool failed? I can imagine these status codes being helpful for debugging but they has little to do with the tests. I wonder if we actually need all these or a nullable pointer as a result is sufficient. |
54 ↗ | (On Diff #202004) | Do you expect the code to only contain one function? If so, you should enforce it. |
65 ↗ | (On Diff #202004) | Do you need the std::move here? |
clang/unittests/Analysis/CFGBuilder.h | ||
---|---|---|
16 ↗ | (On Diff #202004) | Given that now it's in a header, i guess we need to pick a less generic name. Eg., CFGBuildResult. |
54 ↗ | (On Diff #202004) | I guess it sucks that we can't re-use my findDeclByName() helper here. |
clang/unittests/Analysis/CFGDominatorTree.cpp | ||
22–28 ↗ | (On Diff #202004) | Why isn't this a simple function template? |
30–32 ↗ | (On Diff #202004) | StmtType is unused. Did you mean FindStmt<StmtType>? |
31 ↗ | (On Diff #202004) | This looks like "hasNoStmtType" to me, did you mean !=? |
clang/unittests/Analysis/CFGDominatorTree.cpp | ||
---|---|---|
22–32 ↗ | (On Diff #202004) | Hmmm, this entire thing is pointless, really. It is used as a sanity check of some sort, whether for example the 4th block really is what I believe it would be. But this is anything but a reliable way to test it. I think this causes far more confusion than value, I'll just remove it, the actual tests are thorough enough enough to break if the CFG changes. |