1. Aug 22, 2019
    • Raphael Isemann's avatar
      [lldb][NFC] Remove dead code that is supposed to handle invalid command options · 36162014
      Raphael Isemann authored
      Summary:
      We currently have a bunch of code that is supposed to handle invalid command options, but
      all this code is unreachable because invalid options are already handled in `Options::Parse`.
      The only way we can reach this code is when we declare but then not implement an option
      (which will be made impossible with D65386, which is also when we can completely remove
      the `default` cases).
      
      This patch replaces all this code with `llvm_unreachable` to make clear this is dead code
      that can't be reached.
      
      Reviewers: JDevlieghere
      
      Reviewed By: JDevlieghere
      
      Subscribers: lldb-commits
      
      Tags: #lldb
      
      Differential Revision: https://reviews.llvm.org/D66522
      
      llvm-svn: 369625
      36162014
    • Raphael Isemann's avatar
      [lldb][NFC] Remove WordComplete mode, make result array indexed from 0 and... · ae34ed2c
      Raphael Isemann authored
      [lldb][NFC] Remove WordComplete mode, make result array indexed from 0 and remove any undocumented/redundant return values
      
      Summary:
      We still have some leftovers of the old completion API in the internals of
      LLDB that haven't been replaced by the new CompletionRequest. These leftovers
      are:
      
      * The return values (int/size_t) in all completion functions.
      * Our result array that starts indexing at 1.
      * `WordComplete` mode.
      
      I didn't replace them back then because it's tricky to figure out what exactly they
      are used for and the completion code is relatively untested. I finally got around
      to writing more tests for the API and understanding the semantics, so I think it's
      a good time to get rid of them.
      
      A few words why those things should be removed/replaced:
      
      * The return values are really cryptic, partly redundant and rarely documented.
        They are also completely ignored by Xcode, so whatever information they contain will end up
        breaking Xcode's completion mechanism. They are also partly impossible to even implement
        as we assign negative values special meaning and our completion API sometimes returns size_t.
      
        Completion functions are supposed to return -2 to rewrite the current line. We seem to use this
        in some untested code path to expand the history repeat character to the full command, but
        I haven't figured out why that doesn't work at the moment.
        Completion functions return -1 to 'insert the completion character', but that isn't implemented
        (even though we seem to activate this feature in LLDB sometimes).
        All positive values have to match the number of results. This is obviously just redundant information
        as the user can just look at the result list to get that information (which is what Xcode does).
      
      * The result array that starts indexing at 1 is obviously unexpected. The first element of the array is
        reserved for the common prefix of all completions (e.g. "foobar" and "footar" -> "foo"). The idea is
        that we calculate this to make the life of the API caller easier, but obviously forcing people to have
        1-based indices is not helpful (or even worse, forces them to manually copy the results to make it
        0-based like Xcode has to do).
      
      * The `WordComplete` mode indicates that LLDB should enter a space behind the completion. The
        idea is that we let the top-level API know that we just provided a full completion. Interestingly we
        `WordComplete` is just a single bool that somehow represents all N completions. And we always
        provide full completions in LLDB, so in theory it should always be true.
        The only use it currently serves is providing redundant information about whether we have a single
        definitive completion or not (which we already know from the number of results we get).
      
      This patch essentially removes `WordComplete` mode and makes the result array indexed from 0.
      It also removes all return values from all internal completion functions. The only non-redundant information
      they contain is about rewriting the current line (which is broken), so that functionality was moved
      to the CompletionRequest API. So you can now do `addCompletion("blub", "description", CompletionMode::RewriteLine)`
      to do the same.
      
      For the SB API we emulate the old behaviour by making the array indexed from 1 again with the common
      prefix at index 0. I didn't keep the special negative return codes as we either never sent them before (e.g. -2) or we
      didn't even implement them in the Editline handler (e.g. -1).
      
      I tried to keep this patch minimal and I'm aware we can probably now even further simplify a bunch of related code,
      but I would prefer doing this in follow-up NFC commits
      
      Reviewers: JDevlieghere
      
      Reviewed By: JDevlieghere
      
      Subscribers: arphaman, abidh, lldb-commits
      
      Tags: #lldb
      
      Differential Revision: https://reviews.llvm.org/D66536
      
      llvm-svn: 369624
      ae34ed2c
    • Petr Hosek's avatar
      Revert "[GWP-ASan] Remove c++ standard lib dependency." · 028b5499
      Petr Hosek authored
      This reverts commit r369606: this doesn't addressed the underlying
      problem and it's not the correct solution.
      
      llvm-svn: 369623
      028b5499
    • Shiva Chen's avatar
      [TargetLowering] Remove optional arguments passing to makeLibCall · 72a41e7b
      Shiva Chen authored
      The patch introduces MakeLibCallOptions struct as suggested by @efriedma on D65497.
      The struct contain argument flags which will pass to makeLibCall function.
      The patch should not has any functionality changes.
      
      Differential Revision: https://reviews.llvm.org/D65795
      
      llvm-svn: 369622
      72a41e7b
    • Jonas Devlieghere's avatar
      [debugserver] Switch back to std::once_flag · 83ee8d44
      Jonas Devlieghere authored
      We cannot use llvm::once_flag in debugserver because doesn't link
      against llvm.
      
      llvm-svn: 369621
      83ee8d44
    • Joel E. Denny's avatar
      [lit] Diagnose insufficient args to internal env · 3c577bb4
      Joel E. Denny authored
      Without this patch, failing to provide a subcommand to lit's internal
      `env` results in either a python `IndexError` or an attempt to execute
      the final `env` argument, such as `FOO=1`, as a command.  This patch
      diagnoses those cases with a more helpful message.
      
      Reviewed By: stella.stamenova
      
      Differential Revision: https://reviews.llvm.org/D66482
      
      llvm-svn: 369620
      3c577bb4
    • Joel E. Denny's avatar
      [OpenMP] Permit map with DSA on combined directive · 7d5bc554
      Joel E. Denny authored
      For `map`, the following restriction changed in OpenMP 5.0:
      
      * OpenMP 4.5 [2.15.5.1, Restrictions]: "A list item cannot appear in
        both a map clause and a data-sharing attribute clause on the same
        construct.
      
      * OpenMP 5.0 [2.19.7.1, Restrictions]: "A list item cannot appear in
        both a map clause and a data-sharing attribute clause on the same
        construct unless the construct is a combined construct."
      
      This patch removes this restriction in the case of combined constructs
      and OpenMP 5.0, and it updates Sema not to capture a scalar by copy in
      the target region when `firstprivate` and `map` appear for that scalar
      on a combined target construct.
      
      This patch also adds a fixme to a test that now reveals that a
      diagnostic about loop iteration variables is dropped in the case of
      OpenMP 5.0.  That bug exists regardless of this patch's changes.
      
      Reviewed By: ABataev, jdoerfert, hfinkel, kkwli0
      
      Differential Revision: https://reviews.llvm.org/D65835
      
      llvm-svn: 369619
      7d5bc554
    • Davide Italiano's avatar
      [lldb] Replace std::once_flag with llvm::once_flag. · 0a8e634b
      Davide Italiano authored
      Summary:
      The former seems like it's not working on some platforms.
      All the other uses use `llvm::`, so, let's change for consistency.
      
      Reviewers: jasonmolenda, friss
      
      Subscribers: lldb-commits
      
      Tags: #lldb
      
      Differential Revision: https://reviews.llvm.org/D66566
      
      llvm-svn: 369618
      0a8e634b
    • Jonas Devlieghere's avatar
      [FormatManage] Fix the format info order · 2621f7bd
      Jonas Devlieghere authored
      The format info entries need to match the order of the enum entries.
      This should fix the two failing data-formatter tests.
      
      llvm-svn: 369617
      2621f7bd
    • Kristof Umann's avatar
      [analyzer] Enable control dependency condition tracking by default · 0f9e530c
      Kristof Umann authored
      This patch concludes my GSoC'19 project by enabling track-conditions by default.
      
      Differential Revision: https://reviews.llvm.org/D66381
      
      llvm-svn: 369616
      0f9e530c
    • Csaba Dabis's avatar
      [analyzer] CastValueChecker: Model isa(), isa_and_nonnull() · 4d71600c
      Csaba Dabis authored
      Summary: -
      
      Reviewed By: NoQ
      
      Differential Revision: https://reviews.llvm.org/D66423
      
      llvm-svn: 369615
      4d71600c
    • Jonas Devlieghere's avatar
      [FormatManager] Add static_assert to keep formats in sync. · 12002fbd
      Jonas Devlieghere authored
      This adds a static assert that ensures that there's a format info entry
      for every format enum value. This should prevent others from making the
      same mistake I made and Jason kindly fixed in r369611. (Thanks!)
      
      llvm-svn: 369614
      12002fbd
    • Kristof Umann's avatar
      [analyzer] Don't track the condition of foreach loops · 58eb033a
      Kristof Umann authored
      As discussed on the mailing list, notes originating from the tracking of foreach
      loop conditions are always meaningless.
      
      Differential Revision: https://reviews.llvm.org/D66131
      
      llvm-svn: 369613
      58eb033a
    • Pengfei Wang's avatar
      [X86] Making X86OptimizeLEAs pass public. NFC · 7630e244
      Pengfei Wang authored
      Reviewers: wxiao3, LuoYuanke, andrew.w.kaylor, craig.topper, annita.zhang, liutianle, pengfei, xiangzhangllvm, RKSimon, spatel, andreadb
      
      Reviewed By: RKSimon
      
      Subscribers: andreadb, hiraditya, llvm-commits
      
      Tags: #llvm
      
      Patch by Gen Pei (gpei)
      
      Differential Revision: https://reviews.llvm.org/D65933
      
      llvm-svn: 369612
      7630e244
    • Jason Molenda's avatar
      The g_format_infos table needs to be updated in concert with the · ca4409b4
      Jason Molenda authored
      enum Format entries; else we can crash in a place like
      FormatManager::GetFormatAsCString().  We should add  bounds checks
      to prevent this more reliably, but for tonight I'm just adding this
      entry to keep an address-sanitizer test run working.
      
      llvm-svn: 369611
      ca4409b4
    • Fangrui Song's avatar
      [COFF] Fix section name for constants larger than 64 bits on Windows · 246750c2
      Fangrui Song authored
      APIntToHexString returns wrong value ("0000000000000000ffffffffffffffff")
      for integer larger than 64 bits, and thus
      TargetLoweringObjectFileCOFF::getSectionForConstant returns same section name
      for all numbers larger than 64 bits. This patch tries to fix it.
      
      Differential Revision: https://reviews.llvm.org/D66458
      Patch by Senran Zhang
      
      llvm-svn: 369610
      246750c2
    • Csaba Dabis's avatar
      [analyzer] CastValueChecker: Try to fix the buildbots · 22dc44ff
      Csaba Dabis authored
      llvm-svn: 369609
      22dc44ff
    • Nico Weber's avatar
      gn build: Merge r369605 · 6e8b79e3
      Nico Weber authored
      llvm-svn: 369608
      6e8b79e3
    • Csaba Dabis's avatar
      [analyzer] CastValueChecker: Rewrite dead header hotfix · e4bf456f
      Csaba Dabis authored
      llvm-svn: 369607
      e4bf456f
    • Petr Hosek's avatar
      [GWP-ASan] Remove c++ standard lib dependency. · 3dd22585
      Petr Hosek authored
      Remove c++ standard library dependency for now for @phosek. They have a
      complicated build system that breaks with the fuzzer target here.
      
      Also added a todo to remedy later.
      
      Differential Revision: https://reviews.llvm.org/D66568
      
      llvm-svn: 369606
      3dd22585
    • Csaba Dabis's avatar
      [analyzer] CastValueChecker: Store the dynamic types and casts · 0202c359
      Csaba Dabis authored
      Summary:
      This patch introduces `DynamicCastInfo` similar to `DynamicTypeInfo` which
      is stored in `CastSets` which are storing the dynamic cast informations of
      objects based on memory regions. It could be used to store and check the
      casts and prevent infeasible paths.
      
      Reviewed By: NoQ
      
      Differential Revision: https://reviews.llvm.org/D66325
      
      llvm-svn: 369605
      0202c359
    • Csaba Dabis's avatar
      [analyzer] TrackConstraintBRVisitor: Do not track unknown values · b73a5711
      Csaba Dabis authored
      Summary: -
      
      Reviewers: NoQ, Szelethus
      
      Reviewed By: NoQ, Szelethus
      
      Differential Revision: https://reviews.llvm.org/D66267
      
      llvm-svn: 369604
      b73a5711
    • Nico Weber's avatar
      gn build: Merge r369600 · edb08da4
      Nico Weber authored
      llvm-svn: 369603
      edb08da4
    • Cyndy Ishida's avatar
      [Object] FIX: update PlatformKind name in TapiFile · 9443d0e2
      Cyndy Ishida authored
      Buildbots that use GCC failed to compile because overwritten
      namespace with variable name
      
      llvm-svn: 369602
      9443d0e2
    • Julian Lettner's avatar
      [TSan] #include header instead of forward declaring interceptees · 894abb46
      Julian Lettner authored
      llvm-svn: 369601
      894abb46
    • Cyndy Ishida's avatar
      [Object] Add tapi files to object · c20d1f90
      Cyndy Ishida authored
      Summary:
      The intention for this is to allow reading and printing symbols out from
      llvm-nm. Tapi file, and Tapi universal follow a similiar format to
      their respective MachO Object format.
      
      The tests are dependent on llvm-nm processing tbd files which is why its in D66160
      
      Reviewers: ributzka, steven_wu, lhames
      
      Reviewed By: ributzka, lhames
      
      Subscribers: mgorny, hiraditya, dexonsmith, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D66159
      
      llvm-svn: 369600
      c20d1f90
    • Craig Topper's avatar
      [X86] Correct the scheduler classes for TAILJMP and TCRETURN CodeGenOnly instructions. · 78e6507b
      Craig Topper authored
      We had an odd combination of WriteJump applied to some memory
      instructions and WriteJumpLd applied to register and immediate
      instructions.
      
      Thsi should hopefully assign them all correctly.
      
      llvm-svn: 369599
      78e6507b
    • Craig Topper's avatar
    • Nico Weber's avatar
      libcxx: Rename last two .hpp files in libcxx to .h · 0f3efc4a
      Nico Weber authored
      Differential Revision: https://reviews.llvm.org/D66544
      
      llvm-svn: 369597
      0f3efc4a
    • Kristof Umann's avatar
      [analyzer] Mention whether an event is about a condition in a bug report part 2 · d9a81ccf
      Kristof Umann authored
      In D65724, I do a pretty thorough explanation about how I'm solving this
      problem, I think that summary nails whats happening here ;)
      
      Differential Revision: https://reviews.llvm.org/D65725
      
      llvm-svn: 369596
      d9a81ccf
    • Jonas Devlieghere's avatar
      [test] Update test so it matches the Windows output · 71dc97b5
      Jonas Devlieghere authored
      llvm-svn: 369595
      71dc97b5
    • Nico Weber's avatar
      gn build: Merge r369591 · 40902b48
      Nico Weber authored
      llvm-svn: 369594
      40902b48
    • Nico Weber's avatar
      gn build: Merge r369587 · e1f27e4a
      Nico Weber authored
      llvm-svn: 369593
      e1f27e4a
    • Johannes Doerfert's avatar
      [Attributor] FIX: Try to make bots happy · 92dee44d
      Johannes Doerfert authored
      Locally the tight iterations bounds work fine but the bots seem unhappy.
      Try to get green bots and some time to determine the underlying problem.
      
      llvm-svn: 369592
      92dee44d
    • Matthias Gehre's avatar
      [LifetimeAnalysis] Support more STL idioms (template forward declaration and DependentNameType) · b1c78012
      Matthias Gehre authored
      Summary:
      This fixes inference of gsl::Pointer on std::set::iterator with libstdc++ (the typedef for iterator
      on the template is a DependentNameType - we can only put the gsl::Pointer attribute
      on the underlaying record after instantiation)
      
      inference of gsl::Pointer on std::vector::iterator with libc++ (the class was forward-declared,
      we added the gsl::Pointer on the canonical decl (the forward decl), and later when the
      template was instantiated, there was no attribute on the definition so it was not instantiated).
      
      and a duplicate gsl::Pointer on some class with libstdc++ (we first added an attribute to
      a incomplete instantiation, and then another was copied from the template definition
      when the instantiation was completed).
      
      We now add the attributes to all redeclarations to fix thos issues and make their usage easier.
      
      Reviewers: gribozavr
      
      Subscribers: Szelethus, xazax.hun, cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D66179
      
      llvm-svn: 369591
      b1c78012
    • Luis Marques's avatar
      [RISCV] Remove fix introduced by r369573, superseded by r369580 · f7cdff4f
      Luis Marques authored
      llvm-svn: 369590
      f7cdff4f
    • Kristof Umann's avatar
      [analyzer] Don't make ConditionBRVisitor events prunable when the condition is an interesting field · 49ac7ece
      Kristof Umann authored
      Exactly what it says on the tin! Note that we're talking about interestingness
      in general, hence this isn't a control-dependency-tracking specific patch.
      
      Differential Revision: https://reviews.llvm.org/D65724
      
      llvm-svn: 369589
      49ac7ece
    • Johannes Doerfert's avatar
      [Attributor] Fix: Gracefully handle non-instruction users · d98f9750
      Johannes Doerfert authored
      Function can have users that are not instructions, e.g., bitcasts. For
      now, we simply give up when we see them.
      
      llvm-svn: 369588
      d98f9750
    • Greg Clayton's avatar
      Add FileWriter to GSYM and encode/decode functions to AddressRange and AddressRanges · bf9ee07a
      Greg Clayton authored
      The full GSYM patch started with: https://reviews.llvm.org/D53379
      
      This patch add the ability to encode data using the new llvm::gsym::FileWriter class.
      
      FileWriter is a simplified binary data writer class that doesn't require targets, target definitions, architectures, or require any other optional compile time libraries to be enabled via the build process. This class needs the ability to seek to different spots in the binary data that it produces to fix up offsets and sizes in GSYM data. It currently uses std::ostream over llvm::raw_ostream because llvm::raw_ostream doesn't support seeking which is required when encoding and decoding GSYM data.
      
      AddressRange objects are encoded and decoded to be relative to a base address. This will be the FunctionInfo's start address if the AddressRange is directly contained in a FunctionInfo, or a base address of the containing parent AddressRange or AddressRanges. This allows address ranges to be efficiently encoded using ULEB128 encodings as we encode the offset and size of each range instead of full addresses. This also makes encoded addresses easy to relocate as we just need to relocate one base address.
      
      Differential Revision: https://reviews.llvm.org/D63828
      
      llvm-svn: 369587
      bf9ee07a
    • Johannes Doerfert's avatar
      [Attributor][NFCI] Introduce tight iteration bounds in the tests · a41b2390
      Johannes Doerfert authored
      Summary:
      To be able to track how many iterations we need to manifest all
      information we check for we now make the maximum iteration count
      explicit. The count is set tightly now and should be kept that way.
      
      Reviewers: uenoku, sstefan1
      
      Subscribers: bollu, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D66554
      
      llvm-svn: 369586
      a41b2390