Skip to content
  1. Feb 08, 2019
  2. Feb 07, 2019
  3. Feb 06, 2019
    • Lang Hames's avatar
      [ADT] Add a fallible_iterator wrapper. · 3e040e05
      Lang Hames authored
      A fallible iterator is one whose increment or decrement operations may fail.
      This would usually be supported by replacing the ++ and -- operators with
      methods that return error:
      
          class MyFallibleIterator {
          public:
            // ...
            Error inc();
            Errro dec();
            // ...
          };
      
      The downside of this style is that it no longer conforms to the C++ iterator
      concept, and can not make use of standard algorithms and features such as
      range-based for loops.
      
      The fallible_iterator wrapper takes an iterator written in the style above
      and adapts it to (mostly) conform with the C++ iterator concept. It does this
      by providing standard ++ and -- operator implementations, returning any errors
      generated via a side channel (an Error reference passed into the wrapper at
      construction time), and immediately jumping the iterator to a known 'end'
      value upon error. It also marks the Error as checked any time an iterator is
      compared with a known end value and found to be inequal, allowing early exit
      from loops without redundant error checking*.
      
      Usage looks like:
      
          MyFallibleIterator I = ..., E = ...;
      
          Error Err = Error::success();
          for (auto &Elem : make_fallible_range(I, E, Err)) {
            // Loop body is only entered when safe.
      
            // Early exits from loop body permitted without checking Err.
            if (SomeCondition)
              return;
      
          }
          if (Err)
            // Handle error.
      
      * Since failure causes a fallible iterator to jump to end, testing that a
        fallible iterator is not an end value implicitly verifies that the error is a
        success value, and so is equivalent to an error check.
      
      Reviewers: dblaikie, rupprecht
      
      Subscribers: mgorny, dexonsmith, kristina, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D57618
      
      llvm-svn: 353237
      3e040e05
  4. Feb 04, 2019
    • Leonard Chan's avatar
      [Intrinsic] Unsigned Fixed Point Multiplication Intrinsic · 68d428e5
      Leonard Chan authored
      Add an intrinsic that takes 2 unsigned integers with the scale of them
      provided as the third argument and performs fixed point multiplication on
      them.
      
      This is a part of implementing fixed point arithmetic in clang where some of
      the more complex operations will be implemented as intrinsics.
      
      Differential Revision: https://reviews.llvm.org/D55625
      
      llvm-svn: 353059
      68d428e5
    • Roman Lebedev's avatar
      [llvm-exegesis] Don't default to running&dumping all analyses to '-' · 21193f4b
      Roman Lebedev authored
      Summary:
      Up until the point i have looked in the source, i didn't even understood that
      i can disable 'cluster' output. I have always silenced it via ` &> /dev/null`.
      (And hoped it wasn't contributing much of the run time.)
      
      While i expect that it has it's use-cases i never once needed it so far.
      If i forget to silence it, console is completely flooded with that output.
      
      How about not expecting users to opt-out of analyses,
      but to explicitly specify the analyses that should be performed?
      
      Reviewers: courbet, gchatelet
      
      Reviewed By: courbet
      
      Subscribers: tschuett, RKSimon, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D57648
      
      llvm-svn: 353021
      21193f4b
  5. Feb 03, 2019
  6. Feb 02, 2019
  7. Feb 01, 2019
    • James Y Knight's avatar
      Hopefully fix a couple more sphinx doc errors. · 6e75c7e3
      James Y Knight authored
      These seem to only appear on the buildbot runner, and it looks like we
      tried to suppress them, but it's not working. Not sure why.
      
      llvm-svn: 352903
      6e75c7e3
    • James Y Knight's avatar
      Fix some sphinx doc errors. · 94b9709d
      James Y Knight authored
      llvm-svn: 352887
      94b9709d
    • James Henderson's avatar
      [doc]Update String Error documentation in Programmer Manual · fb3ca132
      James Henderson authored
      A while back, createStringError was added to provide easier construction
      of StringError instances, especially with formatting options. Prior to
      this patch, that the documentation only mentions the standard method of
      using it. Since createStringError is slightly shorter to type, and also
      provides the formatting options, this patch updates the Programmer's
      Manual to use the new function in its examples, and to mention the
      printf formatting options. It also fixes a small typo in one of the
      examples and removes the unnecessary make_error_code call.
      
      llvm-svn: 352846
      fb3ca132
    • JF Bastien's avatar
      Revert "Bump minimum toolchain version" · c6931ddc
      JF Bastien authored
      Looks like we still have a few bots that are sad. Let try to get them fixed!
      
      llvm-svn: 352835
      c6931ddc
    • JF Bastien's avatar
      Bump minimum toolchain version · 77074f9f
      JF Bastien authored
      Summary:
      The RFC on moving past C++11 got good traction:
        http://lists.llvm.org/pipermail/llvm-dev/2019-January/129452.html
      
      This patch therefore bumps the toolchain versions according to our policy:
        llvm.org/docs/DeveloperPolicy.html#toolchain
      
      Subscribers: mgorny, jkorous, dexonsmith, llvm-commits, mehdi_amini, jyknight, rsmith, chandlerc, smeenai, hans, reames, lattner, lhames, erichkeane
      
      Differential Revision: https://reviews.llvm.org/D57264
      
      llvm-svn: 352834
      77074f9f
    • James Y Knight's avatar
      [opaque pointer types] Add a FunctionCallee wrapper type, and use it. · 13680223
      James Y Knight authored
      Recommit r352791 after tweaking DerivedTypes.h slightly, so that gcc
      doesn't choke on it, hopefully.
      
      Original Message:
      The FunctionCallee type is effectively a {FunctionType*,Value*} pair,
      and is a useful convenience to enable code to continue passing the
      result of getOrInsertFunction() through to EmitCall, even once pointer
      types lose their pointee-type.
      
      Then:
      - update the CallInst/InvokeInst instruction creation functions to
        take a Callee,
      - modify getOrInsertFunction to return FunctionCallee, and
      - update all callers appropriately.
      
      One area of particular note is the change to the sanitizer
      code. Previously, they had been casting the result of
      `getOrInsertFunction` to a `Function*` via
      `checkSanitizerInterfaceFunction`, and storing that. That would report
      an error if someone had already inserted a function declaraction with
      a mismatching signature.
      
      However, in general, LLVM allows for such mismatches, as
      `getOrInsertFunction` will automatically insert a bitcast if
      needed. As part of this cleanup, cause the sanitizer code to do the
      same. (It will call its functions using the expected signature,
      however they may have been declared.)
      
      Finally, in a small number of locations, callers of
      `getOrInsertFunction` actually were expecting/requiring that a brand
      new function was being created. In such cases, I've switched them to
      Function::Create instead.
      
      Differential Revision: https://reviews.llvm.org/D57315
      
      llvm-svn: 352827
      13680223
    • JF Bastien's avatar
      Revert "Bump minimum toolchain version" · e2dedd55
      JF Bastien authored
      A handful of bots are still breaking, either because I missed them in my audit,
      they were offline, or something else. I'm contacting their authors, but I'll
      revert for now and re-commit later.
      
      llvm-svn: 352814
      e2dedd55
    • JF Bastien's avatar
      DeveloperPolicy: update toolchain with sample RFC / patch · d5dbe831
      JF Bastien authored
      As was suggested when the policy originally went in.
      
      llvm-svn: 352812
      d5dbe831
    • JF Bastien's avatar
      Bump minimum toolchain version · 62bb58a3
      JF Bastien authored
      Summary:
      The RFC on moving past C++11 got good traction:
        http://lists.llvm.org/pipermail/llvm-dev/2019-January/129452.html
      
      This patch therefore bumps the toolchain versions according to our policy:
        llvm.org/docs/DeveloperPolicy.html#toolchain
      
      Subscribers: mgorny, jkorous, dexonsmith, llvm-commits, mehdi_amini, jyknight, rsmith, chandlerc, smeenai, hans, reames, lattner, lhames, erichkeane
      
      Differential Revision: https://reviews.llvm.org/D57264
      
      llvm-svn: 352811
      62bb58a3
  8. Jan 31, 2019
    • James Y Knight's avatar
      Revert "[opaque pointer types] Add a FunctionCallee wrapper type, and use it." · fadf2506
      James Y Knight authored
      This reverts commit f47d6b38 (r352791).
      
      Seems to run into compilation failures with GCC (but not clang, where
      I tested it). Reverting while I investigate.
      
      llvm-svn: 352800
      fadf2506
    • James Y Knight's avatar
      [opaque pointer types] Add a FunctionCallee wrapper type, and use it. · f47d6b38
      James Y Knight authored
      The FunctionCallee type is effectively a {FunctionType*,Value*} pair,
      and is a useful convenience to enable code to continue passing the
      result of getOrInsertFunction() through to EmitCall, even once pointer
      types lose their pointee-type.
      
      Then:
      - update the CallInst/InvokeInst instruction creation functions to
        take a Callee,
      - modify getOrInsertFunction to return FunctionCallee, and
      - update all callers appropriately.
      
      One area of particular note is the change to the sanitizer
      code. Previously, they had been casting the result of
      `getOrInsertFunction` to a `Function*` via
      `checkSanitizerInterfaceFunction`, and storing that. That would report
      an error if someone had already inserted a function declaraction with
      a mismatching signature.
      
      However, in general, LLVM allows for such mismatches, as
      `getOrInsertFunction` will automatically insert a bitcast if
      needed. As part of this cleanup, cause the sanitizer code to do the
      same. (It will call its functions using the expected signature,
      however they may have been declared.)
      
      Finally, in a small number of locations, callers of
      `getOrInsertFunction` actually were expecting/requiring that a brand
      new function was being created. In such cases, I've switched them to
      Function::Create instead.
      
      Differential Revision: https://reviews.llvm.org/D57315
      
      llvm-svn: 352791
      f47d6b38
    • Kostya Serebryany's avatar
      [libFuzzer] update docs · 025e03d6
      Kostya Serebryany authored
      llvm-svn: 352715
      025e03d6
  9. Jan 30, 2019
  10. Jan 29, 2019
  11. Jan 28, 2019
  12. Jan 25, 2019
    • Javed Absar's avatar
      [TblGen][NFC] Fix documentation formatting · 2ee81933
      Javed Absar authored
      llvm-svn: 352212
      2ee81933
    • James Henderson's avatar
      [llvm-symbolizer] Add switch to adjust addresses by fixed offset · 759d5e67
      James Henderson authored
      If a stack trace or similar has a list of addresses from an executable
      or DSO loaded at a variable address (e.g. due to ASLR), the addresses
      will not directly correspond to the addresses stored in the object file.
      If a user wishes to use llvm-symbolizer, they have to subtract the load
      address from every address. This is somewhat inconvenient, especially as
      the output of --print-address will result in the adjusted address being
      listed, rather than the address coming from the stack trace, making it
      harder to map results between the two.
      
      This change adds a new switch to llvm-symbolizer --adjust-vma which
      takes an offset, which is then used to automatically do this
      calculation. The printed address remains the input address (allowing for
      easy mapping), whilst the specified offset is applied to the addresses
      when performing the lookup.
      
      The switch is conceptually similar to llvm-objdump's new switch of the
      same name (see D57051), which in turn mirrors a GNU switch. There is no
      equivalent switch in addr2line.
      
      Reviewed by: grimar
      
      Differential Revision: https://reviews.llvm.org/D57151
      
      llvm-svn: 352195
      759d5e67
    • Javed Absar's avatar
      [TblGen] Extend !if semantics through new feature !cond · a3e3d852
      Javed Absar authored
      This patch extends TableGen language with !cond operator.
      Instead of embedding !if inside !if which can get cumbersome,
      one can now use !cond.
      Below is an example to convert an integer 'x' into a string:
      
          !cond(!lt(x,0) : "Negative",
                !eq(x,0) : "Zero",
                !eq(x,1) : "One,
                1        : "MoreThanOne")
      
      Reviewed By: hfinkel, simon_tatham, greened
      Differential Revision: https://reviews.llvm.org/D55758
      
      llvm-svn: 352185
      a3e3d852
  13. Jan 24, 2019
  14. Jan 23, 2019
    • James Henderson's avatar
      [llvm-symbolizer] Improve compatibility of --functions with GNU addr2line · 25ce596c
      James Henderson authored
      This fixes https://bugs.llvm.org/show_bug.cgi?id=40072.
      
      GNU addr2line's --functions switch is off by default, has a short alias
      of -f, and does not take an argument. This patch changes llvm-symbolizer
      to allow the second and third point (changing the default behaviour may
      have negative impacts on users). If the option is missing a value, it
      now treats it as "linkage".
      
      This change does cause one previously valid command-line to behave
      differently. Before --functions <value> was accepted, but now only
      --functions=<value> is allowed (as well as --functions). The old
      behaviour will result in the value being treated as a positional
      argument.
      
      The previous testing for --functions=short has been pulled out into a
      new test that also tests the other accepted values and option formats.
      
      Reviewed by: ruiu
      
      Differential Revision: https://reviews.llvm.org/D57049
      
      llvm-svn: 351968
      25ce596c
  15. Jan 22, 2019
    • Davide Italiano's avatar
      [Docs] Add a note clarifying how to get good test performances. · 078fb93c
      Davide Italiano authored
      Differential Revision:  https://reviews.llvm.org/D56337
      
      llvm-svn: 351885
      078fb93c
    • Joel E. Denny's avatar
      [FileCheck] Suppress old -v/-vv diags if dumping input · 352695c3
      Joel E. Denny authored
      The old diagnostic form of the trace produced by -v and -vv looks
      like:
      
      ```
      check1:1:8: remark: CHECK: expected string found in input
      CHECK: abc
             ^
      <stdin>:1:3: note: found here
      ; abc def
        ^~~
      ```
      
      When dumping annotated input is requested (via -dump-input), I find
      that this old trace is not useful and is sometimes harmful:
      
      1. The old trace is mostly redundant because the same basic
         information also appears in the input dump's annotations.
      
      2. The old trace buries any error diagnostic between it and the input
         dump, but I find it useful to see any error diagnostic up front.
      
      3. FILECHECK_OPTS=-dump-input=fail requests annotated input dumps only
         for failed FileCheck calls.  However, I have to also add -v or -vv
         to get a full set of annotations, and that can produce massive
         output from all FileCheck calls in all tests.  That's a real
         problem when I run this in the IDE I use, which grinds to a halt as
         it tries to capture all that output.
      
      When -dump-input=fail|always, this patch suppresses the old trace from
      -v or -vv.  Error diagnostics still print as usual.  If you want the
      old trace, perhaps to see variable expansions, you can set
      -dump-input=none (the default).
      
      Reviewed By: probinson
      
      Differential Revision: https://reviews.llvm.org/D55825
      
      llvm-svn: 351881
      352695c3
    • Matt Arsenault's avatar
      Reapply "IR: Add fp operations to atomicrmw" · 39508331
      Matt Arsenault authored
      This reapplies commits r351778 and r351782 with
      RISCV test fixes.
      
      llvm-svn: 351850
      39508331
Loading