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 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
  3. Sep 30, 2013
  4. 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
  5. Sep 10, 2013
  6. Sep 02, 2013
  7. Jul 19, 2013
  8. Jul 16, 2013
  9. Jul 03, 2013
  10. 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
  11. May 21, 2013
  12. May 19, 2013
  13. May 10, 2013
  14. May 06, 2013
  15. Apr 24, 2013
    • Alexander Kornienko's avatar
      clang-format support for multiple input files. · 3fbee010
      Alexander Kornienko authored
      Summary:
      Added support for multiple input files, that can be used both with and
      without in-place edit (-i) option. Added checks for -offset and -length options:
      don't allow them on multiple files, check that they don't fall outside input
      file, made both options unsigned, so that there's no need to check for negative
      values. Removed "-1 can be used for end-of-file" from -length description.
      
      Reviewers: djasper, klimek
      
      Reviewed By: djasper
      
      CC: cfe-commits
      
      Differential Revision: http://llvm-reviews.chandlerc.com/D719
      
      llvm-svn: 180185
      3fbee010
  16. Apr 08, 2013
  17. Mar 20, 2013
Loading