diff options
author | Bruno Cardoso Lopes <bruno.cardoso@gmail.com> | 2016-10-28 17:02:10 +0000 |
---|---|---|
committer | Bruno Cardoso Lopes <bruno.cardoso@gmail.com> | 2016-10-28 17:02:10 +0000 |
commit | f16070074e51513ed781e76eff6d334a7a6a132a (patch) | |
tree | ced3a539d1ca04a3d9dec9e3d60f7f3e6eefd4cf /clang/lib/Frontend/PrintPreprocessedOutput.cpp | |
parent | 82ff4e7e90f49d0e5844abde1b4a3450011a9c65 (diff) | |
download | bcm5719-llvm-f16070074e51513ed781e76eff6d334a7a6a132a.tar.gz bcm5719-llvm-f16070074e51513ed781e76eff6d334a7a6a132a.zip |
Revert "[Preprocessor] Support for '-dI' flag"
This reverts r285411. Tests failing on
http://lab.llvm.org:8011/builders/clang-x86-windows-msvc2015/builds/141
llvm-svn: 285416
Diffstat (limited to 'clang/lib/Frontend/PrintPreprocessedOutput.cpp')
-rw-r--r-- | clang/lib/Frontend/PrintPreprocessedOutput.cpp | 34 |
1 files changed, 8 insertions, 26 deletions
diff --git a/clang/lib/Frontend/PrintPreprocessedOutput.cpp b/clang/lib/Frontend/PrintPreprocessedOutput.cpp index d48b952ef20..77b80e612fb 100644 --- a/clang/lib/Frontend/PrintPreprocessedOutput.cpp +++ b/clang/lib/Frontend/PrintPreprocessedOutput.cpp @@ -93,16 +93,13 @@ private: bool Initialized; bool DisableLineMarkers; bool DumpDefines; - bool DumpIncludeDirectives; bool UseLineDirectives; bool IsFirstFileEntered; public: PrintPPOutputPPCallbacks(Preprocessor &pp, raw_ostream &os, bool lineMarkers, - bool defines, bool DumpIncludeDirectives, - bool UseLineDirectives) + bool defines, bool UseLineDirectives) : PP(pp), SM(PP.getSourceManager()), ConcatInfo(PP), OS(os), DisableLineMarkers(lineMarkers), DumpDefines(defines), - DumpIncludeDirectives(DumpIncludeDirectives), UseLineDirectives(UseLineDirectives) { CurLine = 0; CurFilename += "<uninit>"; @@ -323,10 +320,10 @@ void PrintPPOutputPPCallbacks::InclusionDirective(SourceLocation HashLoc, StringRef SearchPath, StringRef RelativePath, const Module *Imported) { + // When preprocessing, turn implicit imports into @imports. + // FIXME: This is a stop-gap until a more comprehensive "preprocessing with + // modules" solution is introduced. if (Imported) { - // When preprocessing, turn implicit imports into @imports. - // FIXME: This is a stop-gap until a more comprehensive "preprocessing with - // modules" solution is introduced. startNewLineIfNeeded(); MoveToLine(HashLoc); if (PP.getLangOpts().ObjC2) { @@ -334,9 +331,9 @@ void PrintPPOutputPPCallbacks::InclusionDirective(SourceLocation HashLoc, << " /* clang -E: implicit import for \"" << File->getName() << "\" */"; } else { - const std::string TokenText = PP.getSpelling(IncludeTok); - assert(!TokenText.empty()); - OS << "#" << TokenText << " " + // FIXME: Preseve whether this was a + // #include/#include_next/#include_macros/#import. + OS << "#include " << (IsAngled ? '<' : '"') << FileName << (IsAngled ? '>' : '"') @@ -347,20 +344,6 @@ void PrintPPOutputPPCallbacks::InclusionDirective(SourceLocation HashLoc, // line immediately. EmittedTokensOnThisLine = true; startNewLineIfNeeded(); - } else { - // Not a module import; it's a more vanilla inclusion of some file using one - // of: #include, #import, #include_next, #include_macros. - if (DumpIncludeDirectives) { - startNewLineIfNeeded(); - MoveToLine(HashLoc); - const std::string TokenText = PP.getSpelling(IncludeTok); - assert(!TokenText.empty()); - OS << "#" << TokenText << " " - << (IsAngled ? '<' : '"') << FileName << (IsAngled ? '>' : '"') - << " /* clang -E -dI */"; - setEmittedDirectiveOnThisLine(); - startNewLineIfNeeded(); - } } } @@ -768,8 +751,7 @@ void clang::DoPrintPreprocessedInput(Preprocessor &PP, raw_ostream *OS, PP.SetCommentRetentionState(Opts.ShowComments, Opts.ShowMacroComments); PrintPPOutputPPCallbacks *Callbacks = new PrintPPOutputPPCallbacks( - PP, *OS, !Opts.ShowLineMarkers, Opts.ShowMacros, - Opts.ShowIncludeDirectives, Opts.UseLineDirectives); + PP, *OS, !Opts.ShowLineMarkers, Opts.ShowMacros, Opts.UseLineDirectives); // Expand macros in pragmas with -fms-extensions. The assumption is that // the majority of pragmas in such a file will be Microsoft pragmas. |