1. Feb 16, 2019
    • Julian Lettner's avatar
      [lit] Remove LitTestCase · 70ca752c
      Julian Lettner authored
      From the docs: `class LitTestCase(unittest.TestCase)`
      LitTestCase is an adaptor for providing a 'unittest' compatible
      interface to 'lit' tests so that we can run lit tests with standard
      python test runners.
      
      It does not seem to be used anywhere.
      
      Differential Revision: https://reviews.llvm.org/D58264
      
      llvm-svn: 354188
      70ca752c
    • Julian Lettner's avatar
      [lit][NFC] Cleanup lit worker process handling · 0d15bb5d
      Julian Lettner authored
      Move code that is executed on worker process to separate file. This
      makes the use of the pickled arguments stored in global variables in the
      worker a bit clearer. (Still not pretty though.)
      
      Extract handling of parallelism groups to it's own function.
      
      Use BoundedSemaphore instead of Semaphore. BoundedSemaphore raises for
      unmatched release() calls.
      
      Cleanup imports.
      
      Differential Revision: https://reviews.llvm.org/D58196
      
      llvm-svn: 354187
      0d15bb5d
    • Kostya Serebryany's avatar
      [libFuzzer] fork mode: try harder to cleanup after itself · 312af158
      Kostya Serebryany authored
      llvm-svn: 354186
      312af158
    • Richard Smith's avatar
      Temporarily disable test: · 81086e2a
      Richard Smith authored
      test/lang/cpp/class-template-parameter-pack/TestClassTemplateParameterPack.py
      
      It fails on Mac OS; apparently a VarDecl 'void *&C' is implicitly
      declared there, making the class template name C ambiguous.
      
      llvm-svn: 354185
      81086e2a
    • Rui Ueyama's avatar
      [PPC64] Preserve LocalEntry when linking · 9efdd7ac
      Rui Ueyama authored
      On PowerPC64, it is necessary to keep the LocalEntry bits in st_other,
      especially when -r is used. Otherwise, when the resulting object is used
      in a posterior linking, LocalEntry info will be unavailable and
      functions may be called through the wrong entrypoint.
      
      Patch by Leandro Lupori.
      
      Differential Revision: https://reviews.llvm.org/D56782
      
      llvm-svn: 354184
      9efdd7ac
    • Alexander Kornienko's avatar
      clang-format with UseTab: Always sometimes doesn't insert the right amount of tabs. · 027f5f56
      Alexander Kornienko authored
      Trailing comments are not always aligned properly when UseTab is set to Always.
      
      Consider:
      
      int a;        // x
      int bbbbbbbb; // x
      With .clang-format:
      
      ---
      Language:        Cpp
      BasedOnStyle: LLVM
      UseTab: Always
      ...
      The trailing comments of this code block should be aligned, but aren't
      
      To align the first trailing comment it needs to insert 8 spaces. This should be
      one tab plus six spaces. It skips the logic of the first partial tab in
      FirstTabWidth (=2) + Style.TabWidth (=8) <= Spaces (=8) and only inserts one
      tab. Proposed fix and test is attached.
      
      Patch by Hylke Kleve.
      
      Differential revision: https://reviews.llvm.org/D57655
      
      llvm-svn: 354183
      027f5f56
    • Alina Sbirlea's avatar
      [EarlyCSE & MSSA] Cap the clobbering calls in EarlyCSE. · 383ccfb3
      Alina Sbirlea authored
      Summary:
      Unlimitted number of calls to getClobberingAccess can lead to high
      compile times in pathological cases.
      Limitting getClobberingAccess to a fairly high number. Can be adjusted
      based on users/need.
      Note: this is the only user of MemorySSA currently enabled by default.
      The same handling exists in LICM (disabled atm). As MemorySSA gains more
      users, this logic of capping will need to move inside MemorySSA.
      
      Reviewers: george.burgess.iv
      
      Subscribers: llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D58248
      
      llvm-svn: 354182
      383ccfb3
    • Jason Molenda's avatar
      Add some unconditional logging on the failure points when attaching · 3bf883ea
      Jason Molenda authored
      to a process so we'll always get messages in the console logs.  
      
      Also make the "is frontboard process" / "is backboard process"
      determination lazy, specifically take it out of the
      MachProcess::AttachForDebug codepath when we are attaching to a
      process, to simplify attaching.
      
      <rdar://problem/47982516> 
      <rdar://problem/48060134> 
      
      llvm-svn: 354181
      3bf883ea
    • Volodymyr Sapsai's avatar
      [ObjC] For type substitution in generics use a regular recursive type visitor. · 78b84cf9
      Volodymyr Sapsai authored
      Switch to the inheritance-based visitor from the lambda-based visitor to
      allow both preorder and postorder customizations during type
      transformation. NFC intended.
      
      Reviewers: ahatanak, erik.pilkington
      
      Reviewed By: erik.pilkington
      
      Subscribers: jkorous, dexonsmith, cfe-commits
      
      Differential Revision: https://reviews.llvm.org/D57075
      
      llvm-svn: 354180
      78b84cf9
    • Julian Lettner's avatar
      [Sanitizer] iOS: Pull up parallelism_group handling into common.lit.config · 68c6764c
      Julian Lettner authored
      Serial execution on iOS devices is not specific to sanitizers. We want
      to throttle all on-device tests. Pull the setting of the
      parallelism_group up into the common lit configuration file.
      
      Rename `darwin-ios-device-sanitizer` to `ios-device`. This group is not
      specific to sanitizers and (theoretically) independent from the host OS.
      
      Note that we don't support running unit tests on-device (there are no
      configurations generated for that). If that ever changes, we also need
      this configuration in `unittests/lit.common.unit.cfg`.
      
      Reviewers: delcypher
      
      Differential Revision: https://reviews.llvm.org/D58209
      
      llvm-svn: 354179
      68c6764c
    • Craig Topper's avatar
      [X86] Don't set exception mask bits when modifying FPCW to change rounding... · db2f084a
      Craig Topper authored
      [X86] Don't set exception mask bits when modifying FPCW to change rounding mode for fp->int conversion
      
      When we need to do an fp->int conversion using x87 instructions, we need to temporarily change the rounding mode to 0b11 and perform a store. To do this we save the old value of the fpcw to the stack, then set the fpcw to 0xc7f, do the store, then restore fpcw. But the 0xc7f value forces the exception mask bits 1. While this is what they would be in the default FP environment, as we move to support changing the FP environments, we shouldn't make this assumption.
      
      This patch changes the code to explicitly OR 0xc00 with the old value so that only the rounding mode is changed. Unfortunately, this requires two stack temporaries instead of one. One to hold the old value and one to hold the new value. Without two stack temporaries we would need an additional GPR. We already need one to do the OR operation in. This is similar to what gcc and icc do for this operation. Though they are both better at reusing the stack temporaries when there are multiple truncates in a function(or at least in a basic block)
      
      Differential Revision: https://reviews.llvm.org/D57788
      
      llvm-svn: 354178
      db2f084a
    • Davide Italiano's avatar
      Revert "Don't include UnixSignals.h from Host." · 1c298016
      Davide Italiano authored
      It broke the modules green dragon buildbot.
      
      llvm-svn: 354177
      1c298016
    • Richard Smith's avatar
      Fix implementation of [temp.local]p4. · afcfb6bc
      Richard Smith authored
      When a template-name is looked up, we need to give injected-class-name
      declarations of class templates special treatment, as they denote a
      template rather than a type.
      
      Previously we achieved this by applying a filter to the lookup results
      after completing name lookup, but that is incorrect in various ways, not
      least of which is that it lost all information about access and how
      members were named, and the filtering caused us to generally lose
      all ambiguity errors between templates and non-templates.
      
      We now preserve the lookup results exactly, and the few places that need
      to map from a declaration found by name lookup into a declaration of a
      template do so explicitly. Deduplication of repeated lookup results of
      the same injected-class-name declaration is done by name lookup instead
      of after the fact.
      
      This reinstates r354091, which was previously reverted in r354097
      because it exposed bugs in lldb and compiler-rt. Those bugs were fixed
      in r354173 and r354174 respectively.
      
      llvm-svn: 354176
      afcfb6bc
    • Kostya Serebryany's avatar
      [libFuzzer] form mode: add -ignore_crashes flag, honor the max_total_time... · 9982ee54
      Kostya Serebryany authored
      [libFuzzer] form mode: add -ignore_crashes flag, honor the max_total_time flag, print the number of ooms/timeouts/crashes, fix a typo
      
      llvm-svn: 354175
      9982ee54
    • Richard Smith's avatar
      Fix invalid code that Clang trunk will soon diagnose. · 1dcff8d1
      Richard Smith authored
      There is an ambiguity between ::SizeClassMap (the typedef declared near
      the start of this file) and __sanitizer::SizeClassMap (found by the
      'using namespace __sanitizer;' near the start of this file).
      
      Historically a Clang bug has meant that the error was not diagnosed, but
      soon Clang will start diagnosing it. Explicitly qualify this use of
      SizeClassMap so that it finds __sanitizer::SizeClassMap rather than
      being ill-formed due to ambiguity.
      
      llvm-svn: 354174
      1dcff8d1
    • Richard Smith's avatar
      Fix AST generated for a class template to connect the class inside a · 35b007e9
      Richard Smith authored
      class template back to the template.
      
      Previously, when the ASTImporter imported the class, it didn't know that
      it was the pattern of a class template, so made the class a name lookup
      result for the name of the template, resulting in ambiguity errors when
      naming the template.
      
      Due to a clang bug (fixed in r354091, reverted and soon to be
      re-committed), ambiguity errors between a template and a non-template
      were previously not diagnosed. Once r354091 is re-committed, this will
      be covered by existing lldb tests.
      
      llvm-svn: 354173
      35b007e9
    • Stella Stamenova's avatar
      [win] Resolve the module only if there isn't one already · a2d9fdf5
      Stella Stamenova authored
      Summary:
      This commit modifies the OnLoadModule method to resolve the module
      unless we already have one
      
      Change by Hui Huang to fix the failing LLDB tests on Windows
      
      Reviewers: labath, asmith
      
      Subscribers: abidh, lldb-commits
      
      Tags: #lldb
      
      Differential Revision: https://reviews.llvm.org/D58303
      
      llvm-svn: 354172
      a2d9fdf5
    • Philip Reames's avatar
      [InstCombine] Address a couple stylistic issues pointed out by reviewer [NFC] · 8220ecbc
      Philip Reames authored
      Better addressing comments from https://reviews.llvm.org/D58290.
      
      llvm-svn: 354171
      8220ecbc
    • Philip Reames's avatar
      [InstCombine] Convert atomicrmws to xchg or store where legal · cae6c767
      Philip Reames authored
      Implement two more transforms of atomicrmw:
      1) We can convert an atomicrmw which produces a known value in memory into an xchg instead.
      2) We can convert an atomicrmw xchg w/o users into a store for some orderings.
      
      Differential Revision: https://reviews.llvm.org/D58290
      
      llvm-svn: 354170
      cae6c767
    • Reid Kleckner's avatar
      Revert r354075 "[clang][FileManager] fillRealPathName even if we aren't opening the file" · e2bb3121
      Reid Kleckner authored
      The new test doesn't pass on Windows.
      
      llvm-svn: 354169
      e2bb3121
    • Zachary Turner's avatar
      Don't include UnixSignals.h from Host. · 63c300cf
      Zachary Turner authored
      Host had a function to get the UnixSignals instance corresponding
      to the current host architecture.  This means that Host had to
      include a file from Target.  To break this dependency, just make
      this a static function directly in UnixSignals.  We already have
      the function UnixSignals::Create(ArchSpec) anyway, so we just
      need to have UnixSignals::CreateForHost() which determines which
      value to pass for the ArchSpec.
      
      The goal here is to eventually break the Host->Target->Host
      circular dependency.
      
      Differential Revision: https://reviews.llvm.org/D57780
      
      llvm-svn: 354168
      63c300cf
    • Shoaib Meenai's avatar
      [docs] Document LLVM_ENABLE_IDE · f59ea25e
      Shoaib Meenai authored
      Use some of the wording and the motivating example from r344555. The
      lack of documentation was pointed out by Roman Lebedev.
      
      Differential Revision: https://reviews.llvm.org/D58286
      
      llvm-svn: 354167
      f59ea25e
    • Dan Albert's avatar
      [Driver] Default all Android ARM targets to NEON. · df89c6ff
      Dan Albert authored
      Summary:
      There are an insignificant number of ARM Android devices that don't
      support NEON. Default to using NEON since that will improve
      performance on the majority of devices. Users that need to target
      non-NEON devices can still explicitly disable NEON.
      
      Reviewers: srhines, pirama, kristof.beyls
      
      Reviewed By: pirama
      
      Subscribers: efriedma, javed.absar, cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D58153
      
      llvm-svn: 354166
      df89c6ff
    • Adrian Prantl's avatar
    • Volodymyr Sapsai's avatar
      [ObjC] Fix non-canonical types preventing type arguments substitution. · 4b512c36
      Volodymyr Sapsai authored
      `QualType::substObjCTypeArgs` doesn't go past non-canonical types and as
      the result misses some of the substitutions like `ObjCTypeParamType`.
      
      Update `SimpleTransformVisitor` to traverse past the type sugar.
      
      Reviewers: ahatanak, erik.pilkington
      
      Reviewed By: erik.pilkington
      
      Subscribers: jkorous, dexonsmith, cfe-commits
      
      Differential Revision: https://reviews.llvm.org/D57270
      
      llvm-svn: 354164
      4b512c36
    • Nirav Dave's avatar
      [X86] Fix LowerAsmOutputForConstraint. · 78758411
      Nirav Dave authored
      Summary:
      Update Flag when generating cc output.
      
      Fixes PR40737.
      
      Reviewers: rnk, nickdesaulniers, craig.topper, spatel
      
      Subscribers: hiraditya, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D58283
      
      llvm-svn: 354163
      78758411
    • Reid Kleckner's avatar
      [MSVC] Recognize `static_assert` keyword in C and C++98 · c1648f2b
      Reid Kleckner authored
      Summary:
      The main effect is that clang now accepts the following conforming C11
      code with MSVC headers:
        #include <assert.h>
        static_assert(1, "true");
      
      This is a non-conforming extension (the keyword is outside the
      implementer's namespace), so it is placed under -fms-compatibility
      instead of -fms-extensions like most MSVC-specific keyword extensions.
      
      Normally, in C11, the compiler is supposed to provide the _Static_assert
      keyword, and assert.h should define static_assert to _Static_assert.
      However, that is not what MSVC does, and MSVC doesn't even provide
      _Static_assert.
      
      This also has the less important side effect of enabling static_assert
      in C++98 mode with -fms-compatibility. It's exceptionally difficult to
      use modern MSVC headers without C++14 even, so this is relatively
      unimportant.
      
      Fixes PR26672
      
      Patch by Andrey Bokhanko!
      
      Reviewers: rsmith, thakis
      
      Subscribers: cfe-commits, STL_MSFT
      
      Differential Revision: https://reviews.llvm.org/D17444
      
      llvm-svn: 354162
      c1648f2b
    • Craig Topper's avatar
      [X86] Move all the SSE legality checks out of FP_TO_INTHelper and up to LowerFP_TO_INT. NFCI · 9c6a9276
      Craig Topper authored
      These checks aren't needed on the call to FP_TO_INTHelper from the type legalizer for splitting i64. We always want to use X87 FIST/FISTT to memory there.
      
      Moving up the SSE checks will allow this routine to focus on what it cares about and makes its return semantics cleaner.
      
      llvm-svn: 354161
      9c6a9276
    • Jonas Paulsson's avatar
      Recommit "[SystemZ] Do not emit VEXTEND or VROUND nodes without vector support." · c0eef354
      Jonas Paulsson authored
      It seems there were some problem with using a .mir test. For some reason
      doing '-stop-before=codegenprepare' and then '-start-before=codegenprepare'
      on the output .mir file results in the NoVRegs Property after instruction
      selection.
      
      Recommitting the same test as an .ll file instead.
      
      llvm-svn: 354160
      c0eef354
    • Vedant Kumar's avatar
      [CodeExtractor] Do not lift lifetime.end markers for region inputs · 5f5cac3a
      Vedant Kumar authored
      If a lifetime.end marker occurs along one path through the extraction
      region, but not another, then it's still incorrect to lift the marker,
      because there is some path through the extracted function which would
      ordinarily not reach the marker. If the call to the extracted function
      is in a loop, unrolling can cause inputs to the function to become
      optimized out as undef after the first iteration.
      
      To prevent incorrect stack slot merging in the calling function, it
      should be sufficient to lift lifetime.start markers for region inputs.
      I've tested this theory out by doing a stage2 check-all with randomized
      splitting enabled.
      
      This is a follow-up to r353973, and there's additional context for this
      change in https://reviews.llvm.org/D57834.
      
      rdar://47896986
      
      Differential Revision: https://reviews.llvm.org/D58253
      
      llvm-svn: 354159
      5f5cac3a
    • Vedant Kumar's avatar
      [HotColdSplit] Schedule splitting late to fix perf regression · 47a0c9b6
      Vedant Kumar authored
      With or without PGO data applied, splitting early in the pipeline
      (either before the inliner or shortly after it) regresses performance
      across SPEC variants. The cause appears to be that splitting hides
      context for subsequent optimizations.
      
      Schedule splitting late again, in effect reversing r352080, which
      scheduled the splitting pass early for code size benefits (documented in
      https://reviews.llvm.org/D57082).
      
      Differential Revision: https://reviews.llvm.org/D58258
      
      llvm-svn: 354158
      47a0c9b6
    • Evgeniy Stepanov's avatar
      Fix unsymbolized stack history printing. · 360163f6
      Evgeniy Stepanov authored
      Summary:
      When symbols are unavailable, the current code prints
        sp: ... pc: ... (null) (null)
      instead of module name + offset.
      
      Change the output to include module name and offset, and also to match
      the regular sanitizer stack trace format so that it is recognized by
      symbolize.py out of the box.
      
      Reviewers: kcc, pcc
      
      Subscribers: kubamracek, jdoerfert, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D58267
      
      llvm-svn: 354157
      360163f6
    • Evgeniy Stepanov's avatar
      Runtime flags for malloc bisection. · a70d88c7
      Evgeniy Stepanov authored
      Reviewers: kcc, pcc
      
      Subscribers: kubamracek, mgorny, jdoerfert, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D58162
      
      llvm-svn: 354156
      a70d88c7
    • Evgeniy Stepanov's avatar
      Fix false positive when tag_in_malloc=0,tag_in_free=1. · 2c0483f5
      Evgeniy Stepanov authored
      Summary:
      With tag_in_free=1, malloc() can not assume that the memory is untagged,
      and needs to retag is to 0.
      
      Reviewers: pcc, kcc
      
      Subscribers: kubamracek, jfb, jdoerfert, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D58158
      
      llvm-svn: 354155
      2c0483f5
    • Andrea Di Biagio's avatar
      [MCA] Improved code comment. NFC · 2187a4fa
      Andrea Di Biagio authored
      llvm-svn: 354154
      2187a4fa
    • Jonas Hahnfeld's avatar
      Revert "[compiler-rt] Cleanup usage of C++ ABI library" · ea686e28
      Jonas Hahnfeld authored
      This reverts r354132 because it breaks sanitizer-x86_64-linux:
      http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux/builds/19915
      
      llvm-svn: 354153
      ea686e28
    • Simon Pilgrim's avatar
      a22814a3
    • Bruno Ricci's avatar
      [Sema][NFC] SequenceChecker: Add tests for references/members, and prepare for the C++17 tests · 4569e4a3
      Bruno Ricci authored
      Add some tests for unsequenced operations with members and references.
      For now most of it is unhandled but it shows what work needs to be done.
      
      Also merge the tests for the C++17 sequencing rules in warn-unsequenced.cpp
      since we want to make sure that the appropriate warnings are still present
      in C++17 without duplicating the whole content of warn-unsequenced.cpp.
      
      llvm-svn: 354151
      4569e4a3
    • Andrea Di Biagio's avatar
      [MCA][LSUnit] Return the ID of the dependent memory operation from method · 5ad52e35
      Andrea Di Biagio authored
      isReady(). NFCI
      
      This is yet another change in preparation for a fix for PR37494.
      
      llvm-svn: 354150
      5ad52e35
    • Jorge Gorbe Moya's avatar
      Disable stop-hook-threads.test on Linux · da0487f3
      Jorge Gorbe Moya authored
      ExecControl/StopHook/stop-hook-threads.test is flaky on Linux (it's
      consistently failing on my machine, but doesn't fail on a co-worker's).
      I'm seeing the following assertion failure:
      
      ```
      CommandObject.cpp:145: bool lldb_private::CommandObject::CheckRequirements(lldb_private::CommandReturnObject&): Assertion `m_exe_ctx.GetTargetPtr() == NULL' failed.
      ```
      
      Interestingly, this doesn't happen when typing the same commands in
      interactive mode. The cause seems to be that, in synchronous execution
      mode continue waits until the process stops again, and that includes
      running any stop-hooks for that later stop, so we end with a stack trace
      like this (lots of frames omitted for clarity):
      
      ```
      abort()
      CommandObject::CheckRequirements() <-- this is again the same instance of CommandObjectProcessContinue, fails assertion because the previous continue command hasn't finished.
      Target::RunStopHooks()
      CommandObjectProcessContinue::DoExecute()
      Target::RunStopHooks()
      ```
      
      In general, it seems like using process control commands inside
      stop-hooks does not have very well defined semantics. You don't even
      need multiple threads to make that assertion fail, you can build
      
      ```
      int main() {
        printf("1\n");  // break1
        printf("2\n");  // break2
      }
      ```
      
      and then on lldb
      
      ```
      target stop-hook add -o continue
      break set -f stop-hook-simple.cpp -p "break1"
      break set -f stop-hook-simple.cpp -p "break2"
      run
      ```
      
      In this case it's even worse because the presence of multiple threads
      makes it prone to race conditions. In some tests I ran with a simpler
      version of this test case, I was hitting either the previous assertion
      failure or the following issue:
      
      1. Two threads reach a breakpoint
      2. First stop-hook does a process continue
      3. Threads end
      4. Second stop-hook runs, complains about process not existing.
      
      This change disables the test on Linux. It's already marked as XFAIL on
      Windows, so maybe we should just delete it until it's clear what should
      be the expected behavior in these cases. Or maybe try to come up with a
      way to write a similar multithreaded test without calling continue from
      a stop hook, I don't know.
      
      Differential Revision: https://reviews.llvm.org/D58257
      
      llvm-svn: 354149
      da0487f3