summaryrefslogtreecommitdiff
path: root/clang-tools-extra/tool-template
diff options
context:
space:
mode:
authorEric Liu <ioeric@google.com>2016-08-01 10:16:39 +0000
committerEric Liu <ioeric@google.com>2016-08-01 10:16:39 +0000
commit267034ca9c6a4987efe83fbd24a1dbb2cd2bbbe4 (patch)
treee916dba031f40103de8169853e4468126edd576c /clang-tools-extra/tool-template
parent40ef2fb363bcd89cb4a88157f5fa97a38d795a1f (diff)
downloadllvm-267034ca9c6a4987efe83fbd24a1dbb2cd2bbbe4.tar.gz
Changes related to new implementation of tooling::Replacements as class.
Summary: See http://reviews.llvm.org/D21748 for details. Reviewers: djasper, klimek Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D21749 llvm-svn: 277336
Diffstat (limited to 'clang-tools-extra/tool-template')
-rw-r--r--clang-tools-extra/tool-template/ToolTemplate.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/clang-tools-extra/tool-template/ToolTemplate.cpp b/clang-tools-extra/tool-template/ToolTemplate.cpp
index 020f1fd67eb3..54b4a696df98 100644
--- a/clang-tools-extra/tool-template/ToolTemplate.cpp
+++ b/clang-tools-extra/tool-template/ToolTemplate.cpp
@@ -53,18 +53,20 @@ using namespace llvm;
namespace {
class ToolTemplateCallback : public MatchFinder::MatchCallback {
- public:
- ToolTemplateCallback(Replacements *Replace) : Replace(Replace) {}
+public:
+ ToolTemplateCallback(std::map<std::string, Replacements> *Replace)
+ : Replace(Replace) {}
void run(const MatchFinder::MatchResult &Result) override {
- // TODO: This routine will get called for each thing that the matchers find.
+ // TODO: This routine will get called for each thing that the matchers
+ // find.
// At this point, you can examine the match, and do whatever you want,
// including replacing the matched text with other text
(void)Replace; // This to prevent an "unused member variable" warning;
}
- private:
- Replacements *Replace;
+private:
+ std::map<std::string, Replacements> *Replace;
};
} // end anonymous namespace