Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
utils/TableGen/CodeGenDAGPatterns.h | ||
---|---|---|
924–925 ↗ | (On Diff #149069) | Why do you need a non-const overload here? The pointer itself should never be changed. Actually, it would arguably be nicer to just return a reference here, since the fact that the TreePattern is stored in a unique_ptr seems like an implementation detail that callers should not have to worry about. |
utils/TableGen/CodeGenDAGPatterns.h | ||
---|---|---|
924–925 ↗ | (On Diff #149069) |
There are some places that check that the pattern is not null, before accessing the value. Having a unique_ptr there seemed just easier. But I suppose we could have something like hasPattern, if you think that would be better? |
utils/TableGen/CodeGenDAGPatterns.h | ||
---|---|---|
924 ↗ | (On Diff #149086) | This code looks like it's either making a copy of pattern or giving ownership of DAGInstruction::Pattern to the caller. Shouldn't it be returning a raw pointer? |
utils/TableGen/CodeGenDAGPatterns.cpp | ||
---|---|---|
3575 ↗ | (On Diff #149156) | Why doesn't insert work? There should be an rvalue pair version. |
Do not create pair explicitly with emplace.
utils/TableGen/CodeGenDAGPatterns.cpp | ||
---|---|---|
3575 ↗ | (On Diff #149156) | Thanks. With emplace we do not have to use make_pair. |