summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2014-08-12 20:04:03 (GMT)
committerBrad King <brad.king@kitware.com>2014-08-12 20:05:05 (GMT)
commitf6f00156791d87c5bf1248b23af563832968db8b (patch)
treeeb294976fbbccd851d57ee881fbbf6803c432c80 /src
parent69e6ab58e10d2a4fba257c7bb59ea1df3c136910 (diff)
downloadCastXML-f6f00156791d87c5bf1248b23af563832968db8b.zip
CastXML-f6f00156791d87c5bf1248b23af563832968db8b.tar.gz
CastXML-f6f00156791d87c5bf1248b23af563832968db8b.tar.bz2
Port to LLVM/Clang SVN r215464 (trunk)
The clang::FrontendAction::CreateASTConsumer method now returns std::unique_ptr<clang::ASTConsumer>, so update our override to return the same type. While at it, mark our declaration with 'override'.
Diffstat (limited to 'src')
-rw-r--r--src/RunClang.cxx8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/RunClang.cxx b/src/RunClang.cxx
index 224c804..7c4e1f5 100644
--- a/src/RunClang.cxx
+++ b/src/RunClang.cxx
@@ -37,6 +37,7 @@
#include "clang/Lex/Preprocessor.h"
#include "clang/Sema/Sema.h"
#include "llvm/ADT/ArrayRef.h"
+#include "llvm/ADT/STLExtras.h"
#include "llvm/Option/ArgList.h"
#include "llvm/Support/Host.h"
#include "llvm/Support/raw_ostream.h"
@@ -157,14 +158,15 @@ public:
class CastXMLSyntaxOnlyAction:
public CastXMLPredefines<clang::SyntaxOnlyAction>
{
- clang::ASTConsumer* CreateASTConsumer(clang::CompilerInstance &CI,
- llvm::StringRef InFile) {
+ std::unique_ptr<clang::ASTConsumer>
+ CreateASTConsumer(clang::CompilerInstance &CI,
+ llvm::StringRef InFile) override {
using llvm::sys::path::filename;
if(!this->Opts.GccXml) {
return clang::SyntaxOnlyAction::CreateASTConsumer(CI, InFile);
} else if(llvm::raw_ostream* OS =
CI.createDefaultOutputFile(false, filename(InFile), "xml")) {
- return new ASTConsumer(CI, *OS, this->Opts);
+ return llvm::make_unique<ASTConsumer>(CI, *OS, this->Opts);
} else {
return 0;
}