diff options
-rw-r--r-- | clang-tools-extra/modularize/Modularize.cpp | 15 | ||||
-rw-r--r-- | clang-tools-extra/modularize/PreprocessorTracker.cpp | 19 |
2 files changed, 15 insertions, 19 deletions
diff --git a/clang-tools-extra/modularize/Modularize.cpp b/clang-tools-extra/modularize/Modularize.cpp index 902476ddaad..8b68e488ab7 100644 --- a/clang-tools-extra/modularize/Modularize.cpp +++ b/clang-tools-extra/modularize/Modularize.cpp @@ -71,7 +71,7 @@ // Macro defined here. // // See PreprocessorTracker.cpp for additional details. -//
+// // Future directions: // // Basically, we want to add new checks for whatever we can check with respect @@ -403,9 +403,8 @@ public: isa<NamespaceAliasDecl>(ND) || isa<ClassTemplateSpecializationDecl>(ND) || isa<UsingDecl>(ND) || isa<ClassTemplateDecl>(ND) || isa<TemplateTypeParmDecl>(ND) || - isa<TypeAliasTemplateDecl>(ND) || - isa<UsingShadowDecl>(ND) || isa<FunctionDecl>(ND) || - isa<FunctionTemplateDecl>(ND) || + isa<TypeAliasTemplateDecl>(ND) || isa<UsingShadowDecl>(ND) || + isa<FunctionDecl>(ND) || isa<FunctionTemplateDecl>(ND) || (isa<TagDecl>(ND) && !cast<TagDecl>(ND)->isThisDeclarationADefinition())) return true; @@ -415,10 +414,10 @@ public: return true; // Get the qualified name. - std::string Name;
- llvm::raw_string_ostream OS(Name);
- ND->printQualifiedName(OS);
- OS.flush();
+ std::string Name; + llvm::raw_string_ostream OS(Name); + ND->printQualifiedName(OS); + OS.flush(); if (Name.empty()) return true; diff --git a/clang-tools-extra/modularize/PreprocessorTracker.cpp b/clang-tools-extra/modularize/PreprocessorTracker.cpp index 5776a6152af..c0f20043479 100644 --- a/clang-tools-extra/modularize/PreprocessorTracker.cpp +++ b/clang-tools-extra/modularize/PreprocessorTracker.cpp @@ -76,7 +76,7 @@ // the expanded macro value, a PPItemKey representing the file/line/column // where the macro was defined, a handle to a string representing the source // line containing the macro definition, and a vector of InclusionPathHandle -// values that represents the hierarchies of include files for each case +// values that represents the hierarchies of include files for each case // where the particular header containing the macro reference was referenced // or included. @@ -189,7 +189,7 @@ // has two ConditionalExpansionInstance objects, it means there was a // conflict, meaning the conditional expression evaluated differently in // one or more cases. -// +// // After modularize has performed all the compilations, it enters a phase // of error reporting. This new feature adds to this reporting phase calls // to the PreprocessorTracker's reportInconsistentMacros and @@ -1023,8 +1023,7 @@ public: getSourceLine(PP, InstanceLoc) + "\n"; ConditionalExpansions[InstanceKey] = ConditionalTracker(DirectiveKind, ConditionValue, - ConditionUnexpandedHandle, - InclusionPathHandle); + ConditionUnexpandedHandle, InclusionPathHandle); } else { // We've seen the conditional before. Get its tracker. ConditionalTracker &CondTracker = I->second; @@ -1202,14 +1201,12 @@ void PreprocessorCallbacks::FileChanged( case EnterFile: PPTracker.handleHeaderEntry(PP, getSourceLocationFile(PP, Loc)); break; - case ExitFile: - { - const clang::FileEntry *F = + case ExitFile: { + const clang::FileEntry *F = PP.getSourceManager().getFileEntryForID(PrevFID); - if (F != NULL) - PPTracker.handleHeaderExit(F->getName()); - } - break; + if (F != NULL) + PPTracker.handleHeaderExit(F->getName()); + } break; case SystemHeaderPragma: case RenameFile: break; |