I don't think the namespace adds value.
Oh, this is cute. We have StmtVisitor which does not use a namespace, but defines these functions. Then we duplicate these function definitions in each of the comment, decl, and attribute visitors under distinct namespaces so we don't get ODR violations.
I think we should add llvm::make_const_ptr to STLExtras.h so we can use the same definition from everywhere. We can use std::add_pointer in place of make_ptr, because that is a one-to-one mapping, so we can drop make_ptr entirely. However, I don't think we can use std::add_pointer<std::add_const> similarly because there's no way to bind that to the template template parameter directly. I'm happy to make these changes if you'd like.
I'd appreciate some comments gently reminding the reader that this include introduces declarations which are expected to be members of a class.
Similarly, add some comments about how this adds implementations to the class.
Wouldn't this be !FunctionContent.empty()?
I think the point is to separate the implementation detail. I don't care either way, but the other visitors should be changed first and this one can follow the same pattern.
Yes, I've thought about this duplication too. If you deduplicate, I'll rebase this change.
I think c++17 is the first to allow typename here.
Add a full stop to the end of the comment.
This seems unrelated to this patch (same below) ?
Full stop here as well.
Formatting is incorrect.
Huh, good to know.
The source file comment will be incorrect. This emits the node traverser not the dumper.