Skip to content
  1. Nov 08, 2013
    • Alp Toker's avatar
      clang-format: Write files atomically · 07ce1d02
      Alp Toker authored
      Switch clang-format over to Rewriter::overwriteChangedFiles().
      
      The previous implementation was attempting to stream back directly to the
      original file and failing if it was already memory mapped by MemoryBuffer,
      an operation unsupported by Windows.
      
      MemoryBuffer generally mmaps files larger than the physical page size so
      this will have been difficult to reproduce consistently.
      
      This change also reduces flicker in code editors and IDEs on all platforms
      when reformatting in-place.
      
      Note that other incorrect uses of MemoryBuffer exist in LLVM/clang and
      will need a similar fix.
      
      A test should be added for Windows when libFormat performance issues are
      fixed (it takes longer than a day to format a 1MB file at present!)
      
      llvm-svn: 194250
      07ce1d02
  2. Oct 25, 2013
  3. Oct 11, 2013
  4. Oct 08, 2013
    • Daniel Jasper's avatar
      clang-format: Don't exit with failure on empty files. · e8845ad4
      Daniel Jasper authored
      Also let clang-format-diff.py detect errors based on clang-format's
      return code. Otherwise messages like "Can't find usable .clang-format,
      falling back to LLVM style" can make it fail, which might be undesired.
      
      Patch by Alp Toker. Thank you!
      
      llvm-svn: 192184
      e8845ad4
  5. Oct 02, 2013
    • Daniel Jasper's avatar
      clang-format: Fix clang-format-diff.py according to diff specification. · 164c8e18
      Daniel Jasper authored
      Patch by Alp Toker. Many thanks!
      
      Original descriptions:
      clang-format-diff incorrectly modifies unchanged lines due to an error
      in diff parsing.
      
      The unified diff format has a default line change count of 1, and 0 may
      be specified to indicate that no lines have been added. This patch
      updates the parser to accurately reflect the diff specification.
      
      This also has the benefit of stabilising the operation so it will
      produce the same output when run multiple times on the same changeset,
      which was previously not the case.
      
      No tests added because this script is not currently tested (though we
      should look into that!)
      
      llvm-svn: 191820
      164c8e18
  6. Sep 30, 2013
  7. Sep 21, 2013
  8. Sep 18, 2013
  9. Sep 13, 2013
    • Daniel Jasper's avatar
      clang-format: Add -assume-filename option for editor integrations. · e488f5dd
      Daniel Jasper authored
      With -style=file, clang-format now starts to search for a .clang-format
      file starting at the file given with -assume-filename if it reads from
      stdin. Otherwise, it would start searching from the current directory,
      which is not helpful for editor integrations.
      
      Also changed vim, emacs and sublime integrations to actually make use of
      this flag.
      
      This fixes llvm.org/PR17072.
      
      llvm-svn: 190691
      e488f5dd
  10. Sep 10, 2013
  11. Sep 02, 2013
  12. Aug 01, 2013
  13. Jul 22, 2013
  14. Jul 21, 2013
    • Daniel Jasper's avatar
      clang-format: Smarter replacement in the vim integration. · 68c03c82
      Daniel Jasper authored
      With this fix, only changed regions will be replaced in vim's buffer.
      Thereby, marks should mostly be left intact. Furthermore, this is a
      better fix for the performance problem in conjunction with
      'foldmethod=syntax' (see r186660).
      
      llvm-svn: 186789
      68c03c82
  15. Jul 20, 2013
  16. Jul 19, 2013
  17. Jul 16, 2013
  18. Jul 03, 2013
  19. Jul 02, 2013
    • Daniel Jasper's avatar
      Fix ranges computed by git clang-format. · a3fc21a0
      Daniel Jasper authored
      Before, the computed byte range would include the trailing newline.
      clang-format on the other hand counts whitespace as belonging to the
      following token, so that git-clang-format inadvertendly reformats the
      first unmodified line as well.
      
      It is not entirely clear whether clang-format's behavior itself should
      be modified, but for now this seems to be a safe change.
      
      llvm-svn: 185423
      a3fc21a0
  20. Jun 28, 2013
    • Alexander Kornienko's avatar
      Use lexing mode based on FormatStyle.Standard. · 1e80887d
      Alexander Kornienko authored
      Summary:
      Some valid pre-C++11 constructs change meaning when lexed in C++11
      mode, e.g.
      #define x(_a) printf("foo"_a);
      (example from http://llvm.org/bugs/show_bug.cgi?id=16342). "foo"_a is treated as
      a user-defined string literal when parsed in C++11 mode.
      In order to deal with this correctly, we need to set lexing mode according to
      which standard the code conforms to. We already have a configuration value for
      this (FormatStyle.Standard), which seems to be appropriate to use in this case
      as well.
      
      Reviewers: klimek
      
      CC: cfe-commits, gribozavr
      
      Differential Revision: http://llvm-reviews.chandlerc.com/D1028
      
      llvm-svn: 185149
      1e80887d
  21. Jun 14, 2013
    • Reid Kleckner's avatar
      [Driver] Refactor clang driver to use LLVM's Option library · 898229ab
      Reid Kleckner authored
      The big changes are:
      - Deleting Driver/(Arg|Opt)*
      - Rewriting includes to llvm/Option/ and re-sorting
      - 'using namespace llvm::opt' in clang::driver
      - Fixing the autoconf build by adding option everywhere
      
      As discussed in the review, this change includes using directives in
      header files.  I'll make follow up changes to remove those in favor of
      name specifiers.
      
      Reviewers: espindola
      
      Differential Revision: http://llvm-reviews.chandlerc.com/D975
      
      llvm-svn: 183989
      898229ab
  22. Jun 11, 2013
  23. Jun 10, 2013
  24. May 30, 2013
  25. May 23, 2013
  26. May 21, 2013
  27. May 19, 2013
  28. May 16, 2013
  29. May 14, 2013
    • Daniel Jasper's avatar
      Update clang-format emacs integration. · 6e3506f2
      Daniel Jasper authored
      - Remove free variables
      - Add function clang-format-buffer, e.g. for before-save-hooks
      - Wrap restoring windows in an unwind-protect
      
      Patch by Stephen Gildea!
      
      llvm-svn: 181766
      6e3506f2
  30. May 10, 2013
Loading