Skip to content
  1. Jan 03, 2018
    • Ivan Donchevskii's avatar
      [libclang] Support querying whether a declaration is invalid · 0b2f162d
      Ivan Donchevskii authored
      This is useful for e.g. highlighting purposes in an IDE.
      
      Patch by Nikolai Kosjar.
      
      Differential Revision: https://reviews.llvm.org/D40072
      
      llvm-svn: 321697
      0b2f162d
    • Alex Bradbury's avatar
      Fix build of WebAssembly and AVR backends after r321692 · 7c093bf1
      Alex Bradbury authored
      As experimental backends, I didn't have them configured to build in my local 
      build config.
      
      llvm-svn: 321696
      7c093bf1
    • Ivan Donchevskii's avatar
      [libclang] Add clang_getFileContents to libclang.exports · e7602ce3
      Ivan Donchevskii authored
      This is the follow up patch for rL319881 which introduced
      the function but did not put it into .exports file.
      
      llvm-svn: 321695
      e7602ce3
    • Alex Bradbury's avatar
      Fix incorrect documentation comment left after r321692 · 86b99cb5
      Alex Bradbury authored
      TargetRegistryInfo::createMCAsmBackend no longer takes a TheTriple parameter. 
      The majory of the TargetRegistryInfo::create* functions have no or very 
      limitied per-parameter doc comments, and adding a comment for the 
      MCSubtargetInfo, MCRegisterInfo and MCTargetOptions parameters seems like it 
      would add no real value beyond reading the function signature. As such, I've 
      just deleted the doc comment for TheTriple.
      
      llvm-svn: 321694
      86b99cb5
    • Alex Bradbury's avatar
      Update clang cc1as for createMCAsmBackend change in r321692 · a85e8bbe
      Alex Bradbury authored
      llvm-svn: 321693
      a85e8bbe
    • Alex Bradbury's avatar
      Thread MCSubtargetInfo through Target::createMCAsmBackend · b22f751f
      Alex Bradbury authored
      Currently it's not possible to access MCSubtargetInfo from a TgtMCAsmBackend. 
      D20830 threaded an MCSubtargetInfo reference through 
      MCAsmBackend::relaxInstruction, but this isn't the only function that would 
      benefit from access. This patch removes the Triple and CPUString arguments 
      from createMCAsmBackend and replaces them with MCSubtargetInfo.
      
      This patch just changes the interface without making any intentional 
      functional changes. Once in, several cleanups are possible:
      * Get rid of the awkward MCSubtargetInfo handling in ARMAsmBackend
      * Support 16-bit instructions when valid in MipsAsmBackend::writeNopData
      * Get rid of the CPU string parsing in X86AsmBackend and just use a SubtargetFeature for HasNopl
      * Emit 16-bit nops in RISCVAsmBackend::writeNopData if the compressed instruction set extension is enabled (see D41221)
      
      This change initially exposed PR35686, which has since been resolved in r321026.
      
      Differential Revision: https://reviews.llvm.org/D41349
      
      llvm-svn: 321692
      b22f751f
    • Roman Lebedev's avatar
      [Sema] -Wtautological-constant-compare is too good. Cripple it. · c5417aaf
      Roman Lebedev authored
      Summary:
      The diagnostic was mostly introduced in D38101 by me, as a reaction to wasting a lot of time, see [[ https://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20171009/206427.html | mail ]].
      However, the diagnostic is pretty dumb. While it works with no false-positives,
      there are some questionable cases that are diagnosed when one would argue that they should not be.
      
      The common complaint is that it diagnoses the comparisons between an `int` and
      `long` when compiling for a 32-bit target as tautological, but not when
      compiling for 64-bit targets. The underlying problem is obvious: data model.
      In most cases, 64-bit target is `LP64` (`int` is 32-bit, `long` and pointer are
      64-bit), and the 32-bit target is `ILP32` (`int`, `long`, and pointer are 32-bit).
      
      I.e. the common pattern is: (pseudocode)
      ```
      #include <limits>
      #include <cstdint>
      int main() {
        using T1 = long;
        using T2 = int;
      
        T1 r;
        if (r < std::numeric_limits<T2>::min()) {}
        if (r > std::numeric_limits<T2>::max()) {}
      }
      ```
      As an example, D39149 was trying to fix this diagnostic in libc++, and it was not well-received.
      
      This *could* be "fixed", by changing the diagnostics logic to something like
      `if the types of the values being compared are different, but are of the same size, then do diagnose`,
      and i even attempted to do so in D39462, but as @rjmccall rightfully commented,
      that implementation is incomplete to say the least.
      
      So to stop causing trouble, and avoid contaminating upcoming release, lets do this workaround:
      * move these three diags (`warn_unsigned_always_true_comparison`, `warn_unsigned_enum_always_true_comparison`, `warn_tautological_constant_compare`) into it's own `-Wtautological-constant-in-range-compare`
      * Disable them by default
      * Make them part of `-Wextra`
      * Additionally, give `warn_tautological_constant_compare` it's own flag `-Wtautological-type-limit-compare`.
        I'm not happy about that name, but i can't come up with anything better.
      
      This way all three of them can be enabled/disabled either altogether, or one-by-one.
      
      Reviewers: aaron.ballman, rsmith, smeenai, rjmccall, rnk, mclow.lists, dim
      
      Reviewed By: aaron.ballman, rsmith, dim
      
      Subscribers: thakis, compnerd, mehdi_amini, dim, hans, cfe-commits, rjmccall
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D41512
      
      llvm-svn: 321691
      c5417aaf
    • Amara Emerson's avatar
      [GlobalISel][Legalizer] Fix legalization of llvm.smul.with.overflow · 9de62130
      Amara Emerson authored
      Previously the code for handling G_SMULO didn't properly check for the signed
      multiply overflow, instead treating it the same as the unsigned G_UMULO.
      
      Fixes PR35800.
      
      llvm-svn: 321690
      9de62130
    • Marshall Clow's avatar
      12e17b19
    • Rafael Espindola's avatar
      Don't assume that size relocations are always constant. · b5153ef7
      Rafael Espindola authored
      llvm-svn: 321688
      b5153ef7
    • Marshall Clow's avatar
      Mark issue #2866 as "nothing to do" · bae5d279
      Marshall Clow authored
      llvm-svn: 321687
      bae5d279
    • Richard Smith's avatar
      PR35697: look at the first declaration when determining whether a function or · 99f54799
      Richard Smith authored
      variable is extern "C" in linkage calculations.
      
      llvm-svn: 321686
      99f54799
    • Marshall Clow's avatar
      Implement p0258r2: has_unique_object_representations · dd74d83f
      Marshall Clow authored
      llvm-svn: 321685
      dd74d83f
    • Rafael Espindola's avatar
      Produce relocations with weak undef if the section is RW. · 4b2350d7
      Rafael Espindola authored
      If a section is RW there is no reason to drop a relocation with a weak
      undefined symbol.
      
      llvm-svn: 321684
      4b2350d7
    • Richard Smith's avatar
      Fix and simplify handling of return type for (generic) lambda conversion... · 50e291ea
      Richard Smith authored
      Fix and simplify handling of return type for (generic) lambda conversion function to function pointer.
      
      Previously, we would:
       * compute the type of the conversion function and static invoker as a
         side-effect of template argument deduction for a conversion
       * re-compute the type as part of deduced return type deduction when building
         the conversion function itself
      
      Neither of these turns out to be quite correct. There are other ways to reach a
      declaration of the conversion function than in a conversion (such as an
      explicit call or friend declaration), and performing auto deduction causes the
      function type to be rebuilt in the context of the lambda closure type (which is
      different from the context in which it originally appeared, resulting in
      spurious substitution failures for constructs that are valid in one context but
      not the other, such as the use of an enclosing class's "this" pointer).
      
      This patch switches us to use a different strategy: as before, we use the
      declared type of the operator() to form the type of the conversion function and
      invoker, but we now populate that type as part of return type deduction for the
      conversion function. And the invoker is now treated as simply being an
      implementation detail of building the conversion function, and isn't given
      special treatment by template argument deduction for the conversion function
      any more.
      
      llvm-svn: 321683
      50e291ea
    • George Karpenkov's avatar
      [analyzer] do not crash with assertion on processing locations of bodyfarmed functions · 96625fdc
      George Karpenkov authored
      This addresses an issue introduced in r183451: since
      `removePiecesWithInvalidLocations` is called *after* `adjustCallLocations`,
      it is not necessary, and in fact harmful, to have this assertion in
      adjustCallLocations.
      
      Addresses rdar://36170689
      
      Differential Revision: https://reviews.llvm.org/D41680
      
      llvm-svn: 321682
      96625fdc
    • Jake Ehrlich's avatar
      [llvm-objcopy] Add support for visibility · 30d927a1
      Jake Ehrlich authored
      I have no clue how this was missed when symbol table support was added. This
      change ensures that the visibility of symbols is preserved by default.
      
      llvm-svn: 321681
      30d927a1
  2. Jan 02, 2018
Loading