@@ -66,14 +66,7 @@ class ExtReplacements {
6666 // Check if the Repl is same as source code
6767 bool isReplRedundant (std::shared_ptr<ExtReplacement> Repl,
6868 std::shared_ptr<DpctFileInfo> FileInfo);
69- inline bool checkLiveness (std::shared_ptr<ExtReplacement> Repl) {
70- if (isAlive (Repl))
71- // If a replacement in the same pair is alive, merge it anyway.
72- return true ;
73- // Check if it is duplicate replacement.
74- return !isDuplicated (Repl, ReplMap.lower_bound (Repl->getOffset ()),
75- ReplMap.upper_bound (Repl->getOffset ()));
76- }
69+ bool checkLiveness (std::shared_ptr<ExtReplacement> Repl);
7770
7871 bool isDuplicated (std::shared_ptr<ExtReplacement> Repl, ReplIterator Begin,
7972 ReplIterator End);
@@ -136,25 +129,15 @@ class ExtReplacements {
136129 size_t findCR (StringRef Line);
137130
138131 // Mark a replacement as dead.
139- void markAsDead (std::shared_ptr<ExtReplacement> Repl) {
140- if (auto PairID = Repl->getPairID ())
141- PairReplsMap[PairID] =
142- std::make_shared<PairReplsStatus>(Repl, PairReplsStatus::Dead);
143- }
132+ void markAsDead (std::shared_ptr<ExtReplacement> Repl);
144133
145134 // Mark a replacement as alive and insert into ReplMap
146135 // If it is not the first encountered replacement and the first one is
147136 // dead, insert the first one into ReplMap, too.
148137 void markAsAlive (std::shared_ptr<ExtReplacement> Repl);
149138
150139 // Check if its pair has a replacement inserted.
151- bool isAlive (std::shared_ptr<ExtReplacement> Repl) {
152- if (auto PairID = Repl->getPairID ()) {
153- if (auto &R = PairReplsMap[PairID])
154- return R->Status == PairReplsStatus::Alive;
155- }
156- return false ;
157- }
140+ bool isAlive (std::shared_ptr<ExtReplacement> Repl);
158141
159142 clang::tooling::UnifiedPath FilePath;
160143 // /< Offset, ExtReplacement>
0 commit comments