Skip to content
  1. May 17, 2019
    • Chris Bieneman's avatar
      Revert Refactor constant evaluation of typeid(T) to track a symbolic type_info... · a971003e
      Chris Bieneman authored
      Revert Refactor constant evaluation of typeid(T) to track a symbolic type_info object rather than tracking the originating expression.
      
      This reverts r360974 (git commit 7ee4307b)
      
      llvm-svn: 360988
      a971003e
    • Chris Bieneman's avatar
      Revert [c++20] P1327R1: Support for typeid applied to objects of polymorphic... · a5a4124c
      Chris Bieneman authored
      Revert [c++20] P1327R1: Support for typeid applied to objects of polymorphic class type in constant evaluation.
      
      This reverts r360977 (git commit f51dc8d2)
      
      llvm-svn: 360987
      a5a4124c
    • Fangrui Song's avatar
      [MC][PowerPC] Clean up PPCAsmBackend · e18a6ad0
      Fangrui Song authored
      Replace the member variable Target with Triple
      Use Triple instead of TheTarget.getName() to dispatch on 32-bit/64-bit.
      Delete redundant parameters
      
      llvm-svn: 360986
      e18a6ad0
    • Chris Bieneman's avatar
      Re-land: Add Clang shared library with C++ exports · 876e3993
      Chris Bieneman authored
      Summary:
      This patch adds a libClang_shared library on *nix systems which exports the entire C++ API. In order to support this on Windows we should really refactor llvm-shlib and share code between the two.
      
      This also uses a slightly different method for generating the shared library, which I should back-port to llvm-shlib. Instead of linking the static archives and passing linker flags to force loading the whole libraries, this patch creates object libraries for every library (which has no cost in the build system), and link the object libraries.
      
      llvm-svn: 360985
      876e3993
    • Ben Dunbobbin's avatar
      [ELF] Implement Dependent Libraries Feature · 1d16515f
      Ben Dunbobbin authored
      This patch implements a limited form of autolinking primarily designed to allow
      either the --dependent-library compiler option, or "comment lib" pragmas (
      https://docs.microsoft.com/en-us/cpp/preprocessor/comment-c-cpp?view=vs-2017) in
      C/C++ e.g. #pragma comment(lib, "foo"), to cause an ELF linker to automatically
      add the specified library to the link when processing the input file generated
      by the compiler.
      
      Currently this extension is unique to LLVM and LLD. However, care has been taken
      to design this feature so that it could be supported by other ELF linkers.
      
      The design goals were to provide:
      
      - A simple linking model for developers to reason about.
      - The ability to to override autolinking from the linker command line.
      - Source code compatibility, where possible, with "comment lib" pragmas in other
        environments (MSVC in particular).
      
      Dependent library support is implemented differently for ELF platforms than on
      the other platforms. Primarily this difference is that on ELF we pass the
      dependent library specifiers directly to the linker without manipulating them.
      This is in contrast to other platforms where they are mapped to a specific
      linker option by the compiler. This difference is a result of the greater
      variety of ELF linkers and the fact that ELF linkers tend to handle libraries in
      a more complicated fashion than on other platforms. This forces us to defer
      handling the specifiers to the linker.
      
      In order to achieve a level of source code compatibility with other platforms
      we have restricted this feature to work with libraries that meet the following
      "reasonable" requirements:
      
      1. There are no competing defined symbols in a given set of libraries, or
         if they exist, the program owner doesn't care which is linked to their
         program.
      2. There may be circular dependencies between libraries.
      
      The binary representation is a mergeable string section (SHF_MERGE,
      SHF_STRINGS), called .deplibs, with custom type SHT_LLVM_DEPENDENT_LIBRARIES
      (0x6fff4c04). The compiler forms this section by concatenating the arguments of
      the "comment lib" pragmas and --dependent-library options in the order they are
      encountered. Partial (-r, -Ur) links are handled by concatenating .deplibs
      sections with the normal mergeable string section rules. As an example, #pragma
      comment(lib, "foo") would result in:
      
      .section ".deplibs","MS",@llvm_dependent_libraries,1
               .asciz "foo"
      
      For LTO, equivalent information to the contents of a the .deplibs section can be
      retrieved by the LLD for bitcode input files.
      
      LLD processes the dependent library specifiers in the following way:
      
      1. Dependent libraries which are found from the specifiers in .deplibs sections
         of relocatable object files are added when the linker decides to include that
         file (which could itself be in a library) in the link. Dependent libraries
         behave as if they were appended to the command line after all other options. As
         a consequence the set of dependent libraries are searched last to resolve
         symbols.
      2. It is an error if a file cannot be found for a given specifier.
      3. Any command line options in effect at the end of the command line parsing apply
         to the dependent libraries, e.g. --whole-archive.
      4. The linker tries to add a library or relocatable object file from each of the
         strings in a .deplibs section by; first, handling the string as if it was
         specified on the command line; second, by looking for the string in each of the
         library search paths in turn; third, by looking for a lib<string>.a or
         lib<string>.so (depending on the current mode of the linker) in each of the
         library search paths.
      5. A new command line option --no-dependent-libraries tells LLD to ignore the
         dependent libraries.
      
      Rationale for the above points:
      
      1. Adding the dependent libraries last makes the process simple to understand
         from a developers perspective. All linkers are able to implement this scheme.
      2. Error-ing for libraries that are not found seems like better behavior than
         failing the link during symbol resolution.
      3. It seems useful for the user to be able to apply command line options which
         will affect all of the dependent libraries. There is a potential problem of
         surprise for developers, who might not realize that these options would apply
         to these "invisible" input files; however, despite the potential for surprise,
         this is easy for developers to reason about and gives developers the control
         that they may require.
      4. This algorithm takes into account all of the different ways that ELF linkers
         find input files. The different search methods are tried by the linker in most
         obvious to least obvious order.
      5. I considered adding finer grained control over which dependent libraries were
         ignored (e.g. MSVC has /nodefaultlib:<library>); however, I concluded that this
         is not necessary: if finer control is required developers can fall back to using
         the command line directly.
      
      RFC thread: http://lists.llvm.org/pipermail/llvm-dev/2019-March/131004.html.
      
      Differential Revision: https://reviews.llvm.org/D60274
      
      llvm-svn: 360984
      1d16515f
    • Fangrui Song's avatar
      [X86] Support .reloc *, R_{386,X86_64}_NONE, * · 24632397
      Fangrui Song authored
      This can be used to create references among sections. When --gc-sections
      is used, the referenced section will be retained if the origin section
      is retained.
      
      See R_MIPS_NONE (D13659), R_ARM_NONE (D61992), R_AARCH64_NONE (D61973) for similar changes.
      
      Reviewed By: rnk
      
      Differential Revision: https://reviews.llvm.org/D62014
      
      llvm-svn: 360983
      24632397
    • Mitch Phillips's avatar
      [GWP-ASan] Fixed issue with c++ standard library dependency. · 364f662f
      Mitch Phillips authored
      Summary:
      Removed dependency on c++ standard library. Some supporting allocators (namely Scudo on Fuchsia, and shortly, scudo standalone) has a hard requirement of no c++stdlib.
      
      This patch updates the build system so that we don't have any c++ stdlib dependencies. It also will conveniently fix a racy build-order bug discrepency between GWP-ASan and libc++.
      
      Reviewers: phosek, morehouse
      
      Reviewed By: phosek, morehouse
      
      Subscribers: kubamracek, mgorny, cryptoad, #sanitizers, llvm-commits, beanz, smeenai, vitalybuka
      
      Tags: #sanitizers, #llvm
      
      Differential Revision: https://reviews.llvm.org/D62048
      
      llvm-svn: 360982
      364f662f
    • Fangrui Song's avatar
      [AArch64] Support .reloc *, R_AARCH64_NONE, * · aa6102ad
      Fangrui Song authored
      Summary:
      This can be used to create references among sections. When --gc-sections
      is used, the referenced section will be retained if the origin section
      is retained.
      
      Reviewed By: peter.smith
      
      Differential Revision: https://reviews.llvm.org/D61973
      
      llvm-svn: 360981
      aa6102ad
    • Fangrui Song's avatar
      [ARM] Support .reloc *, R_ARM_NONE, * · 43ca0e9e
      Fangrui Song authored
      R_ARM_NONE can be used to create references among sections. When
      --gc-sections is used, the referenced section will be retained if the
      origin section is retained.
      
      Add a generic MCFixupKind FK_NONE as this kind of no-op relocation is
      ubiquitous on ELF and COFF, and probably available on many other binary
      formats. See D62014.
      
      Reviewed By: peter.smith
      
      Differential Revision: https://reviews.llvm.org/D61992
      
      llvm-svn: 360980
      43ca0e9e
    • Philip Reames's avatar
      [LFTR] Strengthen assertions in genLoopLimit [NFCI] · a74d6543
      Philip Reames authored
      llvm-svn: 360978
      a74d6543
    • Richard Smith's avatar
      [c++20] P1327R1: Support for typeid applied to objects of polymorphic · f51dc8d2
      Richard Smith authored
      class type in constant evaluation.
      
      llvm-svn: 360977
      f51dc8d2
    • Philip Reames's avatar
      [IndVars] Don't reimplement Loop::isLoopInvariant [NFC] · 45e76907
      Philip Reames authored
      Using dominance vs a set membership check is indistinguishable from a compile time perspective, and the two queries return equivelent results.  Simplify code by using the existing function.
      
      llvm-svn: 360976
      45e76907
    • Rui Ueyama's avatar
      Move symbol resolution code out of SymbolTable class. · bbf154cf
      Rui Ueyama authored
      This is the last patch of the series of patches to make it possible to
      resolve symbols without asking SymbolTable to do so.
      
      The main point of this patch is the introduction of
      `elf::resolveSymbol(Symbol *Old, Symbol *New)`. That function resolves
      or merges given symbols by examining symbol types and call
      replaceSymbol (which memcpy's New to Old) if necessary.
      
      With the new function, we have now separated symbol resolution from
      symbol lookup. If you already have a Symbol pointer, you can directly
      resolve the symbol without asking SymbolTable to do that.
      
      Now that the nice abstraction become available, I can start working on
      performance improvement of the linker. As a starter, I'm thinking of
      making --{start,end}-lib faster.
      
      --{start,end}-lib is currently unnecessarily slow because it looks up
      the symbol table twice for each symbol.
      
       - The first hash table lookup/insertion occurs when we instantiate a
         LazyObject file to insert LazyObject symbols.
      
       - The second hash table lookup/insertion occurs when we create an
         ObjFile from LazyObject file. That overwrites LazyObject symbols
         with Defined symbols.
      
      I think it is not too hard to see how we can now eliminate the second
      hash table lookup. We can keep LazyObject symbols in Step 1, and then
      call elf::resolveSymbol() to do Step 2.
      
      Differential Revision: https://reviews.llvm.org/D61898
      
      llvm-svn: 360975
      bbf154cf
    • Richard Smith's avatar
      Refactor constant evaluation of typeid(T) to track a symbolic type_info · 7ee4307b
      Richard Smith authored
      object rather than tracking the originating expression.
      
      This is groundwork for supporting polymorphic typeid expressions. (Note
      that this somewhat regresses our support for DR1968, but it turns out
      that that never actually worked anyway, at least in non-trivial cases.)
      
      llvm-svn: 360974
      7ee4307b
    • Nico Weber's avatar
      Revert r360946 "Add Clang shared library with C++ exports" · 457d7caa
      Nico Weber authored
      It breaks LLVM_ENABLE_PIC=OFF builds, and it's not clear
      if the object library approach doesn't impact the normal
      clang binary.
      
      llvm-svn: 360973
      457d7caa
    • Philip Reames's avatar
      [LFTR] Factor out a helper function for readability purpose [NFC] · 8e169cd2
      Philip Reames authored
      llvm-svn: 360972
      8e169cd2
    • Jonas Devlieghere's avatar
      [Docs] Fix headings in remote debugging · 65cab8c6
      Jonas Devlieghere authored
      Add the proper headings instead of using just a bold font. Also add the
      local ToC.
      
      llvm-svn: 360971
      65cab8c6
    • Jonas Paulsson's avatar
      [CodeMetrics] Don't let extends of i1 be free. · 19871f84
      Jonas Paulsson authored
      getUserCost() currently returns TCC_Free for any extend of a compare (i1)
      result. It seems this is only true in a limited number of cases where for
      example two compares are chained. Even in those types of cases it seems
      unlikely that they are generally free, while they may be in some cases.
      
      This patch therefore removes this special handling of cast of i1. No tests
      are failing because of this.
      
      If some target want the old behavior, it could override getUserCost().
      
      Review: Hal Finkel, Chandler Carruth, Evgeny Astigeevich, Simon Pilgrim,
              Ulrich Weigand
      https://reviews.llvm.org/D54742/new/
      
      llvm-svn: 360970
      19871f84
    • Richard Trieu's avatar
      Fix broken test case. · a9a92653
      Richard Trieu authored
      EXPECT_EQ takes two arguments, not a single expression that evaluates to bool.
      
      llvm-svn: 360969
      a9a92653
    • Philip Reames's avatar
      Clarify comments on helpers used by LFTR [NFC] · 9283f184
      Philip Reames authored
      I'm slowly wrapping my head around this code, and am making comment improvements where I can.
      
      llvm-svn: 360968
      9283f184
    • Jonas Devlieghere's avatar
      [Docs] Remove architectures from feature matrix · 1e0ec81c
      Jonas Devlieghere authored
      This is outdated, there's a bunch of architectures missing. If we want
      them to be part of this table they should be a separate row anyway.
      
      llvm-svn: 360967
      1e0ec81c
    • Davide Italiano's avatar
      [CommandInterpreter] Accept blanks after `all` or [0-9]+ for bt. · d768ee21
      Davide Italiano authored
      Previously "bt all    " would've failed as the regex didn't match
      them.
      
      Over the shoulder review by Jonas Devlieghere.
      
      <rdar://problem/50824935>
      
      llvm-svn: 360966
      d768ee21
    • Jonas Paulsson's avatar
      [SystemZ] Bugfix in SystemZTargetLowering::combineIntDIVREM() · 9427961c
      Jonas Paulsson authored
      Make sure to not unroll a vector division/remainder (with a constant splat
      divisor) after type legalization, since the scalar type may then be illegal.
      
      Review: Ulrich Weigand
      https://reviews.llvm.org/D62036
      
      llvm-svn: 360965
      9427961c
    • Jonas Devlieghere's avatar
      [Docs] Unify sidebar padding · b5d7ad1d
      Jonas Devlieghere authored
      Unify the padding across list items and the list header.
      
      llvm-svn: 360964
      b5d7ad1d
    • Nico Weber's avatar
      Revert r360859: "Reland r360771 "[MergeICmps] Simplify the code."" · d764e7c6
      Nico Weber authored
      It caused PR41917.
      
      llvm-svn: 360963
      d764e7c6
    • Richard Smith's avatar
      Convert PointerUnion to a variadic template. · 9b92875b
      Richard Smith authored
      Summary:
      Rather than duplicating code between PointerUnion, PointerUnion3, and
      PointerUnion4 (and missing things from the latter cases, such as some of the
      DenseMap support and operator==), convert PointerUnion to a variadic template
      that can be used as a union of any number of pointers.
      
      (This doesn't support PointerUnion<> right now. Adding a special case for that
      would be possible, and perhaps even useful in some situations, but it doesn't
      seem worthwhile until we have a concrete use case.)
      
      Reviewers: dblaikie
      
      Subscribers: dexonsmith, kristina, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D62027
      
      llvm-svn: 360962
      9b92875b
    • Philip Reames's avatar
      [Tests] Consolidate more lftr tests · f0a0e8bb
      Philip Reames authored
      These are all of the ones involving the same data layout string.  Remainder take a bit more consideration, but at least everything can be auto-updated now.
      
      llvm-svn: 360961
      f0a0e8bb
    • David L. Jones's avatar
      [X86][AsmParser] Add mnemonics missed in r360954. · 4a5e01fa
      David L. Jones authored
      These are valid Jcc, but aren't based on the EFLAGS condition codes (Intel 64
      and IA-32 Architetcures Software Developer's Manual Vol. 1, Appendix B). These
      are covered in clang/test, but not llvm/test.
      
      llvm-svn: 360960
      4a5e01fa
    • Evgeniy Stepanov's avatar
      HWASan exception support. · 7f281b2c
      Evgeniy Stepanov authored
      Summary:
      Adds a call to __hwasan_handle_vfork(SP) at each landingpad entry.
      
      Reusing __hwasan_handle_vfork instead of introducing a new runtime call
      in order to be ABI-compatible with old runtime library.
      
      Reviewers: pcc
      
      Subscribers: kubamracek, hiraditya, #sanitizers, llvm-commits
      
      Tags: #sanitizers, #llvm
      
      Differential Revision: https://reviews.llvm.org/D61968
      
      llvm-svn: 360959
      7f281b2c
    • Vitaly Buka's avatar
      627e383c
    • Philip Reames's avatar
      [Tests] Expand basic lftr coverage · 087a30d5
      Philip Reames authored
      Newly written tests to cover the simple cases.  We don't appear to have broad coverage of this transform anywhere.
      
      llvm-svn: 360957
      087a30d5
    • Adrian Prantl's avatar
      Slightly update the macOS part of status.rst to be less out-of-date. · 2b9a3ea1
      Adrian Prantl authored
      llvm-svn: 360956
      2b9a3ea1
    • Bob Haarman's avatar
      Revert r358069 "Discard debuginfo for object files empty after GC" · 5ff1eb64
      Bob Haarman authored
      The change broke some scenarios where debug information is still
      needed, although MarkLive cannot see it, including the
      Chromium/Android build. Reverting to unbreak that build.
      
      llvm-svn: 360955
      5ff1eb64
    • David L. Jones's avatar
      [X86][AsmParser] Ignore "short" even harder in Intel syntax ASM. · add7ed22
      David L. Jones authored
      In Intel syntax, it's not uncommon to see a "short" modifier on Jcc conditional
      jumps, which indicates the offset should be a "short jump" (8-bit immediate
      offset from EIP, -128 to +127). This patch expands to all recognized Jcc
      condition codes, and removes the inline restriction.
      
      Clang already ignores "jmp short" in inline assembly. However, only "jmp" and a
      couple of Jcc are actually checked, and only inline (i.e., not when using the
      integrated assembler for asm sources). A quick search through asm-containing
      libraries at hand shows a pretty broad range of Jcc conditions spelled with
      "short."
      
      GAS ignores the "short" modifier, and instead uses an encoding based on the
      given immediate. MS inline seems to do the same, and I suspect MASM does, too.
      NASM will yield an error if presented with an out-of-range immediate value.
      
      Example of GCC 9.1 and MSVC v19.20, "jmp short" with offsets that do and do not
      fit within 8 bits: https://gcc.godbolt.org/z/aFZmjY
      
      Differential Revision: https://reviews.llvm.org/D61990
      
      llvm-svn: 360954
      add7ed22
    • David L. Jones's avatar
      [X86][AsmParser] Rename "ConditionCode" variable to "ConditionPredicate". · 11305984
      David L. Jones authored
      This better matches the verbiage in Intel documentation, and should help avoid
      confusion between these two different kinds of values, both of which are parsed
      from mnemonics.
      
      llvm-svn: 360953
      11305984
    • Reid Kleckner's avatar
      [X86] Deduplicate symbol lowering logic, NFC · 08c15df2
      Reid Kleckner authored
      Summary:
      This refactors four pieces of code that create SDNodes for references to
      symbols:
      - normal global address lowering (LEA, MOV, etc)
      - callee global address lowering (CALL)
      - external symbol address lowering (LEA, MOV, etc)
      - external symbol address lowering (CALL)
      
      Each of these pieces of code need to:
      - classify the reference
      - lower the symbol
      - emit a RIP wrapper if needed
      - emit a load if needed
      - add offsets if needed
      
      I think handling them all in one place will make the code easier to
      maintain in the future.
      
      Reviewers: craig.topper, RKSimon
      
      Subscribers: hiraditya, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D61690
      
      llvm-svn: 360952
      08c15df2
    • Eric Fiselier's avatar
      Remove unneeded alignment spec from builtin_FUNCTION.cpp test · 06b6a2ef
      Eric Fiselier authored
      llvm-svn: 360951
      06b6a2ef
    • Amy Huang's avatar
      Emit global variables as S_CONSTANT records for codeview debug info. · c2029068
      Amy Huang authored
      Summary:
      This emits S_CONSTANT records for global variables.
      Currently this emits records for the global variables already being tracked in the
      LLVM IR metadata, which are just constant global variables; we'll also want S_CONSTANTs
      for static data members and enums.
      
      Related to https://bugs.llvm.org/show_bug.cgi?id=41615
      
      Reviewers: rnk
      
      Subscribers: aprantl, hiraditya, llvm-commits, thakis
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D61926
      
      llvm-svn: 360948
      c2029068
    • Eric Fiselier's avatar
      Fix failing source location test on Windows · fe331a67
      Eric Fiselier authored
      llvm-svn: 360947
      fe331a67
    • Chris Bieneman's avatar
      Add Clang shared library with C++ exports · 10fba12e
      Chris Bieneman authored
      Summary:
      This patch adds a libClang_shared library on *nix systems which exports the entire C++ API. In order to support this on Windows we should really refactor llvm-shlib and share code between the two.
      
      This also uses a slightly different method for generating the shared library, which I should back-port to llvm-shlib. Instead of linking the static archives and passing linker flags to force loading the whole libraries, this patch creates object libraries for every library (which has no cost in the build system), and link the object libraries.
      
      Reviewers: tstellar, winksaville
      
      Subscribers: mgorny, cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D61909
      
      llvm-svn: 360946
      10fba12e
Loading