blob: c60b5e583cafa4d91d92a652cbd9526b0243beeb [file] [log] [blame]
Haojian Wu357ef992016-09-21 13:18:19 +00001//===-- ClangMove.cpp - Implement ClangMove functationalities ---*- C++ -*-===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9
10#include "ClangMove.h"
11#include "clang/ASTMatchers/ASTMatchers.h"
12#include "clang/Basic/SourceManager.h"
13#include "clang/Format/Format.h"
14#include "clang/Frontend/CompilerInstance.h"
15#include "clang/Lex/Lexer.h"
16#include "clang/Lex/Preprocessor.h"
17#include "clang/Rewrite/Core/Rewriter.h"
18#include "clang/Tooling/Core/Replacement.h"
Haojian Wud2a6d7b2016-10-04 09:05:31 +000019#include "llvm/Support/Path.h"
Haojian Wu357ef992016-09-21 13:18:19 +000020
21using namespace clang::ast_matchers;
22
23namespace clang {
24namespace move {
25namespace {
26
Haojian Wud2a6d7b2016-10-04 09:05:31 +000027// Make the Path absolute using the CurrentDir if the Path is not an absolute
28// path. An empty Path will result in an empty string.
29std::string MakeAbsolutePath(StringRef CurrentDir, StringRef Path) {
30 if (Path.empty())
31 return "";
32 llvm::SmallString<128> InitialDirectory(CurrentDir);
33 llvm::SmallString<128> AbsolutePath(Path);
34 if (std::error_code EC =
35 llvm::sys::fs::make_absolute(InitialDirectory, AbsolutePath))
36 llvm::errs() << "Warning: could not make absolute file: '" << EC.message()
37 << '\n';
38 llvm::sys::path::remove_dots(AbsolutePath, /*remove_dot_dot=*/true);
Haojian Wuc6f125e2016-10-04 09:49:20 +000039 llvm::sys::path::native(AbsolutePath);
Haojian Wud2a6d7b2016-10-04 09:05:31 +000040 return AbsolutePath.str();
41}
42
43// Make the Path absolute using the current working directory of the given
44// SourceManager if the Path is not an absolute path.
45//
46// The Path can be a path relative to the build directory, or retrieved from
47// the SourceManager.
48std::string MakeAbsolutePath(const SourceManager& SM, StringRef Path) {
49 llvm::SmallString<128> AbsolutePath(Path);
50 if (std::error_code EC =
51 SM.getFileManager().getVirtualFileSystem()->makeAbsolute(AbsolutePath))
52 llvm::errs() << "Warning: could not make absolute file: '" << EC.message()
53 << '\n';
54 llvm::sys::path::remove_dots(AbsolutePath, /*remove_dot_dot=*/true);
Haojian Wuc6f125e2016-10-04 09:49:20 +000055 llvm::sys::path::native(AbsolutePath);
Haojian Wud2a6d7b2016-10-04 09:05:31 +000056 return AbsolutePath.str();
57}
58
59// Matches AST nodes that are expanded within the given AbsoluteFilePath.
60AST_POLYMORPHIC_MATCHER_P(isExpansionInFile,
61 AST_POLYMORPHIC_SUPPORTED_TYPES(Decl, Stmt, TypeLoc),
62 std::string, AbsoluteFilePath) {
63 auto &SourceManager = Finder->getASTContext().getSourceManager();
64 auto ExpansionLoc = SourceManager.getExpansionLoc(Node.getLocStart());
65 if (ExpansionLoc.isInvalid())
66 return false;
67 auto FileEntry =
68 SourceManager.getFileEntryForID(SourceManager.getFileID(ExpansionLoc));
69 if (!FileEntry)
70 return false;
71 return MakeAbsolutePath(SourceManager, FileEntry->getName()) ==
72 AbsoluteFilePath;
73}
74
Haojian Wu357ef992016-09-21 13:18:19 +000075class FindAllIncludes : public clang::PPCallbacks {
76public:
77 explicit FindAllIncludes(SourceManager *SM, ClangMoveTool *const MoveTool)
78 : SM(*SM), MoveTool(MoveTool) {}
79
80 void InclusionDirective(clang::SourceLocation HashLoc,
81 const clang::Token & /*IncludeTok*/,
82 StringRef FileName, bool IsAngled,
83 clang::CharSourceRange /*FilenameRange*/,
84 const clang::FileEntry * /*File*/,
Haojian Wud2a6d7b2016-10-04 09:05:31 +000085 StringRef SearchPath, StringRef /*RelativePath*/,
Haojian Wu357ef992016-09-21 13:18:19 +000086 const clang::Module * /*Imported*/) override {
Haojian Wudaf4cb82016-09-23 13:28:38 +000087 if (const auto *FileEntry = SM.getFileEntryForID(SM.getFileID(HashLoc)))
Haojian Wud2a6d7b2016-10-04 09:05:31 +000088 MoveTool->addIncludes(FileName, IsAngled, SearchPath,
89 FileEntry->getName(), SM);
Haojian Wu357ef992016-09-21 13:18:19 +000090 }
91
92private:
93 const SourceManager &SM;
94 ClangMoveTool *const MoveTool;
95};
96
Haojian Wu9abbeaa2016-10-06 08:59:24 +000097// Expand to get the end location of the line where the EndLoc of the given
98// Decl.
99SourceLocation
100getLocForEndOfDecl(const clang::Decl *D, const SourceManager *SM,
101 const LangOptions &LangOpts = clang::LangOptions()) {
102 std::pair<FileID, unsigned> LocInfo = SM->getDecomposedLoc(D->getLocEnd());
103 // Try to load the file buffer.
104 bool InvalidTemp = false;
105 llvm::StringRef File = SM->getBufferData(LocInfo.first, &InvalidTemp);
106 if (InvalidTemp)
107 return SourceLocation();
108
109 const char *TokBegin = File.data() + LocInfo.second;
110 // Lex from the start of the given location.
111 Lexer Lex(SM->getLocForStartOfFile(LocInfo.first), LangOpts, File.begin(),
112 TokBegin, File.end());
113
114 llvm::SmallVector<char, 16> Line;
115 // FIXME: this is a bit hacky to get ReadToEndOfLine work.
116 Lex.setParsingPreprocessorDirective(true);
117 Lex.ReadToEndOfLine(&Line);
118 SourceLocation EndLoc = D->getLocEnd().getLocWithOffset(Line.size());
119 // If we already reach EOF, just return the EOF SourceLocation;
120 // otherwise, move 1 offset ahead to include the trailing newline character
121 // '\n'.
122 return SM->getLocForEndOfFile(LocInfo.first) == EndLoc
123 ? EndLoc
124 : EndLoc.getLocWithOffset(1);
125}
126
127// Get full range of a Decl including the comments associated with it.
128clang::CharSourceRange
129GetFullRange(const clang::SourceManager *SM, const clang::Decl *D,
130 const clang::LangOptions &options = clang::LangOptions()) {
131 clang::SourceRange Full = D->getSourceRange();
132 Full.setEnd(getLocForEndOfDecl(D, SM));
133 // Expand to comments that are associated with the Decl.
134 if (const auto* Comment =
135 D->getASTContext().getRawCommentForDeclNoCache(D)) {
136 if (SM->isBeforeInTranslationUnit(Full.getEnd(), Comment->getLocEnd()))
137 Full.setEnd(Comment->getLocEnd());
138 // FIXME: Don't delete a preceding comment, if there are no other entities
139 // it could refer to.
140 if (SM->isBeforeInTranslationUnit(Comment->getLocStart(),
141 Full.getBegin()))
142 Full.setBegin(Comment->getLocStart());
143 }
144
145 return clang::CharSourceRange::getCharRange(Full);
146}
147
148std::string getDeclarationSourceText(const clang::Decl *D,
149 const clang::SourceManager *SM) {
150 llvm::StringRef SourceText = clang::Lexer::getSourceText(
151 GetFullRange(SM, D), *SM, clang::LangOptions());
152 return SourceText.str();
153}
154
Haojian Wu357ef992016-09-21 13:18:19 +0000155clang::tooling::Replacement
156getReplacementInChangedCode(const clang::tooling::Replacements &Replacements,
157 const clang::tooling::Replacement &Replacement) {
158 unsigned Start = Replacements.getShiftedCodePosition(Replacement.getOffset());
159 unsigned End = Replacements.getShiftedCodePosition(Replacement.getOffset() +
160 Replacement.getLength());
161 return clang::tooling::Replacement(Replacement.getFilePath(), Start,
162 End - Start,
163 Replacement.getReplacementText());
164}
165
166void addOrMergeReplacement(const clang::tooling::Replacement &Replacement,
167 clang::tooling::Replacements *Replacements) {
168 auto Err = Replacements->add(Replacement);
169 if (Err) {
170 llvm::consumeError(std::move(Err));
171 auto Replace = getReplacementInChangedCode(*Replacements, Replacement);
172 *Replacements = Replacements->merge(clang::tooling::Replacements(Replace));
173 }
174}
175
Haojian Wud2a6d7b2016-10-04 09:05:31 +0000176bool isInHeaderFile(const clang::SourceManager &SM, const clang::Decl *D,
177 llvm::StringRef OriginalRunningDirectory,
178 llvm::StringRef OldHeader) {
179 if (OldHeader.empty())
Haojian Wu357ef992016-09-21 13:18:19 +0000180 return false;
181 auto ExpansionLoc = SM.getExpansionLoc(D->getLocStart());
182 if (ExpansionLoc.isInvalid())
183 return false;
184
Haojian Wud2a6d7b2016-10-04 09:05:31 +0000185 if (const auto *FE = SM.getFileEntryForID(SM.getFileID(ExpansionLoc))) {
186 return MakeAbsolutePath(SM, FE->getName()) ==
187 MakeAbsolutePath(OriginalRunningDirectory, OldHeader);
188 }
Haojian Wu357ef992016-09-21 13:18:19 +0000189
190 return false;
191}
192
193std::vector<std::string> GetNamespaces(const clang::Decl *D) {
194 std::vector<std::string> Namespaces;
195 for (const auto *Context = D->getDeclContext(); Context;
196 Context = Context->getParent()) {
197 if (llvm::isa<clang::TranslationUnitDecl>(Context) ||
198 llvm::isa<clang::LinkageSpecDecl>(Context))
199 break;
200
201 if (const auto *ND = llvm::dyn_cast<clang::NamespaceDecl>(Context))
202 Namespaces.push_back(ND->getName().str());
203 }
204 std::reverse(Namespaces.begin(), Namespaces.end());
205 return Namespaces;
206}
207
Haojian Wu357ef992016-09-21 13:18:19 +0000208clang::tooling::Replacements
209createInsertedReplacements(const std::vector<std::string> &Includes,
210 const std::vector<ClangMoveTool::MovedDecl> &Decls,
211 llvm::StringRef FileName) {
212 clang::tooling::Replacements InsertedReplacements;
213
214 // Add #Includes.
215 std::string AllIncludesString;
Haojian Wudaf4cb82016-09-23 13:28:38 +0000216 // FIXME: Add header guard.
Haojian Wu357ef992016-09-21 13:18:19 +0000217 for (const auto &Include : Includes)
218 AllIncludesString += Include;
Haojian Wu9abbeaa2016-10-06 08:59:24 +0000219
220 if (!AllIncludesString.empty()) {
221 clang::tooling::Replacement InsertInclude(FileName, 0, 0,
222 AllIncludesString + "\n");
223 addOrMergeReplacement(InsertInclude, &InsertedReplacements);
224 }
Haojian Wu357ef992016-09-21 13:18:19 +0000225
226 // Add moved class definition and its related declarations. All declarations
227 // in same namespace are grouped together.
228 std::vector<std::string> CurrentNamespaces;
229 for (const auto &MovedDecl : Decls) {
230 std::vector<std::string> DeclNamespaces = GetNamespaces(MovedDecl.Decl);
231 auto CurrentIt = CurrentNamespaces.begin();
232 auto DeclIt = DeclNamespaces.begin();
233 while (CurrentIt != CurrentNamespaces.end() &&
234 DeclIt != DeclNamespaces.end()) {
235 if (*CurrentIt != *DeclIt)
236 break;
237 ++CurrentIt;
238 ++DeclIt;
239 }
240 std::vector<std::string> NextNamespaces(CurrentNamespaces.begin(),
241 CurrentIt);
242 NextNamespaces.insert(NextNamespaces.end(), DeclIt, DeclNamespaces.end());
243 auto RemainingSize = CurrentNamespaces.end() - CurrentIt;
244 for (auto It = CurrentNamespaces.rbegin(); RemainingSize > 0;
245 --RemainingSize, ++It) {
246 assert(It < CurrentNamespaces.rend());
247 auto code = "} // namespace " + *It + "\n";
248 clang::tooling::Replacement InsertedReplacement(FileName, 0, 0, code);
249 addOrMergeReplacement(InsertedReplacement, &InsertedReplacements);
250 }
251 while (DeclIt != DeclNamespaces.end()) {
252 clang::tooling::Replacement InsertedReplacement(
253 FileName, 0, 0, "namespace " + *DeclIt + " {\n");
254 addOrMergeReplacement(InsertedReplacement, &InsertedReplacements);
255 ++DeclIt;
256 }
257
Haojian Wu357ef992016-09-21 13:18:19 +0000258 clang::tooling::Replacement InsertedReplacement(
259 FileName, 0, 0, getDeclarationSourceText(MovedDecl.Decl, MovedDecl.SM));
260 addOrMergeReplacement(InsertedReplacement, &InsertedReplacements);
261
262 CurrentNamespaces = std::move(NextNamespaces);
263 }
264 std::reverse(CurrentNamespaces.begin(), CurrentNamespaces.end());
265 for (const auto &NS : CurrentNamespaces) {
266 clang::tooling::Replacement InsertedReplacement(
267 FileName, 0, 0, "} // namespace " + NS + "\n");
268 addOrMergeReplacement(InsertedReplacement, &InsertedReplacements);
269 }
270 return InsertedReplacements;
271}
272
273} // namespace
274
275std::unique_ptr<clang::ASTConsumer>
276ClangMoveAction::CreateASTConsumer(clang::CompilerInstance &Compiler,
277 StringRef /*InFile*/) {
278 Compiler.getPreprocessor().addPPCallbacks(llvm::make_unique<FindAllIncludes>(
279 &Compiler.getSourceManager(), &MoveTool));
280 return MatchFinder.newASTConsumer();
281}
282
Haojian Wu357ef992016-09-21 13:18:19 +0000283ClangMoveTool::ClangMoveTool(
Haojian Wu253d5962016-10-06 08:29:32 +0000284 const MoveDefinitionSpec &MoveSpec,
285 std::map<std::string, tooling::Replacements> &FileToReplacements,
286 llvm::StringRef OriginalRunningDirectory, llvm::StringRef FallbackStyle)
287 : Spec(MoveSpec), FileToReplacements(FileToReplacements),
288 OriginalRunningDirectory(OriginalRunningDirectory),
289 FallbackStyle(FallbackStyle) {
Haojian Wu357ef992016-09-21 13:18:19 +0000290 Spec.Name = llvm::StringRef(Spec.Name).ltrim(':');
Haojian Wudaf4cb82016-09-23 13:28:38 +0000291 if (!Spec.NewHeader.empty())
292 CCIncludes.push_back("#include \"" + Spec.NewHeader + "\"\n");
Haojian Wu357ef992016-09-21 13:18:19 +0000293}
294
295void ClangMoveTool::registerMatchers(ast_matchers::MatchFinder *Finder) {
296 std::string FullyQualifiedName = "::" + Spec.Name;
Haojian Wud2a6d7b2016-10-04 09:05:31 +0000297 auto InOldHeader = isExpansionInFile(
298 MakeAbsolutePath(OriginalRunningDirectory, Spec.OldHeader));
299 auto InOldCC = isExpansionInFile(
300 MakeAbsolutePath(OriginalRunningDirectory, Spec.OldCC));
Haojian Wu357ef992016-09-21 13:18:19 +0000301 auto InOldFiles = anyOf(InOldHeader, InOldCC);
302 auto InMovedClass =
303 hasDeclContext(cxxRecordDecl(hasName(FullyQualifiedName)));
304
305 // Match moved class declarations.
306 auto MovedClass = cxxRecordDecl(
307 InOldFiles, hasName(FullyQualifiedName), isDefinition(),
308 hasDeclContext(anyOf(namespaceDecl(), translationUnitDecl())));
309 Finder->addMatcher(MovedClass.bind("moved_class"), this);
310
311 // Match moved class methods (static methods included) which are defined
312 // outside moved class declaration.
313 Finder->addMatcher(cxxMethodDecl(InOldFiles,
314 ofClass(hasName(FullyQualifiedName)),
315 isDefinition())
316 .bind("class_method"),
317 this);
318
319 // Match static member variable definition of the moved class.
320 Finder->addMatcher(varDecl(InMovedClass, InOldCC, isDefinition())
321 .bind("class_static_var_decl"),
322 this);
323
324 auto inAnonymousNamespace = hasParent(namespaceDecl(isAnonymous()));
325 // Match functions/variables definitions which are defined in anonymous
326 // namespace in old cc.
327 Finder->addMatcher(
328 namedDecl(anyOf(functionDecl(isDefinition()), varDecl(isDefinition())),
329 inAnonymousNamespace)
330 .bind("decls_in_anonymous_ns"),
331 this);
332
333 // Match static functions/variabale definitions in old cc.
334 Finder->addMatcher(
335 namedDecl(anyOf(functionDecl(isDefinition(), unless(InMovedClass),
Haojian Wuef247cb2016-09-27 08:01:04 +0000336 isStaticStorageClass(), InOldCC),
337 varDecl(isDefinition(), unless(InMovedClass),
338 isStaticStorageClass(), InOldCC)))
Haojian Wu357ef992016-09-21 13:18:19 +0000339 .bind("static_decls"),
340 this);
341
342 // Match forward declarations in old header.
343 Finder->addMatcher(
344 cxxRecordDecl(unless(anyOf(isImplicit(), isDefinition())), InOldHeader)
345 .bind("fwd_decl"),
346 this);
347}
348
349void ClangMoveTool::run(const ast_matchers::MatchFinder::MatchResult &Result) {
350 if (const auto *CMD =
351 Result.Nodes.getNodeAs<clang::CXXMethodDecl>("class_method")) {
352 // Skip inline class methods. isInline() ast matcher doesn't ignore this
353 // case.
354 if (!CMD->isInlined()) {
355 MovedDecls.emplace_back(CMD, &Result.Context->getSourceManager());
356 RemovedDecls.push_back(MovedDecls.back());
357 }
358 } else if (const auto *VD = Result.Nodes.getNodeAs<clang::VarDecl>(
359 "class_static_var_decl")) {
360 MovedDecls.emplace_back(VD, &Result.Context->getSourceManager());
361 RemovedDecls.push_back(MovedDecls.back());
362 } else if (const auto *class_decl =
363 Result.Nodes.getNodeAs<clang::CXXRecordDecl>("moved_class")) {
364 MovedDecls.emplace_back(class_decl, &Result.Context->getSourceManager());
365 RemovedDecls.push_back(MovedDecls.back());
366 } else if (const auto *FWD =
367 Result.Nodes.getNodeAs<clang::CXXRecordDecl>("fwd_decl")) {
368 // Skip all forwad declarations which appear after moved class declaration.
369 if (RemovedDecls.empty())
370 MovedDecls.emplace_back(FWD, &Result.Context->getSourceManager());
371 } else if (const auto *FD = Result.Nodes.getNodeAs<clang::NamedDecl>(
372 "decls_in_anonymous_ns")) {
373 MovedDecls.emplace_back(FD, &Result.Context->getSourceManager());
374 } else if (const auto *ND =
375 Result.Nodes.getNodeAs<clang::NamedDecl>("static_decls")) {
376 MovedDecls.emplace_back(ND, &Result.Context->getSourceManager());
377 }
378}
379
Haojian Wud2a6d7b2016-10-04 09:05:31 +0000380void ClangMoveTool::addIncludes(llvm::StringRef IncludeHeader,
381 bool IsAngled,
382 llvm::StringRef SearchPath,
383 llvm::StringRef FileName,
384 const SourceManager& SM) {
385 auto AbsoluteSearchPath = MakeAbsolutePath(SM, SearchPath);
Haojian Wudaf4cb82016-09-23 13:28:38 +0000386 // FIXME: Add old.h to the new.cc/h when the new target has dependencies on
387 // old.h/c. For instance, when moved class uses another class defined in
388 // old.h, the old.h should be added in new.h.
Haojian Wud2a6d7b2016-10-04 09:05:31 +0000389 if (MakeAbsolutePath(OriginalRunningDirectory, Spec.OldHeader) ==
390 MakeAbsolutePath(AbsoluteSearchPath, IncludeHeader))
Haojian Wudaf4cb82016-09-23 13:28:38 +0000391 return;
392
393 std::string IncludeLine =
394 IsAngled ? ("#include <" + IncludeHeader + ">\n").str()
395 : ("#include \"" + IncludeHeader + "\"\n").str();
Haojian Wud2a6d7b2016-10-04 09:05:31 +0000396
397 std::string AbsolutePath = MakeAbsolutePath(SM, FileName);
398 if (MakeAbsolutePath(OriginalRunningDirectory, Spec.OldHeader) ==
399 AbsolutePath) {
Haojian Wudaf4cb82016-09-23 13:28:38 +0000400 HeaderIncludes.push_back(IncludeLine);
Haojian Wud2a6d7b2016-10-04 09:05:31 +0000401 } else if (MakeAbsolutePath(OriginalRunningDirectory, Spec.OldCC) ==
402 AbsolutePath) {
Haojian Wudaf4cb82016-09-23 13:28:38 +0000403 CCIncludes.push_back(IncludeLine);
Haojian Wud2a6d7b2016-10-04 09:05:31 +0000404 }
Haojian Wu357ef992016-09-21 13:18:19 +0000405}
406
407void ClangMoveTool::removeClassDefinitionInOldFiles() {
408 for (const auto &MovedDecl : RemovedDecls) {
Haojian Wu253d5962016-10-06 08:29:32 +0000409 const auto &SM = *MovedDecl.SM;
Haojian Wu9abbeaa2016-10-06 08:59:24 +0000410 auto Range = GetFullRange(&SM, MovedDecl.Decl);
Haojian Wu357ef992016-09-21 13:18:19 +0000411 clang::tooling::Replacement RemoveReplacement(
Haojian Wu9abbeaa2016-10-06 08:59:24 +0000412 *MovedDecl.SM, clang::CharSourceRange::getCharRange(
413 Range.getBegin(), Range.getEnd()),
Haojian Wu357ef992016-09-21 13:18:19 +0000414 "");
415 std::string FilePath = RemoveReplacement.getFilePath().str();
416 addOrMergeReplacement(RemoveReplacement, &FileToReplacements[FilePath]);
Haojian Wu253d5962016-10-06 08:29:32 +0000417
418 llvm::StringRef Code =
419 SM.getBufferData(SM.getFileID(MovedDecl.Decl->getLocation()));
420 format::FormatStyle Style =
421 format::getStyle("file", FilePath, FallbackStyle);
422 auto CleanReplacements = format::cleanupAroundReplacements(
423 Code, FileToReplacements[FilePath], Style);
424
425 if (!CleanReplacements) {
426 llvm::errs() << llvm::toString(CleanReplacements.takeError()) << "\n";
427 continue;
428 }
429 FileToReplacements[FilePath] = *CleanReplacements;
Haojian Wu357ef992016-09-21 13:18:19 +0000430 }
431}
432
433void ClangMoveTool::moveClassDefinitionToNewFiles() {
434 std::vector<MovedDecl> NewHeaderDecls;
435 std::vector<MovedDecl> NewCCDecls;
436 for (const auto &MovedDecl : MovedDecls) {
Haojian Wud2a6d7b2016-10-04 09:05:31 +0000437 if (isInHeaderFile(*MovedDecl.SM, MovedDecl.Decl, OriginalRunningDirectory,
438 Spec.OldHeader))
Haojian Wu357ef992016-09-21 13:18:19 +0000439 NewHeaderDecls.push_back(MovedDecl);
440 else
441 NewCCDecls.push_back(MovedDecl);
442 }
443
444 if (!Spec.NewHeader.empty())
445 FileToReplacements[Spec.NewHeader] = createInsertedReplacements(
446 HeaderIncludes, NewHeaderDecls, Spec.NewHeader);
447 if (!Spec.NewCC.empty())
448 FileToReplacements[Spec.NewCC] =
449 createInsertedReplacements(CCIncludes, NewCCDecls, Spec.NewCC);
450}
451
452void ClangMoveTool::onEndOfTranslationUnit() {
453 if (RemovedDecls.empty())
454 return;
455 removeClassDefinitionInOldFiles();
456 moveClassDefinitionToNewFiles();
457}
458
459} // namespace move
460} // namespace clang