public:
virtual std::unique_ptr<clang::ASTConsumer> CreateASTConsumer(
clang::CompilerInstance &Compiler, llvm::StringRef InFile) {
- return std::unique_ptr<clang::ASTConsumer>(
- new FindNamedClassConsumer);
+ return std::make_unique<FindNamedClassConsumer>();
}
};
virtual std::unique_ptr<clang::ASTConsumer> CreateASTConsumer(
clang::CompilerInstance &Compiler, llvm::StringRef InFile) {
- return std::unique_ptr<clang::ASTConsumer>(
- new FindNamedClassConsumer(&Compiler.getASTContext()));
+ return std::make_unique<FindNamedClassConsumer>(&Compiler.getASTContext());
}
Now that the ASTContext is available in the RecursiveASTVisitor, we can
public:
virtual std::unique_ptr<clang::ASTConsumer> CreateASTConsumer(
clang::CompilerInstance &Compiler, llvm::StringRef InFile) {
- return std::unique_ptr<clang::ASTConsumer>(
- new FindNamedClassConsumer(&Compiler.getASTContext()));
+ return std::make_unique<FindNamedClassConsumer>(&Compiler.getASTContext());
}
};