Skip to content
Snippets Groups Projects
  1. Nov 21, 2015
    • Tom Stellard's avatar
      Merging r247435: · c3ab51cd
      Tom Stellard authored
      ------------------------------------------------------------------------
      r247435 | david.majnemer | 2015-09-11 13:34:34 -0400 (Fri, 11 Sep 2015) | 8 lines
      
      [X86] Make sure startproc/endproc are paired
      
      We used different conditions to determine if we should emit startproc vs
      endproc.  Use the same condition to ensure that they will always be
      paired.
      
      This fixes PR24374.
      
      ------------------------------------------------------------------------
      
      llvm-svn: 253742
  2. Jul 14, 2015
    • Keno Fischer's avatar
      [CodeGen] Force emission of personality directive if explicitly specified · aff703a2
      Keno Fischer authored
      Summary:
      Before this change, personality directives were not emitted
      if there was no invoke left in the function (of course until
      recently this also meant that we couldn't know what
      the personality actually was). This patch forces personality directives
      to still be emitted, unless it is known to be a noop in the absence of
      invokes, or the user explicitly specified `nounwind` (and not
      `uwtable`) on the function.
      
      Reviewers: majnemer, rnk
      
      Subscribers: rnk, llvm-commits
      
      Differential Revision: http://reviews.llvm.org/D10884
      
      llvm-svn: 242185
      aff703a2
  3. Jul 13, 2015
    • Reid Kleckner's avatar
      [WinEH] Emit the LSDA even if no lpads remain but outlining occurred · 9a1a9194
      Reid Kleckner authored
      The outlined funclets call intrinsics which reference labels from the
      LSDA. This situation can easily arise in small functions with a single
      cleanup at -O0, where Clang marks a definition as nounwind, and then
      WinEHPrepare "discovers" that the landingpad is dead by accident and
      deletes it.
      
      We now need to ask the LLVM IR Function for it's personality directly,
      rather than going through MachineModuleInfo.
      
      Fixes PR23892.
      
      llvm-svn: 242063
      9a1a9194
  4. Jul 10, 2015
    • Reid Kleckner's avatar
      [WinEH] Make sure LSDA tables are 4 byte aligned · 85a2450d
      Reid Kleckner authored
      Apparently this is important, otherwise _except_handler3 assumes that
      the registration node is corrupted and ignores it.
      
      Also fix a bug in WinEHPrepare where we would insert code after a
      terminator instruction.
      
      llvm-svn: 241877
      85a2450d
  5. Jul 07, 2015
    • Reid Kleckner's avatar
      Rename llvm.frameescape and llvm.framerecover to localescape and localrecover · 60381791
      Reid Kleckner authored
      Summary:
      Initially, these intrinsics seemed like part of a family of "frame"
      related intrinsics, but now I think that's more confusing than helpful.
      Initially, the LangRef specified that this would create a new kind of
      allocation that would be allocated at a fixed offset from the frame
      pointer (EBP/RBP). We ended up dropping that design, and leaving the
      stack frame layout alone.
      
      These intrinsics are really about sharing local stack allocations, not
      frame pointers. I intend to go further and add an `llvm.localaddress()`
      intrinsic that returns whatever register (EBP, ESI, ESP, RBX) is being
      used to address locals, which should not be confused with the frame
      pointer.
      
      Naming suggestions at this point are welcome, I'm happy to re-run sed.
      
      Reviewers: majnemer, nicholas
      
      Subscribers: llvm-commits
      
      Differential Revision: http://reviews.llvm.org/D11011
      
      llvm-svn: 241633
      60381791
  6. Jun 30, 2015
    • Reid Kleckner's avatar
      [SEH] Add new intrinsics for recovering and restoring parent frames · 399a2fe4
      Reid Kleckner authored
      The incoming EBP value established by the runtime is actually a pointer
      to the end of the EH registration object, and not the true parent
      function frame pointer. Clang doesn't need llvm.x86.seh.exceptioninfo
      anymore because we know that the exception info pointer is at a fixed
      offset from this incoming EBP.
      
      The llvm.x86.seh.recoverfp intrinsic takes an EBP value provided by the
      EH runtime and returns a pointer that is usable with llvm.framerecover.
      
      The llvm.x86.seh.restoreframe intrinsic is inserted by the 32-bit
      specific preparation pass in blocks targetted by the EH runtime. It
      re-establishes any physical registers used by the parent function to
      address the stack, such as the frame, base, and stack pointers.
      
      Neither of these intrinsics correctly handle stack realignment prologues
      yet, but it's possible to add that later.
      
      Reviewers: majnemer
      
      Differential Revision: http://reviews.llvm.org/D10848
      
      llvm-svn: 241125
      399a2fe4
  7. Jun 11, 2015
    • Reid Kleckner's avatar
      [WinEH] Put finally pointers in the handler scope table field · 81d1cc00
      Reid Kleckner authored
      We were putting them in the filter field, which is correct for 64-bit
      but wrong for 32-bit.
      
      Also switch the order of scope table entry emission so outermost entries
      are emitted first, and fix an obvious state assignment bug.
      
      llvm-svn: 239574
      81d1cc00
    • Reid Kleckner's avatar
      [WinEH] Create an llvm.x86.seh.exceptioninfo intrinsic · a9d62535
      Reid Kleckner authored
      This intrinsic is like framerecover plus a load. It recovers the EH
      registration stack allocation from the parent frame and loads the
      exception information field out of it, giving back a pointer to an
      EXCEPTION_POINTERS struct. It's designed for clang to use in SEH filter
      expressions instead of accessing the EXCEPTION_POINTERS parameter that
      is available on x64.
      
      This required a minor change to MC to allow defining a label variable to
      another absolute framerecover label variable.
      
      llvm-svn: 239567
      a9d62535
  8. Jun 10, 2015
  9. Jun 09, 2015
    • Reid Kleckner's avatar
      [WinEH] Add 32-bit SEH state table emission prototype · f12c030f
      Reid Kleckner authored
      This gets all the handler info through to the asm printer and we can
      look at the .xdata tables now. I've convinced one small catch-all test
      case to work, but other than that, it would be a stretch to say this is
      functional.
      
      The state numbering algorithm avoids doing any scope reconstruction as
      we do for C++ to simplify the implementation.
      
      llvm-svn: 239433
      f12c030f
  10. May 30, 2015
  11. May 29, 2015
    • Reid Kleckner's avatar
      [WinEH] Emit EH tables for __CxxFrameHandler3 on 32-bit x86 · 1d3d4adb
      Reid Kleckner authored
      Small (really small!) C++ exception handling examples work on 32-bit x86
      now.
      
      This change disables the use of .seh_* directives in WinException when
      CFI is not in use. It also uses absolute symbol references in the tables
      instead of imagerel32 relocations.
      
      Also fixes a cache invalidation bug in MMI personality classification.
      
      llvm-svn: 238575
      1d3d4adb
  12. May 28, 2015
  13. May 18, 2015
  14. May 11, 2015
  15. Apr 24, 2015
  16. Apr 23, 2015
  17. Apr 22, 2015
  18. Apr 21, 2015
  19. Apr 17, 2015
  20. Apr 15, 2015
  21. Apr 14, 2015
  22. Apr 10, 2015
    • David Majnemer's avatar
      [WinEHPrepare] Don't rely on the order of IR · 5c65f58f
      David Majnemer authored
      The IPToState table must be emitted after we have generated labels for
      all functions in the table.  Don't rely on the order of the list of
      globals.  Instead, utilize WinEHFuncInfo to tell us how many catch
      handlers we expect to outline.  Once we know we've visited all the catch
      handlers, emit the cppxdata.
      
      llvm-svn: 234566
      5c65f58f
  23. Apr 07, 2015
  24. Apr 03, 2015
  25. Mar 31, 2015
    • David Majnemer's avatar
      [WinEH] Generate .xdata for catch handlers · a225a19d
      David Majnemer authored
      This lets us catch exceptions in simple cases.
      
      N.B. Things that do not work include (but are not limited to):
      - Throwing from within a catch handler.
      - Catching an object with a named catch parameter.
      - 'CatchHigh' is fictitious, we aren't sure of its purpose.
      - We aren't entirely efficient with regards to the number of EH states
        that we generate.
      - IP-to-State tables are sensitive to the order of emission.
      
      llvm-svn: 233767
      a225a19d
  26. Mar 30, 2015
  27. Mar 17, 2015
Loading