Skip to content
  1. Feb 01, 2019
    • Brian Gesiak's avatar
      [SemaCXX] Param diagnostic matches overload logic · 3aba9fd6
      Brian Gesiak authored
      Summary:
      Given the following test program:
      
      ```
      class C {
      public:
        int A(int a, int& b);
      };
      
      int C::A(const int a, int b) {
        return a * b;
      }
      ```
      
      Clang would produce an error message that correctly diagnosed the
      redeclaration of `C::A` to not match the original declaration (the
      parameters to the two declarations do not match -- the original takes an
      `int &` as its 2nd parameter, but the redeclaration takes an `int`). However,
      it also produced a note diagnostic that inaccurately pointed to the
      first parameter, claiming that `const int` in the redeclaration did not
      match the unqualified `int` in the original. The diagnostic is
      misleading because it has nothing to do with why the program does not
      compile.
      
      The logic for checking for a function overload, in
      `Sema::FunctionParamTypesAreEqual`, discards cv-qualifiers before
      checking whether the types are equal. Do the same when producing the
      overload diagnostic.
      
      Reviewers: rsmith
      
      Reviewed By: rsmith
      
      Subscribers: cpplearner, cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D57032
      
      llvm-svn: 352831
      3aba9fd6
    • James Y Knight's avatar
      Fix compilation of examples after 13680223 / r352827 · 473e3420
      James Y Knight authored
      Who knew...they're not built by default or as part of the tests.
      
      llvm-svn: 352830
      473e3420
    • Julian Lettner's avatar
      [Sanitizers] UBSan unreachable incompatible with ASan in the presence of `noreturn` calls · b6c06dc2
      Julian Lettner authored
      Summary:
      UBSan wants to detect when unreachable code is actually reached, so it
      adds instrumentation before every unreachable instruction. However, the
      optimizer will remove code after calls to functions marked with
      noreturn. To avoid this UBSan removes noreturn from both the call
      instruction as well as from the function itself. Unfortunately, ASan
      relies on this annotation to unpoison the stack by inserting calls to
      _asan_handle_no_return before noreturn functions. This is important for
      functions that do not return but access the the stack memory, e.g.,
      unwinder functions *like* longjmp (longjmp itself is actually
      "double-proofed" via its interceptor). The result is that when ASan and
      UBSan are combined, the noreturn attributes are missing and ASan cannot
      unpoison the stack, so it has false positives when stack unwinding is
      used.
      
      Changes:
      Clang-CodeGen now directly insert calls to `__asan_handle_no_return`
      when a call to a noreturn function is encountered and both
      UBsan-unreachable and ASan are enabled. This allows UBSan to continue
      removing the noreturn attribute from functions without any changes to
      the ASan pass.
      
      Previously generated code:
      ```
        call void @longjmp
        call void @__asan_handle_no_return
        call void @__ubsan_handle_builtin_unreachable
      ```
      
      Generated code (for now):
      ```
        call void @__asan_handle_no_return
        call void @longjmp
        call void @__asan_handle_no_return
        call void @__ubsan_handle_builtin_unreachable
      ```
      
      rdar://problem/40723397
      
      Reviewers: delcypher, eugenis, vsk
      
      Differential Revision: https://reviews.llvm.org/D57278
      
      > llvm-svn: 352690
      
      llvm-svn: 352829
      b6c06dc2
    • Sam Clegg's avatar
      [WebAssembly] Support imports from custom module names · 7cc07531
      Sam Clegg authored
      Fixes: https://bugs.llvm.org/show_bug.cgi?id=37168
      
      This is only a first pass at supporting these custom import
      modules.  In the long run we most likely want to treat these
      kinds of symbols very differently.  For example, it should not
      be possible to resolve such as symbol at static link type.
      
      Differential Revision: https://reviews.llvm.org/D45796
      
      llvm-svn: 352828
      7cc07531
    • 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
    • Fangrui Song's avatar
      [ELF] Support --{,no-}allow-shlib-undefined · b4744d30
      Fangrui Song authored
      Summary:
      In ld.bfd/gold, --no-allow-shlib-undefined is the default when linking
      an executable. This patch implements a check to error on undefined
      symbols in a shared object, if all of its DT_NEEDED entries are seen.
      
      Our approach resembles the one used in gold, achieves a good balance to
      be useful but not too smart (ld.bfd traces all DSOs and emulates the
      behavior of a dynamic linker to catch more cases).
      
      The error is issued based on the symbol table, different from undefined
      reference errors issued for relocations. It is most effective when there
      are DSOs that were not linked with -z defs (e.g. when static sanitizers
      runtime is used).
      
      gold has a comment that some system libraries on GNU/Linux may have
      spurious undefined references and thus system libraries should be
      excluded (https://sourceware.org/bugzilla/show_bug.cgi?id=6811). The
      story may have changed now but we make --allow-shlib-undefined the
      default for now. Its interaction with -shared can be discussed in the
      future.
      
      Reviewers: ruiu, grimar, pcc, espindola
      
      Reviewed By: ruiu
      
      Subscribers: joerg, emaste, arichardson, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D57385
      
      llvm-svn: 352826
      b4744d30
    • Sam Clegg's avatar
      Fix names of functions in TargetOptionsCommandFlags.h. NFC. · dfbd1903
      Sam Clegg authored
      Differential Revision: https://reviews.llvm.org/D57555
      
      llvm-svn: 352825
      dfbd1903
    • George Karpenkov's avatar
      [analyzer] [RetainCountChecker] Fix object type for CF/Obj-C bridged casts · b6c6ab31
      George Karpenkov authored
      Having an incorrect type for a cast causes the checker to incorrectly
      dismiss the operation under ARC, leading to a false positive
      use-after-release on the test.
      
      rdar://47709885
      
      Differential Revision: https://reviews.llvm.org/D57557
      
      llvm-svn: 352824
      b6c6ab31
    • Peter Collingbourne's avatar
      Mark __rela_iplt_{start,end} as weak. · 6fa43f8b
      Peter Collingbourne authored
      Should fix non-lld links.
      
      llvm-svn: 352823
      6fa43f8b
    • Akira Hatanaka's avatar
      Revert "[Sema] Make canPassInRegisters return true if the CXXRecordDecl passed" · 9e671831
      Akira Hatanaka authored
      This reverts commit r350920 as it is not clear whether we should force a
      class to be returned in registers when copy and move constructors are
      both deleted.
      
      For more background, see the following discussion:
      http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20190128/259907.html
      
      llvm-svn: 352822
      9e671831
    • Sanjay Patel's avatar
      [x86] adjust test to show both add/inc options; NFC · ef9a3881
      Sanjay Patel authored
      If we're optimizing for size, that overrides the subtarget
      feature, so we would always produce 'inc' if we matched
      this pattern.
      
      llvm-svn: 352821
      ef9a3881
    • Sanjay Patel's avatar
      [x86] add test for missed opportunity to use 'inc'; NFC · da45d68a
      Sanjay Patel authored
      Another pattern exposed in D57516.
      
      llvm-svn: 352820
      da45d68a
    • Kostya Serebryany's avatar
      ae667c49
    • Kostya Serebryany's avatar
      [sanitizer-coverage] prune trace-cmp instrumentation for CMP isntructions that... · a78a44d4
      Kostya Serebryany authored
      [sanitizer-coverage] prune trace-cmp instrumentation for CMP isntructions that feed into the backedge branch. Instrumenting these CMP instructions is almost always useless (and harmful) for fuzzing
      
      llvm-svn: 352818
      a78a44d4
    • Matt Arsenault's avatar
      GlobalISel: Fix MMO creation with non-power-of-2 mem size · 50d6579b
      Matt Arsenault authored
      It should probably just be mandatory for getTgtMemIntrinsic to return
      the alignment.
      
      llvm-svn: 352817
      50d6579b
    • Peter Collingbourne's avatar
      hwasan: Add __hwasan_init_static() function. · 886b7cc1
      Peter Collingbourne authored
      This function initializes enough of the runtime to be able to run
      instrumented code in a statically linked executable. It replaces
      __hwasan_shadow_init() which wasn't doing enough initialization for
      instrumented code that uses either TLS or IFUNC to work.
      
      Differential Revision: https://reviews.llvm.org/D57490
      
      llvm-svn: 352816
      886b7cc1
    • Jonathan Metzman's avatar
      [libFuzzer][Windows] Temporarily disable value-profile-cmp2.test on Win · 6f94a033
      Jonathan Metzman authored
      Summary:
      Temporarily disable value-profile-cmp2.test on Win.
      https://reviews.llvm.org/D57465 causes the test to fail on Win.
      However, it seems that the behavior of libFuzzer on Win was broken
      before that patch. It crashes in the exit handler when not used with
      ASAN. Prior to the patch, the crash handler would run, tricking the
      test into thinking libFuzzer on Win had exited properly.
      
      Reviewers: morehouse, vitalybuka
      
      Reviewed By: morehouse
      
      Subscribers: yln
      
      Differential Revision: https://reviews.llvm.org/D57551
      
      llvm-svn: 352815
      6f94a033
    • 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
    • Thomas Lively's avatar
      [WebAssembly] Fix a regression selecting negative build_vector lanes · 9a484388
      Thomas Lively authored
      Summary:
      The custom lowering introduced in rL352592 creates build_vector nodes
      with negative i32 operands, but these operands did not meet the value
      range constraints necessary to match build_vector nodes. This CL fixes
      the issue by removing the unnecessary constraints.
      
      Reviewers: aheejin
      
      Subscribers: dschuff, sbc100, jgravelle-google, hiraditya, sunfish
      
      Differential Revision: https://reviews.llvm.org/D57481
      
      llvm-svn: 352813
      9a484388
    • 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
    • Wouter van Oortmerssen's avatar
      Fixed hasLinkerPrivateGlobalPrefix treating StringRef as C String. · 5f563f06
      Wouter van Oortmerssen authored
      Reviewers: jgravelle-google, sbc100
      
      Subscribers: aheejin, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D57545
      
      llvm-svn: 352810
      5f563f06
  2. Jan 31, 2019
Loading