Skip to content
Snippets Groups Projects
  1. Apr 18, 2017
    • Richard Smith's avatar
      Fix mishandling of escaped newlines followed by newlines or nuls. · 9ea71113
      Richard Smith authored
      Previously, if an escaped newline was followed by a newline or a nul, we'd lex
      the escaped newline as a bogus space character. This led to a bunch of
      different broken corner cases:
      
      For the pattern "\\\n\0#", we would then have a (horizontal) space whose
      spelling ends in a newline, and would decide that the '#' is at the start of a
      line, and incorrectly start preprocessing a directive in the middle of a
      logical source line. If we were already in the middle of a directive, this
      would result in our attempting to process multiple directives at the same time!
      This resulted in crashes, asserts, and hangs on invalid input, as discovered by
      fuzz-testing.
      
      For the pattern "\\\n" at EOF (with an implicit following nul byte), we would
      produce a bogus trailing space character with spelling "\\\n". This was mostly
      harmless, but would lead to clang-format getting confused and misformatting in
      rare cases. We now produce a trailing EOF token with spelling "\\\n",
      consistent with our handling for other similar cases -- an escaped newline is
      always part of the token containing the next character, if any.
      
      For the pattern "\\\n\n", this was somewhat more benign, but would produce an
      extraneous whitespace token to clients who care about preserving whitespace.
      However, it turns out that our lexing for line comments was relying on this bug
      due to an off-by-one error in its computation of the end of the comment, on the
      slow path where the comment might contain escaped newlines.
      
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@300515 91177308-0d34-0410-b5e6-96231b3b80d8
      9ea71113
    • Eric Fiselier's avatar
      Rename coroutine warning when unhandled_exception() is missing · b1515354
      Eric Fiselier authored
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@300513 91177308-0d34-0410-b5e6-96231b3b80d8
      b1515354
    • Eric Fiselier's avatar
      Revert r300504 - [coroutines] Fix rebuilding of implicit and dependent coroutine statements. · bf2068e4
      Eric Fiselier authored
      I have no idea what's happening here. The tests that fail on all of the bots
      pass on my machine. Further investigation needed.
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@300511 91177308-0d34-0410-b5e6-96231b3b80d8
      bf2068e4
    • Vedant Kumar's avatar
      [ubsan] Skip null checks if they are constant-folded away · ebaaf85a
      Vedant Kumar authored
      The IR builder can constant-fold null checks if the pointer operand
      points to a constant. If the "is-non-null" check is folded away to
      "true", don't emit the null check + branch.
      
      Testing: check-clang, check-ubsan.
      
      This slightly reduces the amount of null checks we emit when compiling
      X86ISelLowering.cpp. Here are the numbers from patched/unpatched clangs
      based on r300371.
      
        -------------------------------------
        | Setup          | # of null checks |
        -------------------------------------
        | unpatched, -O0 |            25251 |
        | patched, -O0   |            23925 | (-5.3%)
        -------------------------------------
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@300509 91177308-0d34-0410-b5e6-96231b3b80d8
      ebaaf85a
    • Vedant Kumar's avatar
      [ubsan] Skip null checks on pointers to the start of an alloca · ae2d1b7d
      Vedant Kumar authored
      Pointers to the start of an alloca are non-null, so we don't need to
      emit runtime null checks for them.
      
      Testing: check-clang, check-ubsan.
      
      This significantly reduces the amount of null checks we emit when
      compiling X86ISelLowering.cpp. Here are the numbers from patched /
      unpatched clangs based on r300371.
      
        -------------------------------------
        | Setup          | # of null checks |
        -------------------------------------
        | unpatched, -O0 |            45439 |
        | patched, -O0   |            25251 | (-44.4%)
        -------------------------------------
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@300508 91177308-0d34-0410-b5e6-96231b3b80d8
      ae2d1b7d
    • Eric Fiselier's avatar
      [coroutines] Fix rebuilding of implicit and dependent coroutine statements. · 1772bdb2
      Eric Fiselier authored
      Summary:
      Certain implicitly generated coroutine statements, such as the calls to 'return_value()' or `return_void()` or `get_return_object_on_allocation_failure()`, cannot be built until the promise type is no longer dependent. This means they are not built until after the coroutine body statement has been transformed.
      
      This patch fixes an issue where these statements would never be built for coroutine templates.
      
      It also fixes a small issue where diagnostics about `get_return_object_on_allocation_failure()` were incorrectly suppressed. 
      
      Reviewers: rsmith, majnemer, GorNishanov, aaron.ballman
      
      Reviewed By: GorNishanov
      
      Subscribers: cfe-commits
      
      Differential Revision: https://reviews.llvm.org/D31487
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@300504 91177308-0d34-0410-b5e6-96231b3b80d8
      1772bdb2
  2. Apr 17, 2017
  3. Apr 16, 2017
  4. Apr 15, 2017
  5. Apr 14, 2017
Loading