Skip to content
Snippets Groups Projects
  1. Oct 10, 2017
  2. Oct 06, 2017
  3. Sep 29, 2017
  4. Sep 28, 2017
  5. Sep 26, 2017
  6. Sep 23, 2017
  7. Sep 22, 2017
  8. Sep 19, 2017
  9. Sep 16, 2017
  10. Sep 15, 2017
  11. Sep 14, 2017
  12. Sep 13, 2017
  13. Sep 12, 2017
  14. Sep 11, 2017
  15. Sep 10, 2017
  16. Sep 08, 2017
  17. Sep 07, 2017
  18. Sep 05, 2017
  19. Aug 31, 2017
  20. Aug 30, 2017
    • Hans Wennborg's avatar
      docs: typo fix · c8ef6a8b
      Hans Wennborg authored
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312149 91177308-0d34-0410-b5e6-96231b3b80d8
      c8ef6a8b
    • Krasimir Georgiev's avatar
      clang-format: Add preprocessor directive indentation · 31c7a3b6
      Krasimir Georgiev authored
      Summary:
      This is an implementation for [bug 17362](https://bugs.llvm.org/attachment.cgi?bugid=17362) which adds support for indenting preprocessor statements inside if/ifdef/endif. This takes previous work from fmauch (https://github.com/fmauch/clang/tree/preprocessor_indent) and makes it into a full feature.
      The context of this patch is that I'm a VMware intern, and I implemented this because VMware needs the feature. As such, some decisions were made based on what VMware wants, and I would appreciate suggestions on expanding this if necessary to use-cases other people may want.
      
      This adds a new enum config option, `IndentPPDirectives`. Values are:
      
      * `PPDIS_None` (in config: `None`):
      ```
          #if FOO
          #if BAR
          #include <foo>
          #endif
          #endif
      ```
      * `PPDIS_AfterHash` (in config: `AfterHash`):
      ```
          #if FOO
          #  if BAR
          #    include <foo>
          #  endif
          #endif
      ```
      This is meant to work whether spaces or tabs are used for indentation. Preprocessor indentation is independent of indentation for non-preprocessor lines.
      
      Preprocessor indentation also attempts to ignore include guards with the checks:
      1. Include guards cover the entire file
      2. Include guards don't have `#else`
      3. Include guards begin with
      ```
      #ifndef <var>
      #define <var>
      ```
      
      This patch allows `UnwrappedLineParser::PPBranchLevel` to be decremented to -1 (the initial value is -1) so the variable can be used for indent tracking.
      
      Defects:
      * This patch does not handle the case where there's code between the `#ifndef` and `#define` but all other conditions hold. This is because when the #define line is parsed, `UnwrappedLineParser::Lines` doesn't hold the previous code line yet, so we can't detect it. This is out of the scope of this patch.
      
      * This patch does not handle cases where legitimate lines may be outside an include guard. Examples are `#pragma once` and `#pragma GCC diagnostic`, or anything else that does not change the meaning of the file if it's included multiple times.
      
      * This does not detect when there is a single non-preprocessor line in front of an include-guard-like structure where other conditions hold because `ScopedLineState` hides the line.
      
      * Preprocessor indentation throws off `TokenAnnotator::setCommentLineLevels` so the indentation of comments immediately before indented preprocessor lines is toggled on each run. Fixing this issue appears to be a major change and too much complexity for this patch.
      
      Contributed by @euhlmann!
      
      Reviewers: djasper, klimek, krasimir
      
      Reviewed By: djasper, krasimir
      
      Subscribers: krasimir, mzeren-vmw, cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D35955
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312125 91177308-0d34-0410-b5e6-96231b3b80d8
      31c7a3b6
    • Victor Leschuk's avatar
      Revert r312105 [modules] Add ability to specify module name to module file mapping · 6f7f03cc
      Victor Leschuk authored
      Looks like it breaks win10 builder.
      
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312112 91177308-0d34-0410-b5e6-96231b3b80d8
      6f7f03cc
    • Boris Kolpackov's avatar
      [docs] Regenerate command line options reference · 1bf18299
      Boris Kolpackov authored
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312106 91177308-0d34-0410-b5e6-96231b3b80d8
      1bf18299
    • Boris Kolpackov's avatar
      [modules] Add ability to specify module name to module file mapping · ca9ec867
      Boris Kolpackov authored
      Extend the -fmodule-file option to support the [<name>=]<file> value format.
      If the name is omitted, then the old semantics is preserved (the module file
      is loaded whether needed or not). If the name is specified, then the mapping
      is treated as just another prebuilt module search mechanism, similar to
      -fprebuilt-module-path, and the module file is only loaded if actually used
      (e.g., via import). With one exception: this mapping also overrides module
      file references embedded in other modules (which can be useful if module files
      are moved/renamed as often happens during remote compilation).
      
      This override semantics requires some extra work: we now store the module name
      in addition to the file name in the serialized AST representation.
      
      Reviewed By: rsmith
      
      Differential Revision: https://reviews.llvm.org/D35020
      
      
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312105 91177308-0d34-0410-b5e6-96231b3b80d8
      ca9ec867
  21. Aug 27, 2017
  22. Aug 25, 2017
  23. Aug 12, 2017
  24. Aug 11, 2017
  25. Aug 10, 2017
    • Alexander Potapenko's avatar
      [sanitizer-coverage] Change cmp instrumentation to distinguish const operands · 1956004b
      Alexander Potapenko authored
      This implementation of SanitizerCoverage instrumentation inserts different
      callbacks depending on constantness of operands:
      
        1. If both operands are non-const, then a usual
           __sanitizer_cov_trace_cmp[1248] call is inserted.
        2. If exactly one operand is const, then a
           __sanitizer_cov_trace_const_cmp[1248] call is inserted. The first
           argument of the call is always the constant one.
        3. If both operands are const, then no callback is inserted.
      
      This separation comes useful in fuzzing when tasks like "find one operand
      of the comparison in input arguments and replace it with the other one"
      have to be done. The new instrumentation allows us to not waste time on
      searching the constant operands in the input.
      
      Patch by Victor Chibotaru.
      
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@310600 91177308-0d34-0410-b5e6-96231b3b80d8
      1956004b
Loading