<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div>Hi Nico,</div><div><br class=""></div><div>I think we’re talking about different problems and usage models. The BUILD_SHARED_LIBS option solves three problems: 1) ensure that the internal libraries of llvm/clang are cycle free, 2) ensure that the internal library dependencies are up to date, and 3) help save disk space for certain platforms. As for the performance, I just did a clean “ninja check-all” release+assert build of llvm, clang, and lld. The cost of BUILD_SHARED_LIBS was 7%, not ~35%.</div><div><br class=""></div><div>In any case, the cycle free goal is clearly important. So are the up to date dependencies. That’s why the build bots test the BUILD_SHARED_LIBS scenario. The fact that it isn’t the default for active developers is unfortunate and a regular source of regressions.</div><div><br class=""></div><div>Personally speaking, assert builds strongly imply active development, and therefore assert builds should set  BUILD_SHARED_LIBS to true. On the flip side, if someone is not actively developing llvm/clang *but* they are using assert builds *and* they want the assert build to be “fast”, then that implies a specialized scenario and the burden of disabling BUILD_SHARED_LIBS should fall on this custom usage scenario.</div><div><br class=""></div><div>Dave</div><div><br class=""><blockquote type="cite" class=""><div class="">On Jun 4, 2018, at 2:15 PM, Nico Weber <<a href="mailto:thakis@chromium.org" class="">thakis@chromium.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">(Cost as in "shared library buildsof clang are ~35% slower than regular clang" last we checked.)</div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Mon, Jun 4, 2018 at 2:14 PM, Nico Weber <span dir="ltr" class=""><<a href="mailto:thakis@chromium.org" target="_blank" class="">thakis@chromium.org</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="">Sure, the bots could do that, the more general point was that many (probably most) people who want to enable asserts don't want to use shared libs. I believe that only a few people use that config, so turning things around why should everyone building with asserts have to pay the cost of supporting the shared build config?</div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br class=""><div class="gmail_quote">On Mon, Jun 4, 2018 at 12:51 PM, David Zarzycki <span dir="ltr" class=""><<a href="mailto:dave@znu.io" target="_blank" class="">dave@znu.io</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Roman – I agree that people shouldn’t need to manually fix this every time it happens.<br class="">
<br class="">
Hi Nico – What is stopping the Chromium buildbots from setting BUILD_SHARED_LIBS to false? That way the default BUILD_SHARED_LIBS policy of llvm and/or clang doesn’t matter, right?<br class="">
<br class="">
Dave<br class="">
<div class="m_6327405296854549612HOEnZb"><div class="m_6327405296854549612h5"><br class="">
<br class="">
> On Jun 4, 2018, at 12:40 PM, Roman Lebedev <<a href="mailto:lebedev.ri@gmail.com" target="_blank" class="">lebedev.ri@gmail.com</a>> wrote:<br class="">
> <br class="">
> This is n-th time i do this kind of fix.<br class="">
> Sure this does resolve the issue, but it would be much better to use<br class="">
> proper means,<br class="">
> and tell people to fix their code, in an automatic way :)<br class="">
> <br class="">
> On Mon, Jun 4, 2018 at 7:36 PM, Nico Weber <<a href="mailto:thakis@chromium.org" target="_blank" class="">thakis@chromium.org</a>> wrote:<br class="">
>> All chromium bots build with asserts on and we definitely don't want shared<br class="">
>> libs :-) Having the people who care about this build config make sure it<br class="">
>> keeps working seems like a good approach to me.<br class="">
>> <br class="">
>> On Mon, Jun 4, 2018 at 8:15 AM, David Zarzycki via cfe-commits<br class="">
>> <<a href="mailto:cfe-commits@lists.llvm.org" target="_blank" class="">cfe-commits@lists.llvm.org</a>> wrote:<br class="">
>>> <br class="">
>>> What’s stopping the project from automatically setting BUILD_SHARED_LIBS<br class="">
>>> to TRUE if asserts are enabled? That’d automatically “force” active<br class="">
>>> developers to test the scenario on their local machines, but not change the<br class="">
>>> way release builds work.<br class="">
>>> <br class="">
>>> <br class="">
>>>> On Jun 4, 2018, at 8:11 AM, Roman Lebedev via cfe-commits<br class="">
>>>> <<a href="mailto:cfe-commits@lists.llvm.org" target="_blank" class="">cfe-commits@lists.llvm.org</a>> wrote:<br class="">
>>>> <br class="">
>>>> This broke building as shared libraries.<br class="">
>>>> <br class="">
>>>> I've committed the fix, but the bot coverage is clearly severely<br class="">
>>>> missing,<br class="">
>>>> given that such breakages are very often.<br class="">
>>>> <br class="">
>>>> Roman.<br class="">
>>>> <br class="">
>>>> On Mon, Jun 4, 2018 at 12:04 PM, Eric Liu via cfe-commits<br class="">
>>>> <<a href="mailto:cfe-commits@lists.llvm.org" target="_blank" class="">cfe-commits@lists.llvm.org</a>> wrote:<br class="">
>>>>> Author: ioeric<br class="">
>>>>> Date: Mon Jun  4 02:04:12 2018<br class="">
>>>>> New Revision: 333874<br class="">
>>>>> <br class="">
>>>>> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=333874&view=rev" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-pr<wbr class="">oject?rev=333874&view=rev</a><br class="">
>>>>> Log:<br class="">
>>>>> Reland "Move #include manipulation code to new lib/Tooling/Inclusions."<br class="">
>>>>> <br class="">
>>>>> This reverts commit r333534 (i.e. reland r332720) after fixing module<br class="">
>>>>> build.<br class="">
>>>>> <br class="">
>>>>> Differential Revision: <a href="https://reviews.llvm.org/D47068" rel="noreferrer" target="_blank" class="">https://reviews.llvm.org/D4706<wbr class="">8</a><br class="">
>>>>> <br class="">
>>>>> Added:<br class="">
>>>>>   cfe/trunk/include/clang/Tooli<wbr class="">ng/Inclusions/HeaderIncludes.h<br class="">
>>>>>     - copied, changed from r333865,<br class="">
>>>>> cfe/trunk/include/clang/Toolin<wbr class="">g/Core/HeaderIncludes.h<br class="">
>>>>>   cfe/trunk/include/clang/Tooli<wbr class="">ng/Inclusions/IncludeStyle.h<br class="">
>>>>>     - copied, changed from r333865,<br class="">
>>>>> cfe/trunk/include/clang/Toolin<wbr class="">g/Core/IncludeStyle.h<br class="">
>>>>>   cfe/trunk/lib/Tooling/Inclusi<wbr class="">ons/CMakeLists.txt<br class="">
>>>>>     - copied, changed from r333865,<br class="">
>>>>> cfe/trunk/lib/Tooling/Core/CMa<wbr class="">keLists.txt<br class="">
>>>>>   cfe/trunk/lib/Tooling/Inclusi<wbr class="">ons/HeaderIncludes.cpp<br class="">
>>>>>     - copied, changed from r333865,<br class="">
>>>>> cfe/trunk/lib/Tooling/Core/Hea<wbr class="">derIncludes.cpp<br class="">
>>>>>   cfe/trunk/lib/Tooling/Inclusi<wbr class="">ons/IncludeStyle.cpp<br class="">
>>>>>     - copied, changed from r333865,<br class="">
>>>>> cfe/trunk/lib/Tooling/Core/Inc<wbr class="">ludeStyle.cpp<br class="">
>>>>> Removed:<br class="">
>>>>>   cfe/trunk/include/clang/Tooli<wbr class="">ng/Core/HeaderIncludes.h<br class="">
>>>>>   cfe/trunk/include/clang/Tooli<wbr class="">ng/Core/IncludeStyle.h<br class="">
>>>>>   cfe/trunk/lib/Tooling/Core/He<wbr class="">aderIncludes.cpp<br class="">
>>>>>   cfe/trunk/lib/Tooling/Core/In<wbr class="">cludeStyle.cpp<br class="">
>>>>> Modified:<br class="">
>>>>>   cfe/trunk/include/clang/Forma<wbr class="">t/Format.h<br class="">
>>>>>   cfe/trunk/include/clang/modul<wbr class="">e.modulemap<br class="">
>>>>>   cfe/trunk/lib/Format/CMakeLis<wbr class="">ts.txt<br class="">
>>>>>   cfe/trunk/lib/Format/Format.c<wbr class="">pp<br class="">
>>>>>   cfe/trunk/lib/Tooling/CMakeLi<wbr class="">sts.txt<br class="">
>>>>>   cfe/trunk/lib/Tooling/Core/CM<wbr class="">akeLists.txt<br class="">
>>>>>   cfe/trunk/unittests/Tooling/H<wbr class="">eaderIncludesTest.cpp<br class="">
>>>>> <br class="">
>>>>> Modified: cfe/trunk/include/clang/Format<wbr class="">/Format.h<br class="">
>>>>> URL:<br class="">
>>>>> <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Format/Format.h?rev=333874&r1=333873&r2=333874&view=diff" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-pr<wbr class="">oject/cfe/trunk/include/clang/<wbr class="">Format/Format.h?rev=333874&r1=<wbr class="">333873&r2=333874&view=diff</a><br class="">
>>>>> <br class="">
>>>>> ==============================<wbr class="">==============================<wbr class="">==================<br class="">
>>>>> --- cfe/trunk/include/clang/Format<wbr class="">/Format.h (original)<br class="">
>>>>> +++ cfe/trunk/include/clang/Format<wbr class="">/Format.h Mon Jun  4 02:04:12 2018<br class="">
>>>>> @@ -16,8 +16,8 @@<br class="">
>>>>> #define LLVM_CLANG_FORMAT_FORMAT_H<br class="">
>>>>> <br class="">
>>>>> #include "clang/Basic/LangOptions.h"<br class="">
>>>>> -#include "clang/Tooling/Core/IncludeSty<wbr class="">le.h"<br class="">
>>>>> #include "clang/Tooling/Core/Replacemen<wbr class="">t.h"<br class="">
>>>>> +#include "clang/Tooling/Inclusions/Incl<wbr class="">udeStyle.h"<br class="">
>>>>> #include "llvm/ADT/ArrayRef.h"<br class="">
>>>>> #include "llvm/Support/Regex.h"<br class="">
>>>>> #include <system_error><br class="">
>>>>> <br class="">
>>>>> Removed: cfe/trunk/include/clang/Toolin<wbr class="">g/Core/HeaderIncludes.h<br class="">
>>>>> URL:<br class="">
>>>>> <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Tooling/Core/HeaderIncludes.h?rev=333873&view=auto" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-pr<wbr class="">oject/cfe/trunk/include/clang/<wbr class="">Tooling/Core/HeaderIncludes.h?<wbr class="">rev=333873&view=auto</a><br class="">
>>>>> <br class="">
>>>>> ==============================<wbr class="">==============================<wbr class="">==================<br class="">
>>>>> --- cfe/trunk/include/clang/Toolin<wbr class="">g/Core/HeaderIncludes.h (original)<br class="">
>>>>> +++ cfe/trunk/include/clang/Toolin<wbr class="">g/Core/HeaderIncludes.h (removed)<br class="">
>>>>> @@ -1,137 +0,0 @@<br class="">
>>>>> -//===--- HeaderIncludes.h - Insert/Delete #includes for C++ code--*-<br class="">
>>>>> C++-*-===//<br class="">
>>>>> -//<br class="">
>>>>> -//                     The LLVM Compiler Infrastructure<br class="">
>>>>> -//<br class="">
>>>>> -// This file is distributed under the University of Illinois Open<br class="">
>>>>> Source<br class="">
>>>>> -// License. See LICENSE.TXT for details.<br class="">
>>>>> -//<br class="">
>>>>> <br class="">
>>>>> -//===------------------------<wbr class="">------------------------------<wbr class="">----------------===//<br class="">
>>>>> -<br class="">
>>>>> -#ifndef LLVM_CLANG_TOOLING_CORE_HEADER<wbr class="">INCLUDES_H<br class="">
>>>>> -#define LLVM_CLANG_TOOLING_CORE_HEADER<wbr class="">INCLUDES_H<br class="">
>>>>> -<br class="">
>>>>> -#include "clang/Basic/SourceManager.h"<br class="">
>>>>> -#include "clang/Tooling/Core/Replacemen<wbr class="">t.h"<br class="">
>>>>> -#include "clang/Tooling/Core/IncludeSty<wbr class="">le.h"<br class="">
>>>>> -#include "llvm/Support/Path.h"<br class="">
>>>>> -#include "llvm/Support/Regex.h"<br class="">
>>>>> -#include <unordered_map><br class="">
>>>>> -<br class="">
>>>>> -namespace clang {<br class="">
>>>>> -namespace tooling {<br class="">
>>>>> -<br class="">
>>>>> -/// This class manages priorities of C++ #include categories and<br class="">
>>>>> calculates<br class="">
>>>>> -/// priorities for headers.<br class="">
>>>>> -/// FIXME(ioeric): move this class into implementation file when<br class="">
>>>>> clang-format's<br class="">
>>>>> -/// include sorting functions are also moved here.<br class="">
>>>>> -class IncludeCategoryManager {<br class="">
>>>>> -public:<br class="">
>>>>> -  IncludeCategoryManager(const IncludeStyle &Style, StringRef<br class="">
>>>>> FileName);<br class="">
>>>>> -<br class="">
>>>>> -  /// Returns the priority of the category which \p IncludeName<br class="">
>>>>> belongs to.<br class="">
>>>>> -  /// If \p CheckMainHeader is true and \p IncludeName is a main<br class="">
>>>>> header, returns<br class="">
>>>>> -  /// 0. Otherwise, returns the priority of the matching category or<br class="">
>>>>> INT_MAX.<br class="">
>>>>> -  /// NOTE: this API is not thread-safe!<br class="">
>>>>> -  int getIncludePriority(StringRef IncludeName, bool CheckMainHeader)<br class="">
>>>>> const;<br class="">
>>>>> -<br class="">
>>>>> -private:<br class="">
>>>>> -  bool isMainHeader(StringRef IncludeName) const;<br class="">
>>>>> -<br class="">
>>>>> -  const IncludeStyle Style;<br class="">
>>>>> -  bool IsMainFile;<br class="">
>>>>> -  std::string FileName;<br class="">
>>>>> -  // This refers to a substring in FileName.<br class="">
>>>>> -  StringRef FileStem;<br class="">
>>>>> -  // Regex is not thread-safe.<br class="">
>>>>> -  mutable SmallVector<llvm::Regex, 4> CategoryRegexs;<br class="">
>>>>> -};<br class="">
>>>>> -<br class="">
>>>>> -/// Generates replacements for inserting or deleting #include<br class="">
>>>>> directives in a<br class="">
>>>>> -/// file.<br class="">
>>>>> -class HeaderIncludes {<br class="">
>>>>> -public:<br class="">
>>>>> -  HeaderIncludes(llvm::StringRef FileName, llvm::StringRef Code,<br class="">
>>>>> -                 const IncludeStyle &Style);<br class="">
>>>>> -<br class="">
>>>>> -  /// Inserts an #include directive of \p Header into the code. If \p<br class="">
>>>>> IsAngled<br class="">
>>>>> -  /// is true, \p Header will be quoted with <> in the directive;<br class="">
>>>>> otherwise, it<br class="">
>>>>> -  /// will be quoted with "".<br class="">
>>>>> -  ///<br class="">
>>>>> -  /// When searching for points to insert new header, this ignores<br class="">
>>>>> #include's<br class="">
>>>>> -  /// after the #include block(s) in the beginning of a file to avoid<br class="">
>>>>> inserting<br class="">
>>>>> -  /// headers into code sections where new #include's should not be<br class="">
>>>>> added by<br class="">
>>>>> -  /// default. These code sections include:<br class="">
>>>>> -  ///   - raw string literals (containing #include).<br class="">
>>>>> -  ///   - #if blocks.<br class="">
>>>>> -  ///   - Special #include's among declarations (e.g. functions).<br class="">
>>>>> -  ///<br class="">
>>>>> -  /// Returns a replacement that inserts the new header into a<br class="">
>>>>> suitable #include<br class="">
>>>>> -  /// block of the same category. This respects the order of the<br class="">
>>>>> existing<br class="">
>>>>> -  /// #includes in the block; if the existing #includes are not<br class="">
>>>>> already sorted,<br class="">
>>>>> -  /// this will simply insert the #include in front of the first<br class="">
>>>>> #include of the<br class="">
>>>>> -  /// same category in the code that should be sorted after \p<br class="">
>>>>> IncludeName. If<br class="">
>>>>> -  /// \p IncludeName already exists (with exactly the same spelling),<br class="">
>>>>> this<br class="">
>>>>> -  /// returns None.<br class="">
>>>>> -  llvm::Optional<tooling::Replac<wbr class="">ement> insert(llvm::StringRef Header,<br class="">
>>>>> -                                              bool IsAngled) const;<br class="">
>>>>> -<br class="">
>>>>> -  /// Removes all existing #includes of \p Header quoted with <> if \p<br class="">
>>>>> IsAngled<br class="">
>>>>> -  /// is true or "" if \p IsAngled is false.<br class="">
>>>>> -  /// This doesn't resolve the header file path; it only deletes<br class="">
>>>>> #includes with<br class="">
>>>>> -  /// exactly the same spelling.<br class="">
>>>>> -  tooling::Replacements remove(llvm::StringRef Header, bool IsAngled)<br class="">
>>>>> const;<br class="">
>>>>> -<br class="">
>>>>> -private:<br class="">
>>>>> -  struct Include {<br class="">
>>>>> -    Include(StringRef Name, tooling::Range R) : Name(Name), R(R) {}<br class="">
>>>>> -<br class="">
>>>>> -    // An include header quoted with either <> or "".<br class="">
>>>>> -    std::string Name;<br class="">
>>>>> -    // The range of the whole line of include directive including any<br class="">
>>>>> eading<br class="">
>>>>> -    // whitespaces and trailing comment.<br class="">
>>>>> -    tooling::Range R;<br class="">
>>>>> -  };<br class="">
>>>>> -<br class="">
>>>>> -  void addExistingInclude(Include IncludeToAdd, unsigned<br class="">
>>>>> NextLineOffset);<br class="">
>>>>> -<br class="">
>>>>> -  std::string FileName;<br class="">
>>>>> -  std::string Code;<br class="">
>>>>> -<br class="">
>>>>> -  // Map from include name (quotation trimmed) to a list of existing<br class="">
>>>>> includes<br class="">
>>>>> -  // (in case there are more than one) with the name in the current<br class="">
>>>>> file. <x><br class="">
>>>>> -  // and "x" will be treated as the same header when deleting<br class="">
>>>>> #includes.<br class="">
>>>>> -  llvm::StringMap<llvm::SmallVec<wbr class="">tor<Include, 1>> ExistingIncludes;<br class="">
>>>>> -<br class="">
>>>>> -  /// Map from priorities of #include categories to all #includes in<br class="">
>>>>> the same<br class="">
>>>>> -  /// category. This is used to find #includes of the same category<br class="">
>>>>> when<br class="">
>>>>> -  /// inserting new #includes. #includes in the same categories are<br class="">
>>>>> sorted in<br class="">
>>>>> -  /// in the order they appear in the source file.<br class="">
>>>>> -  /// See comment for "FormatStyle::IncludeCategorie<wbr class="">s" for details<br class="">
>>>>> about include<br class="">
>>>>> -  /// priorities.<br class="">
>>>>> -  std::unordered_map<int, llvm::SmallVector<const Include *, 8>><br class="">
>>>>> -      IncludesByPriority;<br class="">
>>>>> -<br class="">
>>>>> -  int FirstIncludeOffset;<br class="">
>>>>> -  // All new headers should be inserted after this offset (e.g. after<br class="">
>>>>> header<br class="">
>>>>> -  // guards, file comment).<br class="">
>>>>> -  unsigned MinInsertOffset;<br class="">
>>>>> -  // Max insertion offset in the original code. For example, we want<br class="">
>>>>> to avoid<br class="">
>>>>> -  // inserting new #includes into the actual code section (e.g. after<br class="">
>>>>> a<br class="">
>>>>> -  // declaration).<br class="">
>>>>> -  unsigned MaxInsertOffset;<br class="">
>>>>> -  IncludeCategoryManager Categories;<br class="">
>>>>> -  // Record the offset of the end of the last include in each<br class="">
>>>>> category.<br class="">
>>>>> -  std::unordered_map<int, int> CategoryEndOffsets;<br class="">
>>>>> -<br class="">
>>>>> -  // All possible priorities.<br class="">
>>>>> -  std::set<int> Priorities;<br class="">
>>>>> -<br class="">
>>>>> -  // Matches a whole #include directive.<br class="">
>>>>> -  llvm::Regex IncludeRegex;<br class="">
>>>>> -};<br class="">
>>>>> -<br class="">
>>>>> -<br class="">
>>>>> -} // namespace tooling<br class="">
>>>>> -} // namespace clang<br class="">
>>>>> -<br class="">
>>>>> -#endif // LLVM_CLANG_TOOLING_CORE_HEADER<wbr class="">INCLUDES_H<br class="">
>>>>> <br class="">
>>>>> Removed: cfe/trunk/include/clang/Toolin<wbr class="">g/Core/IncludeStyle.h<br class="">
>>>>> URL:<br class="">
>>>>> <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Tooling/Core/IncludeStyle.h?rev=333873&view=auto" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-pr<wbr class="">oject/cfe/trunk/include/clang/<wbr class="">Tooling/Core/IncludeStyle.h?<wbr class="">rev=333873&view=auto</a><br class="">
>>>>> <br class="">
>>>>> ==============================<wbr class="">==============================<wbr class="">==================<br class="">
>>>>> --- cfe/trunk/include/clang/Toolin<wbr class="">g/Core/IncludeStyle.h (original)<br class="">
>>>>> +++ cfe/trunk/include/clang/Toolin<wbr class="">g/Core/IncludeStyle.h (removed)<br class="">
>>>>> @@ -1,133 +0,0 @@<br class="">
>>>>> -//===--- IncludeStyle.h - Style of C++ #include directives -------*-<br class="">
>>>>> C++-*-===//<br class="">
>>>>> -//<br class="">
>>>>> -//                     The LLVM Compiler Infrastructure<br class="">
>>>>> -//<br class="">
>>>>> -// This file is distributed under the University of Illinois Open<br class="">
>>>>> Source<br class="">
>>>>> -// License. See LICENSE.TXT for details.<br class="">
>>>>> -//<br class="">
>>>>> <br class="">
>>>>> -//===------------------------<wbr class="">------------------------------<wbr class="">----------------===//<br class="">
>>>>> -<br class="">
>>>>> -#ifndef LLVM_CLANG_TOOLING_CORE_INCLUD<wbr class="">ESTYLE_H<br class="">
>>>>> -#define LLVM_CLANG_TOOLING_CORE_INCLUD<wbr class="">ESTYLE_H<br class="">
>>>>> -<br class="">
>>>>> -#include "llvm/Support/YAMLTraits.h"<br class="">
>>>>> -#include <string><br class="">
>>>>> -#include <vector><br class="">
>>>>> -<br class="">
>>>>> -namespace clang {<br class="">
>>>>> -namespace tooling {<br class="">
>>>>> -<br class="">
>>>>> -/// Style for sorting and grouping C++ #include directives.<br class="">
>>>>> -struct IncludeStyle {<br class="">
>>>>> -  /// Styles for sorting multiple ``#include`` blocks.<br class="">
>>>>> -  enum IncludeBlocksStyle {<br class="">
>>>>> -    /// Sort each ``#include`` block separately.<br class="">
>>>>> -    /// \code<br class="">
>>>>> -    ///    #include "b.h"               into      #include "b.h"<br class="">
>>>>> -    ///<br class="">
>>>>> -    ///    #include <lib/main.h>                  #include "a.h"<br class="">
>>>>> -    ///    #include "a.h"                         #include<br class="">
>>>>> <lib/main.h><br class="">
>>>>> -    /// \endcode<br class="">
>>>>> -    IBS_Preserve,<br class="">
>>>>> -    /// Merge multiple ``#include`` blocks together and sort as one.<br class="">
>>>>> -    /// \code<br class="">
>>>>> -    ///    #include "b.h"               into      #include "a.h"<br class="">
>>>>> -    ///                                           #include "b.h"<br class="">
>>>>> -    ///    #include <lib/main.h>                  #include<br class="">
>>>>> <lib/main.h><br class="">
>>>>> -    ///    #include "a.h"<br class="">
>>>>> -    /// \endcode<br class="">
>>>>> -    IBS_Merge,<br class="">
>>>>> -    /// Merge multiple ``#include`` blocks together and sort as one.<br class="">
>>>>> -    /// Then split into groups based on category priority. See<br class="">
>>>>> -    /// ``IncludeCategories``.<br class="">
>>>>> -    /// \code<br class="">
>>>>> -    ///    #include "b.h"               into      #include "a.h"<br class="">
>>>>> -    ///                                           #include "b.h"<br class="">
>>>>> -    ///    #include <lib/main.h><br class="">
>>>>> -    ///    #include "a.h"                         #include<br class="">
>>>>> <lib/main.h><br class="">
>>>>> -    /// \endcode<br class="">
>>>>> -    IBS_Regroup,<br class="">
>>>>> -  };<br class="">
>>>>> -<br class="">
>>>>> -  /// Dependent on the value, multiple ``#include`` blocks can be<br class="">
>>>>> sorted<br class="">
>>>>> -  /// as one and divided based on category.<br class="">
>>>>> -  IncludeBlocksStyle IncludeBlocks;<br class="">
>>>>> -<br class="">
>>>>> -  /// See documentation of ``IncludeCategories``.<br class="">
>>>>> -  struct IncludeCategory {<br class="">
>>>>> -    /// The regular expression that this category matches.<br class="">
>>>>> -    std::string Regex;<br class="">
>>>>> -    /// The priority to assign to this category.<br class="">
>>>>> -    int Priority;<br class="">
>>>>> -    bool operator==(const IncludeCategory &Other) const {<br class="">
>>>>> -      return Regex == Other.Regex && Priority == Other.Priority;<br class="">
>>>>> -    }<br class="">
>>>>> -  };<br class="">
>>>>> -<br class="">
>>>>> -  /// Regular expressions denoting the different ``#include``<br class="">
>>>>> categories<br class="">
>>>>> -  /// used for ordering ``#includes``.<br class="">
>>>>> -  ///<br class="">
>>>>> -  /// These regular expressions are matched against the filename of an<br class="">
>>>>> include<br class="">
>>>>> -  /// (including the <> or "") in order. The value belonging to the<br class="">
>>>>> first<br class="">
>>>>> -  /// matching regular expression is assigned and ``#includes`` are<br class="">
>>>>> sorted first<br class="">
>>>>> -  /// according to increasing category number and then alphabetically<br class="">
>>>>> within<br class="">
>>>>> -  /// each category.<br class="">
>>>>> -  ///<br class="">
>>>>> -  /// If none of the regular expressions match, INT_MAX is assigned as<br class="">
>>>>> -  /// category. The main header for a source file automatically gets<br class="">
>>>>> category 0.<br class="">
>>>>> -  /// so that it is generally kept at the beginning of the<br class="">
>>>>> ``#includes``<br class="">
>>>>> -  /// (<a href="http://llvm.org/docs/CodingStandards.html#include-style" rel="noreferrer" target="_blank" class="">http://llvm.org/docs/CodingSt<wbr class="">andards.html#include-style</a>).<br class="">
>>>>> However, you<br class="">
>>>>> -  /// can also assign negative priorities if you have certain headers<br class="">
>>>>> that<br class="">
>>>>> -  /// always need to be first.<br class="">
>>>>> -  ///<br class="">
>>>>> -  /// To configure this in the .clang-format file, use:<br class="">
>>>>> -  /// \code{.yaml}<br class="">
>>>>> -  ///   IncludeCategories:<br class="">
>>>>> -  ///     - Regex:           '^"(llvm|llvm-c|clang|clang-<wbr class="">c)/'<br class="">
>>>>> -  ///       Priority:        2<br class="">
>>>>> -  ///     - Regex:           '^(<|"(gtest|gmock|isl|json)/<wbr class="">)'<br class="">
>>>>> -  ///       Priority:        3<br class="">
>>>>> -  ///     - Regex:           '.*'<br class="">
>>>>> -  ///       Priority:        1<br class="">
>>>>> -  /// \endcode<br class="">
>>>>> -  std::vector<IncludeCategory> IncludeCategories;<br class="">
>>>>> -<br class="">
>>>>> -  /// Specify a regular expression of suffixes that are allowed in the<br class="">
>>>>> -  /// file-to-main-include mapping.<br class="">
>>>>> -  ///<br class="">
>>>>> -  /// When guessing whether a #include is the "main" include (to<br class="">
>>>>> assign<br class="">
>>>>> -  /// category 0, see above), use this regex of allowed suffixes to<br class="">
>>>>> the header<br class="">
>>>>> -  /// stem. A partial match is done, so that:<br class="">
>>>>> -  /// - "" means "arbitrary suffix"<br class="">
>>>>> -  /// - "$" means "no suffix"<br class="">
>>>>> -  ///<br class="">
>>>>> -  /// For example, if configured to "(_test)?$", then a header a.h<br class="">
>>>>> would be seen<br class="">
>>>>> -  /// as the "main" include in both <a href="http://a.cc" class="">a.cc</a> and <a href="http://a_test.cc" class="">a_test.cc</a>.<br class="">
>>>>> -  std::string IncludeIsMainRegex;<br class="">
>>>>> -};<br class="">
>>>>> -<br class="">
>>>>> -} // namespace tooling<br class="">
>>>>> -} // namespace clang<br class="">
>>>>> -<br class="">
>>>>> <br class="">
>>>>> -LLVM_YAML_IS_SEQUENCE_VECTOR(<wbr class="">clang::tooling::IncludeStyle::<wbr class="">IncludeCategory)<br class="">
>>>>> -<br class="">
>>>>> -namespace llvm {<br class="">
>>>>> -namespace yaml {<br class="">
>>>>> -<br class="">
>>>>> -template <><br class="">
>>>>> -struct MappingTraits<clang::tooling::<wbr class="">IncludeStyle::IncludeCategory> {<br class="">
>>>>> -  static void mapping(IO &IO,<br class="">
>>>>> -                      clang::tooling::IncludeStyle::<wbr class="">IncludeCategory<br class="">
>>>>> &Category);<br class="">
>>>>> -};<br class="">
>>>>> -<br class="">
>>>>> -template <><br class="">
>>>>> -struct ScalarEnumerationTraits<<br class="">
>>>>> -    clang::tooling::IncludeStyle::<wbr class="">IncludeBlocksStyle> {<br class="">
>>>>> -  static void<br class="">
>>>>> -  enumeration(IO &IO, clang::tooling::IncludeStyle::<wbr class="">IncludeBlocksStyle<br class="">
>>>>> &Value);<br class="">
>>>>> -};<br class="">
>>>>> -<br class="">
>>>>> -} // namespace yaml<br class="">
>>>>> -} // namespace llvm<br class="">
>>>>> -<br class="">
>>>>> -#endif // LLVM_CLANG_TOOLING_CORE_INCLUD<wbr class="">ESTYLE_H<br class="">
>>>>> <br class="">
>>>>> Copied: cfe/trunk/include/clang/Toolin<wbr class="">g/Inclusions/HeaderIncludes.h<br class="">
>>>>> (from r333865, cfe/trunk/include/clang/Toolin<wbr class="">g/Core/HeaderIncludes.h)<br class="">
>>>>> URL:<br class="">
>>>>> <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Tooling/Inclusions/HeaderIncludes.h?p2=cfe/trunk/include/clang/Tooling/Inclusions/HeaderIncludes.h&p1=cfe/trunk/include/clang/Tooling/Core/HeaderIncludes.h&r1=333865&r2=333874&rev=333874&view=diff" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-pr<wbr class="">oject/cfe/trunk/include/clang/<wbr class="">Tooling/Inclusions/HeaderInclu<wbr class="">des.h?p2=cfe/trunk/include/<wbr class="">clang/Tooling/Inclusions/<wbr class="">HeaderIncludes.h&p1=cfe/trunk/<wbr class="">include/clang/Tooling/Core/<wbr class="">HeaderIncludes.h&r1=333865&r2=<wbr class="">333874&rev=333874&view=diff</a><br class="">
>>>>> <br class="">
>>>>> ==============================<wbr class="">==============================<wbr class="">==================<br class="">
>>>>> --- cfe/trunk/include/clang/Toolin<wbr class="">g/Core/HeaderIncludes.h (original)<br class="">
>>>>> +++ cfe/trunk/include/clang/Toolin<wbr class="">g/Inclusions/HeaderIncludes.h Mon Jun<br class="">
>>>>> 4 02:04:12 2018<br class="">
>>>>> @@ -7,12 +7,12 @@<br class="">
>>>>> //<br class="">
>>>>> <br class="">
>>>>> //===-------------------------<wbr class="">------------------------------<wbr class="">---------------===//<br class="">
>>>>> <br class="">
>>>>> -#ifndef LLVM_CLANG_TOOLING_CORE_HEADER<wbr class="">INCLUDES_H<br class="">
>>>>> -#define LLVM_CLANG_TOOLING_CORE_HEADER<wbr class="">INCLUDES_H<br class="">
>>>>> +#ifndef LLVM_CLANG_TOOLING_INCLUSIONS_<wbr class="">HEADERINCLUDES_H<br class="">
>>>>> +#define LLVM_CLANG_TOOLING_INCLUSIONS_<wbr class="">HEADERINCLUDES_H<br class="">
>>>>> <br class="">
>>>>> #include "clang/Basic/SourceManager.h"<br class="">
>>>>> #include "clang/Tooling/Core/Replacemen<wbr class="">t.h"<br class="">
>>>>> -#include "clang/Tooling/Core/IncludeSty<wbr class="">le.h"<br class="">
>>>>> +#include "clang/Tooling/Inclusions/Incl<wbr class="">udeStyle.h"<br class="">
>>>>> #include "llvm/Support/Path.h"<br class="">
>>>>> #include "llvm/Support/Regex.h"<br class="">
>>>>> #include <unordered_map><br class="">
>>>>> @@ -134,4 +134,4 @@ private:<br class="">
>>>>> } // namespace tooling<br class="">
>>>>> } // namespace clang<br class="">
>>>>> <br class="">
>>>>> -#endif // LLVM_CLANG_TOOLING_CORE_HEADER<wbr class="">INCLUDES_H<br class="">
>>>>> +#endif // LLVM_CLANG_TOOLING_INCLUSIONS_<wbr class="">HEADERINCLUDES_H<br class="">
>>>>> <br class="">
>>>>> Copied: cfe/trunk/include/clang/Toolin<wbr class="">g/Inclusions/IncludeStyle.h (from<br class="">
>>>>> r333865, cfe/trunk/include/clang/Toolin<wbr class="">g/Core/IncludeStyle.h)<br class="">
>>>>> URL:<br class="">
>>>>> <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Tooling/Inclusions/IncludeStyle.h?p2=cfe/trunk/include/clang/Tooling/Inclusions/IncludeStyle.h&p1=cfe/trunk/include/clang/Tooling/Core/IncludeStyle.h&r1=333865&r2=333874&rev=333874&view=diff" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-pr<wbr class="">oject/cfe/trunk/include/clang/<wbr class="">Tooling/Inclusions/IncludeStyl<wbr class="">e.h?p2=cfe/trunk/include/<wbr class="">clang/Tooling/Inclusions/<wbr class="">IncludeStyle.h&p1=cfe/trunk/<wbr class="">include/clang/Tooling/Core/<wbr class="">IncludeStyle.h&r1=333865&r2=<wbr class="">333874&rev=333874&view=diff</a><br class="">
>>>>> <br class="">
>>>>> ==============================<wbr class="">==============================<wbr class="">==================<br class="">
>>>>> --- cfe/trunk/include/clang/Toolin<wbr class="">g/Core/IncludeStyle.h (original)<br class="">
>>>>> +++ cfe/trunk/include/clang/Toolin<wbr class="">g/Inclusions/IncludeStyle.h Mon Jun<br class="">
>>>>> 4 02:04:12 2018<br class="">
>>>>> @@ -7,8 +7,8 @@<br class="">
>>>>> //<br class="">
>>>>> <br class="">
>>>>> //===-------------------------<wbr class="">------------------------------<wbr class="">---------------===//<br class="">
>>>>> <br class="">
>>>>> -#ifndef LLVM_CLANG_TOOLING_CORE_INCLUD<wbr class="">ESTYLE_H<br class="">
>>>>> -#define LLVM_CLANG_TOOLING_CORE_INCLUD<wbr class="">ESTYLE_H<br class="">
>>>>> +#ifndef LLVM_CLANG_TOOLING_INCLUSIONS_<wbr class="">INCLUDESTYLE_H<br class="">
>>>>> +#define LLVM_CLANG_TOOLING_INCLUSIONS_<wbr class="">INCLUDESTYLE_H<br class="">
>>>>> <br class="">
>>>>> #include "llvm/Support/YAMLTraits.h"<br class="">
>>>>> #include <string><br class="">
>>>>> @@ -130,4 +130,4 @@ struct ScalarEnumerationTraits<<br class="">
>>>>> } // namespace yaml<br class="">
>>>>> } // namespace llvm<br class="">
>>>>> <br class="">
>>>>> -#endif // LLVM_CLANG_TOOLING_CORE_INCLUD<wbr class="">ESTYLE_H<br class="">
>>>>> +#endif // LLVM_CLANG_TOOLING_INCLUSIONS_<wbr class="">INCLUDESTYLE_H<br class="">
>>>>> <br class="">
>>>>> Modified: cfe/trunk/include/clang/module<wbr class="">.modulemap<br class="">
>>>>> URL:<br class="">
>>>>> <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/module.modulemap?rev=333874&r1=333873&r2=333874&view=diff" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-pr<wbr class="">oject/cfe/trunk/include/clang/<wbr class="">module.modulemap?rev=333874&<wbr class="">r1=333873&r2=333874&view=diff</a><br class="">
>>>>> <br class="">
>>>>> ==============================<wbr class="">==============================<wbr class="">==================<br class="">
>>>>> --- cfe/trunk/include/clang/module<wbr class="">.modulemap (original)<br class="">
>>>>> +++ cfe/trunk/include/clang/module<wbr class="">.modulemap Mon Jun  4 02:04:12 2018<br class="">
>>>>> @@ -154,3 +154,8 @@ module Clang_ToolingCore {<br class="">
>>>>>  requires cplusplus<br class="">
>>>>>  umbrella "Tooling/Core" module * { export * }<br class="">
>>>>> }<br class="">
>>>>> +<br class="">
>>>>> +module Clang_ToolingInclusions {<br class="">
>>>>> +  requires cplusplus<br class="">
>>>>> +  umbrella "Tooling/Inclusions" module * { export * }<br class="">
>>>>> +}<br class="">
>>>>> <br class="">
>>>>> Modified: cfe/trunk/lib/Format/CMakeList<wbr class="">s.txt<br class="">
>>>>> URL:<br class="">
>>>>> <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Format/CMakeLists.txt?rev=333874&r1=333873&r2=333874&view=diff" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-pr<wbr class="">oject/cfe/trunk/lib/Format/CMa<wbr class="">keLists.txt?rev=333874&r1=3338<wbr class="">73&r2=333874&view=diff</a><br class="">
>>>>> <br class="">
>>>>> ==============================<wbr class="">==============================<wbr class="">==================<br class="">
>>>>> --- cfe/trunk/lib/Format/CMakeList<wbr class="">s.txt (original)<br class="">
>>>>> +++ cfe/trunk/lib/Format/CMakeList<wbr class="">s.txt Mon Jun  4 02:04:12 2018<br class="">
>>>>> @@ -20,4 +20,5 @@ add_clang_library(clangFormat<br class="">
>>>>>  clangBasic<br class="">
>>>>>  clangLex<br class="">
>>>>>  clangToolingCore<br class="">
>>>>> +  clangToolingInclusions<br class="">
>>>>>  )<br class="">
>>>>> <br class="">
>>>>> Modified: cfe/trunk/lib/Format/Format.cp<wbr class="">p<br class="">
>>>>> URL:<br class="">
>>>>> <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Format/Format.cpp?rev=333874&r1=333873&r2=333874&view=diff" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-pr<wbr class="">oject/cfe/trunk/lib/Format/For<wbr class="">mat.cpp?rev=333874&r1=333873&<wbr class="">r2=333874&view=diff</a><br class="">
>>>>> <br class="">
>>>>> ==============================<wbr class="">==============================<wbr class="">==================<br class="">
>>>>> --- cfe/trunk/lib/Format/Format.cp<wbr class="">p (original)<br class="">
>>>>> +++ cfe/trunk/lib/Format/Format.cp<wbr class="">p Mon Jun  4 02:04:12 2018<br class="">
>>>>> @@ -31,7 +31,7 @@<br class="">
>>>>> #include "clang/Basic/SourceManager.h"<br class="">
>>>>> #include "clang/Basic/VirtualFileSystem<wbr class="">.h"<br class="">
>>>>> #include "clang/Lex/Lexer.h"<br class="">
>>>>> -#include "clang/Tooling/Core/HeaderIncl<wbr class="">udes.h"<br class="">
>>>>> +#include "clang/Tooling/Inclusions/Head<wbr class="">erIncludes.h"<br class="">
>>>>> #include "llvm/ADT/STLExtras.h"<br class="">
>>>>> #include "llvm/ADT/StringRef.h"<br class="">
>>>>> #include "llvm/Support/Allocator.h"<br class="">
>>>>> <br class="">
>>>>> Modified: cfe/trunk/lib/Tooling/CMakeLis<wbr class="">ts.txt<br class="">
>>>>> URL:<br class="">
>>>>> <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Tooling/CMakeLists.txt?rev=333874&r1=333873&r2=333874&view=diff" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-pr<wbr class="">oject/cfe/trunk/lib/Tooling/CM<wbr class="">akeLists.txt?rev=333874&r1=333<wbr class="">873&r2=333874&view=diff</a><br class="">
>>>>> <br class="">
>>>>> ==============================<wbr class="">==============================<wbr class="">==================<br class="">
>>>>> --- cfe/trunk/lib/Tooling/CMakeLis<wbr class="">ts.txt (original)<br class="">
>>>>> +++ cfe/trunk/lib/Tooling/CMakeLis<wbr class="">ts.txt Mon Jun  4 02:04:12 2018<br class="">
>>>>> @@ -4,6 +4,7 @@ set(LLVM_LINK_COMPONENTS<br class="">
>>>>>  )<br class="">
>>>>> <br class="">
>>>>> add_subdirectory(Core)<br class="">
>>>>> +add_subdirectory(Inclusions)<br class="">
>>>>> add_subdirectory(Refactoring)<br class="">
>>>>> add_subdirectory(ASTDiff)<br class="">
>>>>> <br class="">
>>>>> <br class="">
>>>>> Modified: cfe/trunk/lib/Tooling/Core/CMa<wbr class="">keLists.txt<br class="">
>>>>> URL:<br class="">
>>>>> <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Tooling/Core/CMakeLists.txt?rev=333874&r1=333873&r2=333874&view=diff" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-pr<wbr class="">oject/cfe/trunk/lib/Tooling/Co<wbr class="">re/CMakeLists.txt?rev=333874&<wbr class="">r1=333873&r2=333874&view=diff</a><br class="">
>>>>> <br class="">
>>>>> ==============================<wbr class="">==============================<wbr class="">==================<br class="">
>>>>> --- cfe/trunk/lib/Tooling/Core/CMa<wbr class="">keLists.txt (original)<br class="">
>>>>> +++ cfe/trunk/lib/Tooling/Core/CMa<wbr class="">keLists.txt Mon Jun  4 02:04:12 2018<br class="">
>>>>> @@ -2,8 +2,6 @@ set(LLVM_LINK_COMPONENTS support)<br class="">
>>>>> <br class="">
>>>>> add_clang_library(clangTooling<wbr class="">Core<br class="">
>>>>>  Diagnostic.cpp<br class="">
>>>>> -  HeaderIncludes.cpp<br class="">
>>>>> -  IncludeStyle.cpp<br class="">
>>>>>  Lookup.cpp<br class="">
>>>>>  Replacement.cpp<br class="">
>>>>> <br class="">
>>>>> <br class="">
>>>>> Removed: cfe/trunk/lib/Tooling/Core/Hea<wbr class="">derIncludes.cpp<br class="">
>>>>> URL:<br class="">
>>>>> <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Tooling/Core/HeaderIncludes.cpp?rev=333873&view=auto" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-pr<wbr class="">oject/cfe/trunk/lib/Tooling/Co<wbr class="">re/HeaderIncludes.cpp?rev=3338<wbr class="">73&view=auto</a><br class="">
>>>>> <br class="">
>>>>> ==============================<wbr class="">==============================<wbr class="">==================<br class="">
>>>>> --- cfe/trunk/lib/Tooling/Core/Hea<wbr class="">derIncludes.cpp (original)<br class="">
>>>>> +++ cfe/trunk/lib/Tooling/Core/Hea<wbr class="">derIncludes.cpp (removed)<br class="">
>>>>> @@ -1,330 +0,0 @@<br class="">
>>>>> -//===--- HeaderIncludes.cpp - Insert/Delete #includes --*- C++<br class="">
>>>>> -*----------===//<br class="">
>>>>> -//<br class="">
>>>>> -//                     The LLVM Compiler Infrastructure<br class="">
>>>>> -//<br class="">
>>>>> -// This file is distributed under the University of Illinois Open<br class="">
>>>>> Source<br class="">
>>>>> -// License. See LICENSE.TXT for details.<br class="">
>>>>> -//<br class="">
>>>>> <br class="">
>>>>> -//===------------------------<wbr class="">------------------------------<wbr class="">----------------===//<br class="">
>>>>> -<br class="">
>>>>> -#include "clang/Tooling/Core/HeaderIncl<wbr class="">udes.h"<br class="">
>>>>> -#include "clang/Basic/SourceManager.h"<br class="">
>>>>> -#include "clang/Lex/Lexer.h"<br class="">
>>>>> -<br class="">
>>>>> -namespace clang {<br class="">
>>>>> -namespace tooling {<br class="">
>>>>> -namespace {<br class="">
>>>>> -<br class="">
>>>>> -LangOptions createLangOpts() {<br class="">
>>>>> -  LangOptions LangOpts;<br class="">
>>>>> -  LangOpts.CPlusPlus = 1;<br class="">
>>>>> -  LangOpts.CPlusPlus11 = 1;<br class="">
>>>>> -  LangOpts.CPlusPlus14 = 1;<br class="">
>>>>> -  LangOpts.LineComment = 1;<br class="">
>>>>> -  LangOpts.CXXOperatorNames = 1;<br class="">
>>>>> -  LangOpts.Bool = 1;<br class="">
>>>>> -  LangOpts.ObjC1 = 1;<br class="">
>>>>> -  LangOpts.ObjC2 = 1;<br class="">
>>>>> -  LangOpts.MicrosoftExt = 1;    // To get kw___try, kw___finally.<br class="">
>>>>> -  LangOpts.DeclSpecKeyword = 1; // To get __declspec.<br class="">
>>>>> -  LangOpts.WChar = 1;           // To get wchar_t<br class="">
>>>>> -  return LangOpts;<br class="">
>>>>> -}<br class="">
>>>>> -<br class="">
>>>>> -// Returns the offset after skipping a sequence of tokens, matched by<br class="">
>>>>> \p<br class="">
>>>>> -// GetOffsetAfterSequence, from the start of the code.<br class="">
>>>>> -// \p GetOffsetAfterSequence should be a function that matches a<br class="">
>>>>> sequence of<br class="">
>>>>> -// tokens and returns an offset after the sequence.<br class="">
>>>>> -unsigned getOffsetAfterTokenSequence(<br class="">
>>>>> -    StringRef FileName, StringRef Code, const IncludeStyle &Style,<br class="">
>>>>> -    llvm::function_ref<unsigned(co<wbr class="">nst SourceManager &, Lexer &, Token<br class="">
>>>>> &)><br class="">
>>>>> -        GetOffsetAfterSequence) {<br class="">
>>>>> -  SourceManagerForFile VirtualSM(FileName, Code);<br class="">
>>>>> -  SourceManager &SM = VirtualSM.get();<br class="">
>>>>> -  Lexer Lex(SM.getMainFileID(), SM.getBuffer(SM.getMainFileID(<wbr class="">)), SM,<br class="">
>>>>> -            createLangOpts());<br class="">
>>>>> -  Token Tok;<br class="">
>>>>> -  // Get the first token.<br class="">
>>>>> -  Lex.LexFromRawLexer(Tok);<br class="">
>>>>> -  return GetOffsetAfterSequence(SM, Lex, Tok);<br class="">
>>>>> -}<br class="">
>>>>> -<br class="">
>>>>> -// Check if a sequence of tokens is like "#<Name> <raw_identifier>".<br class="">
>>>>> If it is,<br class="">
>>>>> -// \p Tok will be the token after this directive; otherwise, it can be<br class="">
>>>>> any token<br class="">
>>>>> -// after the given \p Tok (including \p Tok).<br class="">
>>>>> -bool checkAndConsumeDirectiveWithNa<wbr class="">me(Lexer &Lex, StringRef Name,<br class="">
>>>>> Token &Tok) {<br class="">
>>>>> -  bool Matched = <a href="http://Tok.is" class="">Tok.is</a>(tok::hash) && !Lex.LexFromRawLexer(Tok) &&<br class="">
>>>>> -                 <a href="http://Tok.is" class="">Tok.is</a>(tok::raw_identifier) &&<br class="">
>>>>> -                 Tok.getRawIdentifier() == Name &&<br class="">
>>>>> !Lex.LexFromRawLexer(Tok) &&<br class="">
>>>>> -                 <a href="http://Tok.is" class="">Tok.is</a>(tok::raw_identifier);<br class="">
>>>>> -  if (Matched)<br class="">
>>>>> -    Lex.LexFromRawLexer(Tok);<br class="">
>>>>> -  return Matched;<br class="">
>>>>> -}<br class="">
>>>>> -<br class="">
>>>>> -void skipComments(Lexer &Lex, Token &Tok) {<br class="">
>>>>> -  while (<a href="http://Tok.is" class="">Tok.is</a>(tok::comment))<br class="">
>>>>> -    if (Lex.LexFromRawLexer(Tok))<br class="">
>>>>> -      return;<br class="">
>>>>> -}<br class="">
>>>>> -<br class="">
>>>>> -// Returns the offset after header guard directives and any comments<br class="">
>>>>> -// before/after header guards. If no header guard presents in the<br class="">
>>>>> code, this<br class="">
>>>>> -// will returns the offset after skipping all comments from the start<br class="">
>>>>> of the<br class="">
>>>>> -// code.<br class="">
>>>>> -unsigned getOffsetAfterHeaderGuardsAndC<wbr class="">omments(StringRef FileName,<br class="">
>>>>> -                                               StringRef Code,<br class="">
>>>>> -                                               const IncludeStyle<br class="">
>>>>> &Style) {<br class="">
>>>>> -  return getOffsetAfterTokenSequence(<br class="">
>>>>> -      FileName, Code, Style,<br class="">
>>>>> -      [](const SourceManager &SM, Lexer &Lex, Token Tok) {<br class="">
>>>>> -        skipComments(Lex, Tok);<br class="">
>>>>> -        unsigned InitialOffset = SM.getFileOffset(Tok.getLocati<wbr class="">on());<br class="">
>>>>> -        if (checkAndConsumeDirectiveWithN<wbr class="">ame(Lex, "ifndef", Tok)) {<br class="">
>>>>> -          skipComments(Lex, Tok);<br class="">
>>>>> -          if (checkAndConsumeDirectiveWithN<wbr class="">ame(Lex, "define", Tok))<br class="">
>>>>> -            return SM.getFileOffset(Tok.getLocati<wbr class="">on());<br class="">
>>>>> -        }<br class="">
>>>>> -        return InitialOffset;<br class="">
>>>>> -      });<br class="">
>>>>> -}<br class="">
>>>>> -<br class="">
>>>>> -// Check if a sequence of tokens is like<br class="">
>>>>> -//    "#include ("header.h" | <header.h>)".<br class="">
>>>>> -// If it is, \p Tok will be the token after this directive; otherwise,<br class="">
>>>>> it can be<br class="">
>>>>> -// any token after the given \p Tok (including \p Tok).<br class="">
>>>>> -bool checkAndConsumeInclusiveDirect<wbr class="">ive(Lexer &Lex, Token &Tok) {<br class="">
>>>>> -  auto Matched = [&]() {<br class="">
>>>>> -    Lex.LexFromRawLexer(Tok);<br class="">
>>>>> -    return true;<br class="">
>>>>> -  };<br class="">
>>>>> -  if (<a href="http://Tok.is" class="">Tok.is</a>(tok::hash) && !Lex.LexFromRawLexer(Tok) &&<br class="">
>>>>> -      <a href="http://Tok.is" class="">Tok.is</a>(tok::raw_identifier) && Tok.getRawIdentifier() ==<br class="">
>>>>> "include") {<br class="">
>>>>> -    if (Lex.LexFromRawLexer(Tok))<br class="">
>>>>> -      return false;<br class="">
>>>>> -    if (<a href="http://Tok.is" class="">Tok.is</a>(tok::string_literal))<br class="">
>>>>> -      return Matched();<br class="">
>>>>> -    if (<a href="http://Tok.is" class="">Tok.is</a>(tok::less)) {<br class="">
>>>>> -      while (!Lex.LexFromRawLexer(Tok) && Tok.isNot(tok::greater)) {<br class="">
>>>>> -      }<br class="">
>>>>> -      if (<a href="http://Tok.is" class="">Tok.is</a>(tok::greater))<br class="">
>>>>> -        return Matched();<br class="">
>>>>> -    }<br class="">
>>>>> -  }<br class="">
>>>>> -  return false;<br class="">
>>>>> -}<br class="">
>>>>> -<br class="">
>>>>> -// Returns the offset of the last #include directive after which a new<br class="">
>>>>> -// #include can be inserted. This ignores #include's after the<br class="">
>>>>> #include block(s)<br class="">
>>>>> -// in the beginning of a file to avoid inserting headers into code<br class="">
>>>>> sections<br class="">
>>>>> -// where new #include's should not be added by default.<br class="">
>>>>> -// These code sections include:<br class="">
>>>>> -//      - raw string literals (containing #include).<br class="">
>>>>> -//      - #if blocks.<br class="">
>>>>> -//      - Special #include's among declarations (e.g. functions).<br class="">
>>>>> -//<br class="">
>>>>> -// If no #include after which a new #include can be inserted, this<br class="">
>>>>> returns the<br class="">
>>>>> -// offset after skipping all comments from the start of the code.<br class="">
>>>>> -// Inserting after an #include is not allowed if it comes after code<br class="">
>>>>> that is not<br class="">
>>>>> -// #include (e.g. pre-processing directive that is not #include,<br class="">
>>>>> declarations).<br class="">
>>>>> -unsigned getMaxHeaderInsertionOffset(St<wbr class="">ringRef FileName, StringRef<br class="">
>>>>> Code,<br class="">
>>>>> -                                     const IncludeStyle &Style) {<br class="">
>>>>> -  return getOffsetAfterTokenSequence(<br class="">
>>>>> -      FileName, Code, Style,<br class="">
>>>>> -      [](const SourceManager &SM, Lexer &Lex, Token Tok) {<br class="">
>>>>> -        skipComments(Lex, Tok);<br class="">
>>>>> -        unsigned MaxOffset = SM.getFileOffset(Tok.getLocati<wbr class="">on());<br class="">
>>>>> -        while (checkAndConsumeInclusiveDirec<wbr class="">tive(Lex, Tok))<br class="">
>>>>> -          MaxOffset = SM.getFileOffset(Tok.getLocati<wbr class="">on());<br class="">
>>>>> -        return MaxOffset;<br class="">
>>>>> -      });<br class="">
>>>>> -}<br class="">
>>>>> -<br class="">
>>>>> -inline StringRef trimInclude(StringRef IncludeName) {<br class="">
>>>>> -  return IncludeName.trim("\"<>");<br class="">
>>>>> -}<br class="">
>>>>> -<br class="">
>>>>> -const char IncludeRegexPattern[] =<br class="">
>>>>> -    R"(^[\t\ ]*#[\t\ ]*(import|include)[^"<]*(["<][<wbr class="">^">]*[">]))";<br class="">
>>>>> -<br class="">
>>>>> -} // anonymous namespace<br class="">
>>>>> -<br class="">
>>>>> -IncludeCategoryManager::Inclu<wbr class="">deCategoryManager(const IncludeStyle<br class="">
>>>>> &Style,<br class="">
>>>>> -                                               StringRef FileName)<br class="">
>>>>> -    : Style(Style), FileName(FileName) {<br class="">
>>>>> -  FileStem = llvm::sys::path::stem(FileName<wbr class="">);<br class="">
>>>>> -  for (const auto &Category : Style.IncludeCategories)<br class="">
>>>>> -    CategoryRegexs.emplace_back(Ca<wbr class="">tegory.Regex,<br class="">
>>>>> llvm::Regex::IgnoreCase);<br class="">
>>>>> -  IsMainFile = FileName.endswith(".c") || FileName.endswith(".cc") ||<br class="">
>>>>> -               FileName.endswith(".cpp") || FileName.endswith(".c++")<br class="">
>>>>> ||<br class="">
>>>>> -               FileName.endswith(".cxx") || FileName.endswith(".m") ||<br class="">
>>>>> -               FileName.endswith(".mm");<br class="">
>>>>> -}<br class="">
>>>>> -<br class="">
>>>>> -int IncludeCategoryManager::getInc<wbr class="">ludePriority(StringRef IncludeName,<br class="">
>>>>> -                                               bool CheckMainHeader)<br class="">
>>>>> const {<br class="">
>>>>> -  int Ret = INT_MAX;<br class="">
>>>>> -  for (unsigned i = 0, e = CategoryRegexs.size(); i != e; ++i)<br class="">
>>>>> -    if (CategoryRegexs[i].match(Inclu<wbr class="">deName)) {<br class="">
>>>>> -      Ret = Style.IncludeCategories[i].Pri<wbr class="">ority;<br class="">
>>>>> -      break;<br class="">
>>>>> -    }<br class="">
>>>>> -  if (CheckMainHeader && IsMainFile && Ret > 0 &&<br class="">
>>>>> isMainHeader(IncludeName))<br class="">
>>>>> -    Ret = 0;<br class="">
>>>>> -  return Ret;<br class="">
>>>>> -}<br class="">
>>>>> -<br class="">
>>>>> -bool IncludeCategoryManager::isMain<wbr class="">Header(StringRef IncludeName) const<br class="">
>>>>> {<br class="">
>>>>> -  if (!IncludeName.startswith("\"")<wbr class="">)<br class="">
>>>>> -    return false;<br class="">
>>>>> -  StringRef HeaderStem =<br class="">
>>>>> -      llvm::sys::path::stem(IncludeN<wbr class="">ame.drop_front(1).drop_back(1)<wbr class="">);<br class="">
>>>>> -  if (FileStem.startswith(HeaderSte<wbr class="">m) ||<br class="">
>>>>> -      FileStem.startswith_lower(Head<wbr class="">erStem)) {<br class="">
>>>>> -    llvm::Regex MainIncludeRegex((HeaderStem +<br class="">
>>>>> Style.IncludeIsMainRegex).str(<wbr class="">),<br class="">
>>>>> -                                 llvm::Regex::IgnoreCase);<br class="">
>>>>> -    if (MainIncludeRegex.match(FileSt<wbr class="">em))<br class="">
>>>>> -      return true;<br class="">
>>>>> -  }<br class="">
>>>>> -  return false;<br class="">
>>>>> -}<br class="">
>>>>> -<br class="">
>>>>> -HeaderIncludes::HeaderInclude<wbr class="">s(StringRef FileName, StringRef Code,<br class="">
>>>>> -                               const IncludeStyle &Style)<br class="">
>>>>> -    : FileName(FileName), Code(Code), FirstIncludeOffset(-1),<br class="">
>>>>> -      MinInsertOffset(<br class="">
>>>>> -          getOffsetAfterHeaderGuardsAndC<wbr class="">omments(FileName, Code,<br class="">
>>>>> Style)),<br class="">
>>>>> -      MaxInsertOffset(MinInsertOffse<wbr class="">t +<br class="">
>>>>> -                      getMaxHeaderInsertionOffset(<br class="">
>>>>> -                          FileName, Code.drop_front(MinInsertOffse<wbr class="">t),<br class="">
>>>>> Style)),<br class="">
>>>>> -      Categories(Style, FileName),<br class="">
>>>>> -      IncludeRegex(llvm::Regex(Inclu<wbr class="">deRegexPattern)) {<br class="">
>>>>> -  // Add 0 for main header and INT_MAX for headers that are not in any<br class="">
>>>>> -  // category.<br class="">
>>>>> -  Priorities = {0, INT_MAX};<br class="">
>>>>> -  for (const auto &Category : Style.IncludeCategories)<br class="">
>>>>> -    Priorities.insert(Category.Pri<wbr class="">ority);<br class="">
>>>>> -  SmallVector<StringRef, 32> Lines;<br class="">
>>>>> -  Code.drop_front(MinInsertOffse<wbr class="">t).split(Lines, "\n");<br class="">
>>>>> -<br class="">
>>>>> -  unsigned Offset = MinInsertOffset;<br class="">
>>>>> -  unsigned NextLineOffset;<br class="">
>>>>> -  SmallVector<StringRef, 4> Matches;<br class="">
>>>>> -  for (auto Line : Lines) {<br class="">
>>>>> -    NextLineOffset = std::min(Code.size(), Offset + Line.size() + 1);<br class="">
>>>>> -    if (IncludeRegex.match(Line, &Matches)) {<br class="">
>>>>> -      // If this is the last line without trailing newline, we need to<br class="">
>>>>> make<br class="">
>>>>> -      // sure we don't delete across the file boundary.<br class="">
>>>>> -      addExistingInclude(<br class="">
>>>>> -          Include(Matches[2],<br class="">
>>>>> -                  tooling::Range(<br class="">
>>>>> -                      Offset, std::min(Line.size() + 1, Code.size() -<br class="">
>>>>> Offset))),<br class="">
>>>>> -          NextLineOffset);<br class="">
>>>>> -    }<br class="">
>>>>> -    Offset = NextLineOffset;<br class="">
>>>>> -  }<br class="">
>>>>> -<br class="">
>>>>> -  // Populate CategoryEndOfssets:<br class="">
>>>>> -  // - Ensure that CategoryEndOffset[Highest] is always populated.<br class="">
>>>>> -  // - If CategoryEndOffset[Priority] isn't set, use the next higher<br class="">
>>>>> value<br class="">
>>>>> -  // that is set, up to CategoryEndOffset[Highest].<br class="">
>>>>> -  auto Highest = Priorities.begin();<br class="">
>>>>> -  if (CategoryEndOffsets.find(*High<wbr class="">est) == CategoryEndOffsets.end()) {<br class="">
>>>>> -    if (FirstIncludeOffset >= 0)<br class="">
>>>>> -      CategoryEndOffsets[*Highest] = FirstIncludeOffset;<br class="">
>>>>> -    else<br class="">
>>>>> -      CategoryEndOffsets[*Highest] = MinInsertOffset;<br class="">
>>>>> -  }<br class="">
>>>>> -  // By this point, CategoryEndOffset[Highest] is always set<br class="">
>>>>> appropriately:<br class="">
>>>>> -  //  - to an appropriate location before/after existing #includes, or<br class="">
>>>>> -  //  - to right after the header guard, or<br class="">
>>>>> -  //  - to the beginning of the file.<br class="">
>>>>> -  for (auto I = ++Priorities.begin(), E = Priorities.end(); I != E;<br class="">
>>>>> ++I)<br class="">
>>>>> -    if (CategoryEndOffsets.find(*I) == CategoryEndOffsets.end())<br class="">
>>>>> -      CategoryEndOffsets[*I] = CategoryEndOffsets[*std::prev(<wbr class="">I)];<br class="">
>>>>> -}<br class="">
>>>>> -<br class="">
>>>>> -// \p Offset: the start of the line following this include directive.<br class="">
>>>>> -void HeaderIncludes::addExistingInc<wbr class="">lude(Include IncludeToAdd,<br class="">
>>>>> -                                        unsigned NextLineOffset) {<br class="">
>>>>> -  auto Iter =<br class="">
>>>>> -<br class="">
>>>>> ExistingIncludes.try_emplace(t<wbr class="">rimInclude(IncludeToAdd.Name))<wbr class="">.first;<br class="">
>>>>> -  Iter->second.push_back(std::mo<wbr class="">ve(IncludeToAdd));<br class="">
>>>>> -  auto &CurInclude = Iter->second.back();<br class="">
>>>>> -  // The header name with quotes or angle brackets.<br class="">
>>>>> -  // Only record the offset of current #include if we can insert after<br class="">
>>>>> it.<br class="">
>>>>> -  if (CurInclude.R.getOffset() <= MaxInsertOffset) {<br class="">
>>>>> -    int Priority = Categories.getIncludePriority(<br class="">
>>>>> -        CurInclude.Name, /*CheckMainHeader=*/FirstInclu<wbr class="">deOffset < 0);<br class="">
>>>>> -    CategoryEndOffsets[Priority] = NextLineOffset;<br class="">
>>>>> -    IncludesByPriority[Priority].p<wbr class="">ush_back(&CurInclude);<br class="">
>>>>> -    if (FirstIncludeOffset < 0)<br class="">
>>>>> -      FirstIncludeOffset = CurInclude.R.getOffset();<br class="">
>>>>> -  }<br class="">
>>>>> -}<br class="">
>>>>> -<br class="">
>>>>> -llvm::Optional<tooling::Repla<wbr class="">cement><br class="">
>>>>> -HeaderIncludes::insert(llvm::<wbr class="">StringRef IncludeName, bool IsAngled)<br class="">
>>>>> const {<br class="">
>>>>> -  assert(IncludeName == trimInclude(IncludeName));<br class="">
>>>>> -  // If a <header> ("header") already exists in code, "header"<br class="">
>>>>> (<header>) with<br class="">
>>>>> -  // different quotation will still be inserted.<br class="">
>>>>> -  // FIXME: figure out if this is the best behavior.<br class="">
>>>>> -  auto It = ExistingIncludes.find(IncludeN<wbr class="">ame);<br class="">
>>>>> -  if (It != ExistingIncludes.end())<br class="">
>>>>> -    for (const auto &Inc : It->second)<br class="">
>>>>> -      if ((IsAngled && StringRef(Inc.Name).startswith<wbr class="">("<")) ||<br class="">
>>>>> -          (!IsAngled && StringRef(Inc.Name).startswith<wbr class="">("\"")))<br class="">
>>>>> -        return llvm::None;<br class="">
>>>>> -  std::string Quoted = IsAngled ? ("<" + IncludeName + ">").str()<br class="">
>>>>> -                                : ("\"" + IncludeName + "\"").str();<br class="">
>>>>> -  StringRef QuotedName = Quoted;<br class="">
>>>>> -  int Priority = Categories.getIncludePriority(<br class="">
>>>>> -      QuotedName, /*CheckMainHeader=*/FirstInclu<wbr class="">deOffset < 0);<br class="">
>>>>> -  auto CatOffset = CategoryEndOffsets.find(Priori<wbr class="">ty);<br class="">
>>>>> -  assert(CatOffset != CategoryEndOffsets.end());<br class="">
>>>>> -  unsigned InsertOffset = CatOffset->second; // Fall back offset<br class="">
>>>>> -  auto Iter = IncludesByPriority.find(Priori<wbr class="">ty);<br class="">
>>>>> -  if (Iter != IncludesByPriority.end()) {<br class="">
>>>>> -    for (const auto *Inc : Iter->second) {<br class="">
>>>>> -      if (QuotedName < Inc->Name) {<br class="">
>>>>> -        InsertOffset = Inc->R.getOffset();<br class="">
>>>>> -        break;<br class="">
>>>>> -      }<br class="">
>>>>> -    }<br class="">
>>>>> -  }<br class="">
>>>>> -  assert(InsertOffset <= Code.size());<br class="">
>>>>> -  std::string NewInclude = ("#include " + QuotedName + "\n").str();<br class="">
>>>>> -  // When inserting headers at end of the code, also append '\n' to<br class="">
>>>>> the code<br class="">
>>>>> -  // if it does not end with '\n'.<br class="">
>>>>> -  // FIXME: when inserting multiple #includes at the end of code, only<br class="">
>>>>> one<br class="">
>>>>> -  // newline should be added.<br class="">
>>>>> -  if (InsertOffset == Code.size() && (!Code.empty() && Code.back() !=<br class="">
>>>>> '\n'))<br class="">
>>>>> -    NewInclude = "\n" + NewInclude;<br class="">
>>>>> -  return tooling::Replacement(FileName, InsertOffset, 0, NewInclude);<br class="">
>>>>> -}<br class="">
>>>>> -<br class="">
>>>>> -tooling::Replacements HeaderIncludes::remove(llvm::S<wbr class="">tringRef<br class="">
>>>>> IncludeName,<br class="">
>>>>> -                                             bool IsAngled) const {<br class="">
>>>>> -  assert(IncludeName == trimInclude(IncludeName));<br class="">
>>>>> -  tooling::Replacements Result;<br class="">
>>>>> -  auto Iter = ExistingIncludes.find(IncludeN<wbr class="">ame);<br class="">
>>>>> -  if (Iter == ExistingIncludes.end())<br class="">
>>>>> -    return Result;<br class="">
>>>>> -  for (const auto &Inc : Iter->second) {<br class="">
>>>>> -    if ((IsAngled && StringRef(Inc.Name).startswith<wbr class="">("\"")) ||<br class="">
>>>>> -        (!IsAngled && StringRef(Inc.Name).startswith<wbr class="">("<")))<br class="">
>>>>> -      continue;<br class="">
>>>>> -    llvm::Error Err = Result.add(tooling::Replacemen<wbr class="">t(<br class="">
>>>>> -        FileName, Inc.R.getOffset(), Inc.R.getLength(), ""));<br class="">
>>>>> -    if (Err) {<br class="">
>>>>> -      auto ErrMsg = "Unexpected conflicts in #include deletions: " +<br class="">
>>>>> -                    llvm::toString(std::move(Err))<wbr class="">;<br class="">
>>>>> -      llvm_unreachable(ErrMsg.c_str(<wbr class="">));<br class="">
>>>>> -    }<br class="">
>>>>> -  }<br class="">
>>>>> -  return Result;<br class="">
>>>>> -}<br class="">
>>>>> -<br class="">
>>>>> -<br class="">
>>>>> -} // namespace tooling<br class="">
>>>>> -} // namespace clang<br class="">
>>>>> <br class="">
>>>>> Removed: cfe/trunk/lib/Tooling/Core/Inc<wbr class="">ludeStyle.cpp<br class="">
>>>>> URL:<br class="">
>>>>> <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Tooling/Core/IncludeStyle.cpp?rev=333873&view=auto" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-pr<wbr class="">oject/cfe/trunk/lib/Tooling/Co<wbr class="">re/IncludeStyle.cpp?rev=333873<wbr class="">&view=auto</a><br class="">
>>>>> <br class="">
>>>>> ==============================<wbr class="">==============================<wbr class="">==================<br class="">
>>>>> --- cfe/trunk/lib/Tooling/Core/Inc<wbr class="">ludeStyle.cpp (original)<br class="">
>>>>> +++ cfe/trunk/lib/Tooling/Core/Inc<wbr class="">ludeStyle.cpp (removed)<br class="">
>>>>> @@ -1,32 +0,0 @@<br class="">
>>>>> -//===--- IncludeStyle.cpp - Style of C++ #include directives -----*-<br class="">
>>>>> C++-*-===//<br class="">
>>>>> -//<br class="">
>>>>> -//                     The LLVM Compiler Infrastructure<br class="">
>>>>> -//<br class="">
>>>>> -// This file is distributed under the University of Illinois Open<br class="">
>>>>> Source<br class="">
>>>>> -// License. See LICENSE.TXT for details.<br class="">
>>>>> -//<br class="">
>>>>> <br class="">
>>>>> -//===------------------------<wbr class="">------------------------------<wbr class="">----------------===//<br class="">
>>>>> -<br class="">
>>>>> -#include "clang/Tooling/Core/IncludeSty<wbr class="">le.h"<br class="">
>>>>> -<br class="">
>>>>> -<br class="">
>>>>> -using clang::tooling::IncludeStyle;<br class="">
>>>>> -<br class="">
>>>>> -namespace llvm {<br class="">
>>>>> -namespace yaml {<br class="">
>>>>> -<br class="">
>>>>> -void MappingTraits<IncludeStyle::In<wbr class="">cludeCategory>::mapping(<br class="">
>>>>> -    IO &IO, IncludeStyle::IncludeCategory &Category) {<br class="">
>>>>> -  IO.mapOptional("Regex", Category.Regex);<br class="">
>>>>> -  IO.mapOptional("Priority", Category.Priority);<br class="">
>>>>> -}<br class="">
>>>>> -<br class="">
>>>>> -void<br class="">
>>>>> ScalarEnumerationTraits<Includ<wbr class="">eStyle::IncludeBlocksStyle>::e<wbr class="">numeration(<br class="">
>>>>> -    IO &IO, IncludeStyle::IncludeBlocksSty<wbr class="">le &Value) {<br class="">
>>>>> -  IO.enumCase(Value, "Preserve", IncludeStyle::IBS_Preserve);<br class="">
>>>>> -  IO.enumCase(Value, "Merge", IncludeStyle::IBS_Merge);<br class="">
>>>>> -  IO.enumCase(Value, "Regroup", IncludeStyle::IBS_Regroup);<br class="">
>>>>> -}<br class="">
>>>>> -<br class="">
>>>>> -} // namespace yaml<br class="">
>>>>> -} // namespace llvm<br class="">
>>>>> <br class="">
>>>>> Copied: cfe/trunk/lib/Tooling/Inclusio<wbr class="">ns/CMakeLists.txt (from r333865,<br class="">
>>>>> cfe/trunk/lib/Tooling/Core/CMa<wbr class="">keLists.txt)<br class="">
>>>>> URL:<br class="">
>>>>> <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Tooling/Inclusions/CMakeLists.txt?p2=cfe/trunk/lib/Tooling/Inclusions/CMakeLists.txt&p1=cfe/trunk/lib/Tooling/Core/CMakeLists.txt&r1=333865&r2=333874&rev=333874&view=diff" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-pr<wbr class="">oject/cfe/trunk/lib/Tooling/In<wbr class="">clusions/CMakeLists.txt?p2=cfe<wbr class="">/trunk/lib/Tooling/Inclusions/<wbr class="">CMakeLists.txt&p1=cfe/trunk/<wbr class="">lib/Tooling/Core/CMakeLists.<wbr class="">txt&r1=333865&r2=333874&rev=<wbr class="">333874&view=diff</a><br class="">
>>>>> <br class="">
>>>>> ==============================<wbr class="">==============================<wbr class="">==================<br class="">
>>>>> --- cfe/trunk/lib/Tooling/Core/CMa<wbr class="">keLists.txt (original)<br class="">
>>>>> +++ cfe/trunk/lib/Tooling/Inclusio<wbr class="">ns/CMakeLists.txt Mon Jun  4 02:04:12<br class="">
>>>>> 2018<br class="">
>>>>> @@ -1,15 +1,12 @@<br class="">
>>>>> set(LLVM_LINK_COMPONENTS support)<br class="">
>>>>> <br class="">
>>>>> -add_clang_library(clangToolin<wbr class="">gCore<br class="">
>>>>> -  Diagnostic.cpp<br class="">
>>>>> +add_clang_library(clangToolin<wbr class="">gInclusions<br class="">
>>>>>  HeaderIncludes.cpp<br class="">
>>>>>  IncludeStyle.cpp<br class="">
>>>>> -  Lookup.cpp<br class="">
>>>>> -  Replacement.cpp<br class="">
>>>>> <br class="">
>>>>>  LINK_LIBS<br class="">
>>>>> -  clangAST<br class="">
>>>>>  clangBasic<br class="">
>>>>>  clangLex<br class="">
>>>>>  clangRewrite<br class="">
>>>>> +  clangToolingCore<br class="">
>>>>>  )<br class="">
>>>>> <br class="">
>>>>> Copied: cfe/trunk/lib/Tooling/Inclusio<wbr class="">ns/HeaderIncludes.cpp (from<br class="">
>>>>> r333865, cfe/trunk/lib/Tooling/Core/Hea<wbr class="">derIncludes.cpp)<br class="">
>>>>> URL:<br class="">
>>>>> <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Tooling/Inclusions/HeaderIncludes.cpp?p2=cfe/trunk/lib/Tooling/Inclusions/HeaderIncludes.cpp&p1=cfe/trunk/lib/Tooling/Core/HeaderIncludes.cpp&r1=333865&r2=333874&rev=333874&view=diff" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-pr<wbr class="">oject/cfe/trunk/lib/Tooling/In<wbr class="">clusions/HeaderIncludes.cpp?p2<wbr class="">=cfe/trunk/lib/Tooling/Inclusi<wbr class="">ons/HeaderIncludes.cpp&p1=cfe/<wbr class="">trunk/lib/Tooling/Core/HeaderI<wbr class="">ncludes.cpp&r1=333865&r2=<wbr class="">333874&rev=333874&view=diff</a><br class="">
>>>>> <br class="">
>>>>> ==============================<wbr class="">==============================<wbr class="">==================<br class="">
>>>>> --- cfe/trunk/lib/Tooling/Core/Hea<wbr class="">derIncludes.cpp (original)<br class="">
>>>>> +++ cfe/trunk/lib/Tooling/Inclusio<wbr class="">ns/HeaderIncludes.cpp Mon Jun  4<br class="">
>>>>> 02:04:12 2018<br class="">
>>>>> @@ -7,7 +7,7 @@<br class="">
>>>>> //<br class="">
>>>>> <br class="">
>>>>> //===-------------------------<wbr class="">------------------------------<wbr class="">---------------===//<br class="">
>>>>> <br class="">
>>>>> -#include "clang/Tooling/Core/HeaderIncl<wbr class="">udes.h"<br class="">
>>>>> +#include "clang/Tooling/Inclusions/Head<wbr class="">erIncludes.h"<br class="">
>>>>> #include "clang/Basic/SourceManager.h"<br class="">
>>>>> #include "clang/Lex/Lexer.h"<br class="">
>>>>> <br class="">
>>>>> <br class="">
>>>>> Copied: cfe/trunk/lib/Tooling/Inclusio<wbr class="">ns/IncludeStyle.cpp (from<br class="">
>>>>> r333865, cfe/trunk/lib/Tooling/Core/Inc<wbr class="">ludeStyle.cpp)<br class="">
>>>>> URL:<br class="">
>>>>> <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Tooling/Inclusions/IncludeStyle.cpp?p2=cfe/trunk/lib/Tooling/Inclusions/IncludeStyle.cpp&p1=cfe/trunk/lib/Tooling/Core/IncludeStyle.cpp&r1=333865&r2=333874&rev=333874&view=diff" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-pr<wbr class="">oject/cfe/trunk/lib/Tooling/In<wbr class="">clusions/IncludeStyle.cpp?p2=<wbr class="">cfe/trunk/lib/Tooling/Inclusio<wbr class="">ns/IncludeStyle.cpp&p1=cfe/<wbr class="">trunk/lib/Tooling/Core/Include<wbr class="">Style.cpp&r1=333865&r2=333874&<wbr class="">rev=333874&view=diff</a><br class="">
>>>>> <br class="">
>>>>> ==============================<wbr class="">==============================<wbr class="">==================<br class="">
>>>>> --- cfe/trunk/lib/Tooling/Core/Inc<wbr class="">ludeStyle.cpp (original)<br class="">
>>>>> +++ cfe/trunk/lib/Tooling/Inclusio<wbr class="">ns/IncludeStyle.cpp Mon Jun  4<br class="">
>>>>> 02:04:12 2018<br class="">
>>>>> @@ -7,8 +7,7 @@<br class="">
>>>>> //<br class="">
>>>>> <br class="">
>>>>> //===-------------------------<wbr class="">------------------------------<wbr class="">---------------===//<br class="">
>>>>> <br class="">
>>>>> -#include "clang/Tooling/Core/IncludeSty<wbr class="">le.h"<br class="">
>>>>> -<br class="">
>>>>> +#include "clang/Tooling/Inclusions/Incl<wbr class="">udeStyle.h"<br class="">
>>>>> <br class="">
>>>>> using clang::tooling::IncludeStyle;<br class="">
>>>>> <br class="">
>>>>> <br class="">
>>>>> Modified: cfe/trunk/unittests/Tooling/He<wbr class="">aderIncludesTest.cpp<br class="">
>>>>> URL:<br class="">
>>>>> <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/unittests/Tooling/HeaderIncludesTest.cpp?rev=333874&r1=333873&r2=333874&view=diff" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-pr<wbr class="">oject/cfe/trunk/unittests/Tool<wbr class="">ing/HeaderIncludesTest.cpp?<wbr class="">rev=333874&r1=333873&r2=333874<wbr class="">&view=diff</a><br class="">
>>>>> <br class="">
>>>>> ==============================<wbr class="">==============================<wbr class="">==================<br class="">
>>>>> --- cfe/trunk/unittests/Tooling/He<wbr class="">aderIncludesTest.cpp (original)<br class="">
>>>>> +++ cfe/trunk/unittests/Tooling/He<wbr class="">aderIncludesTest.cpp Mon Jun  4<br class="">
>>>>> 02:04:12 2018<br class="">
>>>>> @@ -7,7 +7,7 @@<br class="">
>>>>> //<br class="">
>>>>> <br class="">
>>>>> //===-------------------------<wbr class="">------------------------------<wbr class="">---------------===//<br class="">
>>>>> <br class="">
>>>>> -#include "clang/Tooling/Core/HeaderIncl<wbr class="">udes.h"<br class="">
>>>>> +#include "clang/Tooling/Inclusions/Head<wbr class="">erIncludes.h"<br class="">
>>>>> #include "../Tooling/ReplacementTest.h"<br class="">
>>>>> #include "../Tooling/RewriterTestContex<wbr class="">t.h"<br class="">
>>>>> #include "clang/Format/Format.h"<br class="">
>>>>> <br class="">
>>>>> <br class="">
>>>>> ______________________________<wbr class="">_________________<br class="">
>>>>> cfe-commits mailing list<br class="">
>>>>> <a href="mailto:cfe-commits@lists.llvm.org" target="_blank" class="">cfe-commits@lists.llvm.org</a><br class="">
>>>>> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits" rel="noreferrer" target="_blank" class="">http://lists.llvm.org/cgi-bin/<wbr class="">mailman/listinfo/cfe-commits</a><br class="">
>>>> ______________________________<wbr class="">_________________<br class="">
>>>> cfe-commits mailing list<br class="">
>>>> <a href="mailto:cfe-commits@lists.llvm.org" target="_blank" class="">cfe-commits@lists.llvm.org</a><br class="">
>>>> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits" rel="noreferrer" target="_blank" class="">http://lists.llvm.org/cgi-bin/<wbr class="">mailman/listinfo/cfe-commits</a><br class="">
>>> <br class="">
>>> ______________________________<wbr class="">_________________<br class="">
>>> cfe-commits mailing list<br class="">
>>> <a href="mailto:cfe-commits@lists.llvm.org" target="_blank" class="">cfe-commits@lists.llvm.org</a><br class="">
>>> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits" rel="noreferrer" target="_blank" class="">http://lists.llvm.org/cgi-bin/<wbr class="">mailman/listinfo/cfe-commits</a><br class="">
>> <br class="">
>> <br class="">
<br class="">
</div></div></blockquote></div><br class=""></div>
</div></div></blockquote></div><br class=""></div>
</div></blockquote></div><br class=""></body></html>