diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2017-06-09 01:36:10 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2017-06-09 01:36:10 +0000 |
commit | 772553c418344b6943a468b79e043180840eb255 (patch) | |
tree | f02a6f512479eac317c00697d16335e7d10a5439 /unittests | |
parent | 4ed69c25ab95ef923b9917a3c3599665ca7bbda7 (diff) |
Remove 'Filename' parameter from BeginSourceFileAction.
No-one was using this, and it's not meaningful in general -- FrontendActions
can be run on inputs that don't have a corresponding source file. The current
frontend input can be obtained by asking the FrontendAction if any future
action actually needs it.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@305045 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests')
-rw-r--r-- | unittests/Frontend/FrontendActionTest.cpp | 5 | ||||
-rw-r--r-- | unittests/Tooling/CommentHandlerTest.cpp | 3 | ||||
-rw-r--r-- | unittests/Tooling/ToolingTest.cpp | 2 |
3 files changed, 4 insertions, 6 deletions
diff --git a/unittests/Frontend/FrontendActionTest.cpp b/unittests/Frontend/FrontendActionTest.cpp index 68181c705c..ce0144538d 100644 --- a/unittests/Frontend/FrontendActionTest.cpp +++ b/unittests/Frontend/FrontendActionTest.cpp @@ -37,12 +37,11 @@ public: bool ActOnEndOfTranslationUnit; std::vector<std::string> decl_names; - bool BeginSourceFileAction(CompilerInstance &ci, - StringRef filename) override { + bool BeginSourceFileAction(CompilerInstance &ci) override { if (EnableIncrementalProcessing) ci.getPreprocessor().enableIncrementalProcessing(); - return ASTFrontendAction::BeginSourceFileAction(ci, filename); + return ASTFrontendAction::BeginSourceFileAction(ci); } std::unique_ptr<ASTConsumer> CreateASTConsumer(CompilerInstance &CI, diff --git a/unittests/Tooling/CommentHandlerTest.cpp b/unittests/Tooling/CommentHandlerTest.cpp index b42b28b9c9..9c3abdc4b1 100644 --- a/unittests/Tooling/CommentHandlerTest.cpp +++ b/unittests/Tooling/CommentHandlerTest.cpp @@ -70,8 +70,7 @@ private: CommentHandlerAction(CommentHandlerVisitor *Visitor) : TestAction(Visitor) { } - bool BeginSourceFileAction(CompilerInstance &CI, - StringRef FileName) override { + bool BeginSourceFileAction(CompilerInstance &CI) override { CommentHandlerVisitor *V = static_cast<CommentHandlerVisitor*>(this->Visitor); V->PP = &CI.getPreprocessor(); diff --git a/unittests/Tooling/ToolingTest.cpp b/unittests/Tooling/ToolingTest.cpp index 68b5ed2105..b179f033d3 100644 --- a/unittests/Tooling/ToolingTest.cpp +++ b/unittests/Tooling/ToolingTest.cpp @@ -203,7 +203,7 @@ TEST(ToolInvocation, TestVirtualModulesCompilation) { struct VerifyEndCallback : public SourceFileCallbacks { VerifyEndCallback() : BeginCalled(0), EndCalled(0), Matched(false) {} - bool handleBeginSource(CompilerInstance &CI, StringRef Filename) override { + bool handleBeginSource(CompilerInstance &CI) override { ++BeginCalled; return true; } |