1. Mar 29, 2018
    • Pavel Labath's avatar
      .debug_names: Parse DW_IDX_die_offset as a reference · 2d1fc437
      Pavel Labath authored
      Before this patch we were parsing the attributes as section offsets, as
      that is what apple_names is doing. However, this is not correct as DWARF
      v5 specifies that this attribute should use the Reference form class.
      
      This also updates all the testcases (except the ones that deliberately
      pass a different form) to use the correct form class.
      
      llvm-svn: 328773
      2d1fc437
    • Sjoerd Meijer's avatar
      [Kaleidoscope] Tiny typo fixes · 4f8f1e51
      Sjoerd Meijer authored
      Fixes for "lets" references which should be "let's" in the Kaleidoscope
      tutorial.
      
      Patch by: Robin Dupret
      
      Differential Revision: https://reviews.llvm.org/D44990
      
      llvm-svn: 328772
      4f8f1e51
    • Simon Pilgrim's avatar
      [X86][SSE] Don't bother re-adding combined target shuffles to the work list · 71c5f3ff
      Simon Pilgrim authored
      We are re-adding all the bitcasts, constant masks and target shuffles to the work list for no apparent gain.
      
      Found while investigating adding SimplifyDemandedVectorElts to target shuffles.
      
      Differential Revision: https://reviews.llvm.org/D44942
      
      llvm-svn: 328771
      71c5f3ff
    • Pavel Labath's avatar
      NativeThreadProtocol: delete dead code · 47381fa6
      Pavel Labath authored
      These functions were unused as everyone just went straight for the
      direct operations on the register context. In fact, the
      Save/RestoreAllRegisters actually appear to be wrong (inverted). Thanks
      to Tatyana for pointing this out.
      
      These functions are not very useful now that we can guarantee that each
      thread always contains a valid register context, so I just delete them.
      
      llvm-svn: 328770
      47381fa6
    • Sylvestre Ledru's avatar
      Rename clang link from clang-X.Y to clang-X · a8b717fd
      Sylvestre Ledru authored
      Summary:
      As we are only doing X.0.Z releases (not using the minor version), there is no need to keep -X.Y in the version.
      So, instead, I propose the following:
      Instead of having clang-7.0 in bin/, we will have clang-7
      
      Since also matches was gcc is doing.
      
      Reviewers: tstellar, dlj, dim, hans
      
      Reviewed By: dim, hans
      
      Subscribers: dim, mgorny, cfe-commits
      
      Differential Revision: https://reviews.llvm.org/D41808
      
      llvm-svn: 328769
      a8b717fd
    • Sylvestre Ledru's avatar
      Rename llvm library from libLLVM-X.Y to libLLVM-X · f22ebb75
      Sylvestre Ledru authored
      Summary:
      As we are only doing X.0.Z releases (not using the minor version), there is no need to keep -X.Y in the version.
      
      Like patch https://reviews.llvm.org/D41808, I propose that we rename libLLVM-7.0svn.so to libLLVM-7svn.so 
      This patch will also rename downstream libraries like liblldb-7.0 to liblldb-7
      
      Reviewers: axw, beanz, dim, hans
      
      Reviewed By: dim, hans
      
      Subscribers: mgorny, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D41869
      
      llvm-svn: 328768
      f22ebb75
    • Simon Dardis's avatar
      [Mips] Remove dead code · 32a27fc7
      Simon Dardis authored
      I believe the role of ehDataReg has been replaced by MipsABIInfo::GetEhDataReg, thus removing the dead code.
      
      Patch By: Wei-Ren Chen.
      
      Reviewers: ehostunreach, sdardis
      
      Differential Revision: https://reviews.llvm.org/D44867
      
      llvm-svn: 328767
      32a27fc7
    • David Green's avatar
      [LoopRotate] Restructuring LoopRotation.cpp to create Loop Rotation Pass with... · b0aa36f9
      David Green authored
      [LoopRotate] Restructuring LoopRotation.cpp to create Loop Rotation Pass with Loop Rotation Utility Interface
      
      The existing LoopRotation.cpp is implemented as one of loop passes instead of
      being a utility. The user cannot easily perform the loop rotation selectively
      (or on demand) under different optimization level. For example, the loop
      rotation is needed as part of the logic to convert a loop into a loop with
      bottom test for a transformation. If the loop rotation is simply added as a
      loop pass before the transformation, the pass is skipped if it is compiled at
      –O0 or if it is explicitly disabled by the user, causing the compiler to
      generate incorrect code. Furthermore, as a loop pass it will rotate all loops
      instead of just the relevant loops.
      
      We provide a utility interface for the loop rotation so that the loop rotation
      can be called on demand. The changeset is as follows:
      
      - Create a new file lib/Transforms/Utils/LoopRotationUtils.cpp and move the main
        implementation of class LoopRotate into this file.
      - Create a new file llvm/include/Transform/Utils/LoopRotationUtils.h with the
        interface LoopRotation(...).
      - Original LoopRotation.cpp is changed to use the utility function LoopRotation
        in LoopRotationUtils.cpp. This is done in the same way community did for
        mem-to-reg implementation.
      
      Patch by Jin Lin!
      
      Differential Revision: https://reviews.llvm.org/D44595
      
      llvm-svn: 328766
      b0aa36f9
    • Benjamin Kramer's avatar
      [Transforms] Make sure to include the c binding header when defining c binding functions · 6b995a4a
      Benjamin Kramer authored
      Otherwise the definitions can't see the extern C declarations and get
      name mangled, making it impossible for users to call them. This breaks
      the Go bindings.
      
      llvm-svn: 328765
      6b995a4a
    • Max Kazantsev's avatar
      [NFC] Fix meaningless assert in SCEV · 18f93894
      Max Kazantsev authored
      llvm-svn: 328764
      18f93894
    • Richard Trieu's avatar
      Refactor some code for a warning. NFC. · eda329c5
      Richard Trieu authored
      Use range-based for-loops instead of iterators to walk over vectors.
      Switch the key of the DenseMap so a custom key handler is no longer needed.
      Remove unncessary adds to the DenseMap.
      Use unique_ptr instead of manual memory management.
      
      llvm-svn: 328763
      eda329c5
    • Craig Topper's avatar
      [X86] Don't pass getRegisterName from the InstPrinters into... · a21758fa
      Craig Topper authored
      [X86] Don't pass getRegisterName from the InstPrinters into EmitAnyX86InstComments. Just always use the function from the ATTPrinter. NFC
      
      The IntelPrinter and the ATTPrinter produce the same strings for the same input. We already use the ATTPrinter explicitly in several other places.
      
      llvm-svn: 328762
      a21758fa
    • Frederic Riss's avatar
      Prevent double release of mach ports · fa37026d
      Frederic Riss authored
      Summary:
      When a MIG routine returns KERN_FAILURE, the demux function will release any OOL resources like ports. In this case, task_port and thread_port will be released twice, potentially resulting in use after free of the ports.
      
      I don't think we can test this in any useful way
      rdar://problem/37331387
      
      Reviewers: jasonmolenda
      
      Subscribers: lldb-commits
      
      Differential Revision: https://reviews.llvm.org/D45011
      
      llvm-svn: 328761
      fa37026d
    • Eric Fiselier's avatar
      fix typo in align_const_pair_U_V.pass.cpp · 02eb974a
      Eric Fiselier authored
      llvm-svn: 328760
      02eb974a
    • Robert Widmann's avatar
      [LLVM-C] Finish exception instruction bindings · 6775f52f
      Robert Widmann authored
      Summary:
      Add support for cleanupret, catchret, catchpad, cleanuppad and catchswitch and their associated accessors.
      
      Test is modified from SimplifyCFG because it contains many diverse usages of these instructions.
      
      Reviewers: whitequark, deadalnix, echristo
      
      Reviewed By: echristo
      
      Subscribers: llvm-commits, harlanhaskins
      
      Differential Revision: https://reviews.llvm.org/D44496
      
      llvm-svn: 328759
      6775f52f
    • Eric Fiselier's avatar
      Move libc++ pair/tuple assign test to libcxx/ test directory. · f8aa2387
      Eric Fiselier authored
      Libc++ implements the pair& operator=(pair<U, V>) assignment operator
      using a single template that handles assignment from all tuple-like types.
      
      This patch moves the test for that to the libcxx test directory since
      it's non-standard. It also adds additional tests to the std/.../pair
      directory to test the standard behavior this template implements.
      
      llvm-svn: 328758
      f8aa2387
    • Craig Topper's avatar
      [X86] Rename RIi64_NOREX tblgen class to just Ii64. Make RIi64 inherit from it. NFC · 7456af88
      Craig Topper authored
      This feels more consistent with the other classes. We don't need to say _NOREX if we didn't start it with an R in the first place.
      
      llvm-svn: 328757
      7456af88
    • Craig Topper's avatar
      [X86] Cleanup inheritance of the X86InstrFormats.td classes. NFC · 7441ffff
      Craig Topper authored
      EVEX shouldn't inherit from VEX and EVEX_4V shouldn't inherit from VEX_4V.
      
      llvm-svn: 328756
      7441ffff
    • George Burgess IV's avatar
      [MemorySSA] Turn an assert into a condition · af0b06f4
      George Burgess IV authored
      Eli pointed out that variadic functions are totally a thing, so this
      assert is incorrect.
      
      No test-case is provided, since the only way this assert fires is if a
      specific DenseMap falls back to doing `isEqual` checks, and that seems
      fairly brittle (and requires a pyramid of growing
      `call void (i8, ...) @varargs(i8 0)`).
      
      llvm-svn: 328755
      af0b06f4
    • George Karpenkov's avatar
      [astmatchers] Fix linking issue · 10f4c969
      George Karpenkov authored
      llvm-svn: 328754
      10f4c969
    • Alex Shlyapnikov's avatar
      [ASan] Disable aligned_alloc-alignment.cc on PPC64. · b43b5580
      Alex Shlyapnikov authored
      Differential Revision: https://reviews.llvm.org/D44404
      
      llvm-svn: 328753
      b43b5580
    • George Karpenkov's avatar
      71105816
    • Eric Fiselier's avatar
      Fix PR36914 - num_get::get(unsigned) incorrectly handles negative numbers. · bc3a21f8
      Eric Fiselier authored
      This patch corrects num_get for unsigned types to support strings
      with a leading `-` character. According to the standard the
      number should be parsed as an unsigned integer and then
      negated.
      
      llvm-svn: 328751
      bc3a21f8
    • George Karpenkov's avatar
    • George Karpenkov's avatar
      [ast] Do not auto-initialize Objective-C for-loop variables in Objective-C++... · ec38cf7a
      George Karpenkov authored
      [ast] Do not auto-initialize Objective-C for-loop variables in Objective-C++ in templatized code under ARC
      
      The AST for the fragment
      
      ```
      @interface I
      @end
      
      template <typename>
      void decode(I *p) {
        for (I *k in p) {}
      }
      
      void decode(I *p) {
        decode<int>(p);
      }
      ```
      
      differs heavily when templatized and non-templatized:
      
      ```
      |-FunctionTemplateDecl 0x7fbfe0863940 <line:4:1, line:7:1> line:5:6 decode
      | |-TemplateTypeParmDecl 0x7fbfe0863690 <line:4:11> col:11 typename depth 0 index 0
      | |-FunctionDecl 0x7fbfe08638a0 <line:5:1, line:7:1> line:5:6 decode 'void (I *__strong)'
      | | |-ParmVarDecl 0x7fbfe08637a0 <col:13, col:16> col:16 referenced p 'I *__strong'
      | | `-CompoundStmt 0x7fbfe0863b88 <col:19, line:7:1>
      | |   `-ObjCForCollectionStmt 0x7fbfe0863b50 <line:6:3, col:20>
      | |     |-DeclStmt 0x7fbfe0863a50 <col:8, col:13>
      | |     | `-VarDecl 0x7fbfe08639f0 <col:8, col:11> col:11 k 'I *const __strong'
      | |     |-ImplicitCastExpr 0x7fbfe0863a90 <col:16> 'I *' <LValueToRValue>
      | |     | `-DeclRefExpr 0x7fbfe0863a68 <col:16> 'I *__strong' lvalue ParmVar 0x7fbfe08637a0 'p' 'I *__strong'
      | |     `-CompoundStmt 0x7fbfe0863b78 <col:19, col:20>
      | `-FunctionDecl 0x7fbfe0863f80 <line:5:1, line:7:1> line:5:6 used decode 'void (I *__strong)'
      |   |-TemplateArgument type 'int'
      |   |-ParmVarDecl 0x7fbfe0863ef8 <col:13, col:16> col:16 used p 'I *__strong'
      |   `-CompoundStmt 0x7fbfe0890cf0 <col:19, line:7:1>
      |     `-ObjCForCollectionStmt 0x7fbfe0890cc8 <line:6:3, col:20>
      |       |-DeclStmt 0x7fbfe0890c70 <col:8, col:13>
      |       | `-VarDecl 0x7fbfe0890c00 <col:8, col:11> col:11 k 'I *__strong' callinit
      |       |   `-ImplicitValueInitExpr 0x7fbfe0890c60 <<invalid sloc>> 'I *__strong'
      |       |-ImplicitCastExpr 0x7fbfe0890cb0 <col:16> 'I *' <LValueToRValue>
      |       | `-DeclRefExpr 0x7fbfe0890c88 <col:16> 'I *__strong' lvalue ParmVar 0x7fbfe0863ef8 'p' 'I *__strong'
      |       `-CompoundStmt 0x7fbfe0863b78 <col:19, col:20>
      ```
      
      Note how in the instantiated version ImplicitValueInitExpr unexpectedly appears.
      
      While objects are auto-initialized under ARC, it does not make sense to
      have an initializer for a for-loop variable, and it makes even less
      sense to have such a different AST for instantiated and non-instantiated
      version.
      
      Digging deeper, I have found that there are two separate Sema* files for
      dealing with templates and for dealing with non-templatized code.
      In a non-templatized version, an initialization was performed only for
      variables which are not loop variables for an Objective-C loop and not
      variables for a C++ for-in loop:
      
      ```
        if (FRI && (Tok.is(tok::colon) || isTokIdentifier_in())) {
          bool IsForRangeLoop = false;
          if (TryConsumeToken(tok::colon, FRI->ColonLoc)) {
            IsForRangeLoop = true;
            if (Tok.is(tok::l_brace))
              FRI->RangeExpr = ParseBraceInitializer();
            else
              FRI->RangeExpr = ParseExpression();
          }
      
          Decl *ThisDecl = Actions.ActOnDeclarator(getCurScope(), D);
          if (IsForRangeLoop)
            Actions.ActOnCXXForRangeDecl(ThisDecl);
          Actions.FinalizeDeclaration(ThisDecl);
          D.complete(ThisDecl);
          return Actions.FinalizeDeclaratorGroup(getCurScope(), DS, ThisDecl);
        }
      
        SmallVector<Decl *, 8> DeclsInGroup;
        Decl *FirstDecl = ParseDeclarationAfterDeclaratorAndAttributes(
            D, ParsedTemplateInfo(), FRI);
      ```
      
      However the code in SemaTemplateInstantiateDecl was inconsistent,
      guarding only against C++ for-in loops.
      
      rdar://38391075
      
      Differential Revision: https://reviews.llvm.org/D44989
      
      llvm-svn: 328749
      ec38cf7a
    • George Burgess IV's avatar
      [MemorySSA] Consider callsite args for hashing and equality. · 3588fd48
      George Burgess IV authored
      We use a `DenseMap<MemoryLocOrCall, MemlocStackInfo>` to keep track of
      prior work when optimizing uses in MemorySSA. Because we weren't
      accounting for callsite arguments in either the hash code or equality
      tests for `MemoryLocOrCall`s, we optimized uses too aggressively in
      some rare cases.
      
      Fix by Daniel Berlin.
      
      Should fix PR36883.
      
      llvm-svn: 328748
      3588fd48
    • George Karpenkov's avatar
      [ASTMatchers] Introduce a matcher for matching any given Objective-C selector · 88a16a07
      George Karpenkov authored
      Incudes a tiny related refactoring.
      
      Differential Revision: https://reviews.llvm.org/D44858
      
      llvm-svn: 328747
      88a16a07
    • George Karpenkov's avatar
    • David Blaikie's avatar
      Remove some unused includes to fix layering. · b3f471a4
      David Blaikie authored
      llvm-svn: 328745
      b3f471a4
    • David Blaikie's avatar
      Split Disassembler.h in two to fix dependencies · 3d94e9f3
      David Blaikie authored
      Support includes this header for the typedefs - but logically it's part
      of the MC/Disassembler library that implements the functions. Split the
      header so as not to create a circular dependency.
      
      This is another case where probably inverting the llvm-c implementation
      might be best (rather than core llvm libraries implementing the parts of
      llvm-c - instead llvm-c could be its own library, depending on all the
      parts of LLVM's core libraries to then implement llvm-c on top of
      them... if that makes sense)
      
      llvm-svn: 328744
      3d94e9f3
    • David Blaikie's avatar
      Add missing dependency (headers are included from MC, so a link dependency... · 10f71304
      David Blaikie authored
      Add missing dependency (headers are included from MC, so a link dependency could exist easily enough)
      
      llvm-svn: 328743
      10f71304
    • Alex Shlyapnikov's avatar
      [ASan] Disable aligned_alloc-alignment.cc on ppc64be · 23953331
      Alex Shlyapnikov authored
      Differential Revision: https://reviews.llvm.org/D44404
      
      llvm-svn: 328742
      23953331
    • Alex Shlyapnikov's avatar
      [ASan] Disable aligned_alloc-alignment.cc test on gcc. · 5062d7a2
      Alex Shlyapnikov authored
      This check "CHECK: {{#0 0x.* in .*aligned_alloc}}" fails on ppc64be, gcc
      build. Disabling the test for gcc for now.
      
      Differential Revision: https://reviews.llvm.org/D44404
      
      llvm-svn: 328741
      5062d7a2
    • Rui Ueyama's avatar
      Rename NonLocal -> Global. · efe9af9f
      Rui Ueyama authored
      NonLocal is technically more accurate, but we already use the term
      "Global" to specify the non-local part of the symbol table, and
      Local <-> Global is easier to digest.
      
      llvm-svn: 328740
      efe9af9f
    • Rui Ueyama's avatar
      Move code so that the code matches with a comment. NFC. · 6a1ca262
      Rui Ueyama authored
      llvm-svn: 328739
      6a1ca262
    • Rafael Espindola's avatar
      Strip @VER suffices from the LTO output. · c8f774b3
      Rafael Espindola authored
      This fixes pr36623.
      
      The problem is that we have to parse versions out of names before LTO
      so that LTO can use that information.
      
      When we get the LTO produced .o files, we replace the previous symbols
      with the LTO produced ones, but they still have @ in their names.
      
      We could just trim the name directly, but calling parseSymbolVersion
      to do it is simpler.
      
      llvm-svn: 328738
      c8f774b3
    • David Blaikie's avatar
      Plumb useAA through TargetTransformInfo to remove Transforms->CodeGen header dependency · 8ad9a973
      David Blaikie authored
      Thanks to echristo for the pointers on direction.
      
      llvm-svn: 328737
      8ad9a973
    • Rui Ueyama's avatar
      Unloop a for-loop so that we can comment on each symbol. NFC. · 2ce74015
      Rui Ueyama authored
      llvm-svn: 328736
      2ce74015
    • Eugene Zelenko's avatar
    • Alex Shlyapnikov's avatar
      [ASan] Disable aligned_alloc-alignment.cc on Android. · b276621d
      Alex Shlyapnikov authored
      Differential Revision: https://reviews.llvm.org/D44404
      
      llvm-svn: 328734
      b276621d