Skip to content
  1. Apr 11, 2018
    • David Blaikie's avatar
      Rename *CommandFlags.def to *CommandFlags.inc · 4333f970
      David Blaikie authored
      These aren't the .def style files used in LLVM that require a macro
      defined before their inclusion - they're just basic non-modular includes
      to stamp out command line flag variables.
      
      llvm-svn: 329840
      4333f970
  2. Jan 09, 2018
    • Craig Topper's avatar
      [lli] Make lli support -mcpu=native for CPU autodetection · 243f20f1
      Craig Topper authored
      llc, opt, and clang can all autodetect the CPU and supported features. lli cannot as far as I could tell.
      
      This patch uses the getCPUStr() and introduces a new getCPUFeatureList() and uses those in lli in place of MCPU and MAttrs.
      
      Ideally, we would merge getCPUFeatureList and getCPUFeatureStr, but opt and llc need a string and lli wanted a list. Maybe we should just return the SubtargetFeature object and let the caller decide what it needs?
      
      Differential Revision: https://reviews.llvm.org/D41833
      
      llvm-svn: 322100
      243f20f1
  3. Nov 27, 2017
    • David Blaikie's avatar
      Rename CommandFlags.h -> CommandFlags.def · c14bfec4
      David Blaikie authored
      Since this isn't a real header - it includes static functions and had
      external linkage variables (though this change makes them static, since
      that's what they should be) so can't be included more than once in a
      program.
      
      llvm-svn: 319082
      c14bfec4
  4. Sep 04, 2017
    • Lang Hames's avatar
      [ORC] Refactor OrcRemoteTarget code to expose its RPC API, reduce · 9e68b734
      Lang Hames authored
      code duplication in the client, and improve error propagation.
      
      This patch moves the OrcRemoteTarget rpc::Function declarations from
      OrcRemoteTargetRPCAPI into their own namespaces under llvm::orc::remote so that
      they can be used in new contexts (in particular, a remote-object-file adapter
      layer that I will commit shortly).
      
      Code duplication in OrcRemoteTargetClient (especially in loops processing the
      code, rw-data and ro-data allocations) is removed by moving the loop bodies
      into their own functions.
      
      Error propagation is (slightly) improved by adding an ErrorReporter functor to
      the OrcRemoteTargetClient -- Errors that can't be returned (because they occur
      in destructors, or behind stable APIs that don't provide error returns) can be
      sent to the ErrorReporter instead. Some methods in the Client API are also
      changed to make better use of the Expected class: returning Expected<T>s rather
      than returning Errors and taking T&s to store the results.
      
      llvm-svn: 312500
      9e68b734
  5. Aug 28, 2017
  6. Aug 03, 2017
    • Rafael Espindola's avatar
      Delete Default and JITDefault code models · 79e238af
      Rafael Espindola authored
      IMHO it is an antipattern to have a enum value that is Default.
      
      At any given piece of code it is not clear if we have to handle
      Default or if has already been mapped to a concrete value. In this
      case in particular, only the target can do the mapping and it is nice
      to make sure it is always done.
      
      This deletes the two default enum values of CodeModel and uses an
      explicit Optional<CodeModel> when it is possible that it is
      unspecified.
      
      llvm-svn: 309911
      79e238af
  7. Jul 11, 2017
  8. Apr 11, 2017
  9. Apr 06, 2017
  10. Nov 20, 2016
  11. Nov 17, 2016
  12. Nov 11, 2016
    • Lang Hames's avatar
      [ORC] Re-apply 286620 with fixes for the ErrorSuccess class. · 1f2bf2d3
      Lang Hames authored
      llvm-svn: 286639
      1f2bf2d3
    • Lang Hames's avatar
      [ORC] Revert r286620 while I investigate a bot failure. · 4f734f25
      Lang Hames authored
      llvm-svn: 286621
      4f734f25
    • Lang Hames's avatar
      [ORC] Refactor the ORC RPC utilities to add some new features. · ae1fdddb
      Lang Hames authored
      (1) Add support for function key negotiation.
      
      The previous version of the RPC required both sides to maintain the same
      enumeration for functions in the API. This means that any version skew between
      the client and server would result in communication failure.
      
      With this version of the patch functions (and serializable types) are defined
      with string names, and the derived function signature strings are used to
      negotiate the actual function keys (which are used for efficient call
      serialization). This allows clients to connect to any server that supports a
      superset of the API (based on the function signatures it supports).
      
      (2) Add a callAsync primitive.
      
      The callAsync primitive can be used to install a return value handler that will
      run as soon as the RPC function's return value is sent back from the remote.
      
      (3) Launch policies for RPC function handlers.
      
      The new addHandler method, which installs handlers for RPC functions, takes two
      arguments: (1) the handler itself, and (2) an optional "launch policy". When the
      RPC function is called, the launch policy (if present) is invoked to actually
      launch the handler. This allows the handler to be spawned on a background
      thread, or added to a work list. If no launch policy is used, the handler is run
      on the server thread itself. This should only be used for short-running
      handlers, or entirely synchronous RPC APIs.
      
      (4) Zero cost cross type serialization.
      
      You can now define serialization from any type to a different "wire" type. For
      example, this allows you to call an RPC function that's defined to take a
      std::string while passing a StringRef argument. If a serializer from StringRef
      to std::string has been defined for the channel type this will be used to
      serialize the argument without having to construct a std::string instance.
      
      This allows buffer reference types to be used as arguments to RPC calls without
      requiring a copy of the buffer to be made.
      
      llvm-svn: 286620
      ae1fdddb
    • Teresa Johnson's avatar
      Split Bitcode/ReaderWriter.h into separate reader and writer headers · ad17679a
      Teresa Johnson authored
      Summary:
      Split ReaderWriter.h which contains the APIs into both the BitReader and
      BitWriter libraries into BitcodeReader.h and BitcodeWriter.h.
      
      This is to address Chandler's concern about sharing the same API header
      between multiple libraries (BitReader and BitWriter). That concern is
      why we create a single bitcode library in our downstream build of clang,
      which led to r286297 being reverted as it added a dependency that
      created a cycle only when there is a single bitcode library (not two as
      in upstream).
      
      Reviewers: mehdi_amini
      
      Subscribers: dlj, mehdi_amini, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D26502
      
      llvm-svn: 286566
      ad17679a
  13. Nov 09, 2016
  14. Nov 02, 2016
  15. Oct 28, 2016
  16. Oct 08, 2016
  17. Sep 11, 2016
  18. Aug 02, 2016
  19. Aug 01, 2016
    • Lang Hames's avatar
      [ExecutionEngine][MCJIT][Orc] Replace RuntimeDyld::SymbolInfo with JITSymbol. · ad4a911f
      Lang Hames authored
      This patch replaces RuntimeDyld::SymbolInfo with JITSymbol: A symbol class
      that is capable of lazy materialization (i.e. the symbol definition needn't be
      emitted until the address is requested). This can be used to support common
      and weak symbols in the JIT (though this is not implemented in this patch).
      
      For consistency, RuntimeDyld::SymbolResolver is renamed to JITSymbolResolver.
      
      For space efficiency a new class, JITEvaluatedSymbol, is introduced that
      behaves like the old RuntimeDyld::SymbolInfo - i.e. it is just a pair of an
      address and symbol flags. Instances of JITEvaluatedSymbol can be used in
      symbol-tables to avoid paying the space cost of the materializer.
      
      llvm-svn: 277386
      ad4a911f
  20. Jun 29, 2016
  21. Jun 09, 2016
  22. Jun 08, 2016
  23. May 25, 2016
    • Lang Hames's avatar
      [RuntimeDyld] Call the SymbolResolver::findSymbolInLogicalDylib method when · bf9d1aa9
      Lang Hames authored
      searching for external symbols, and fall back to the SymbolResolver::findSymbol
      method if the former returns null.
      
      This makes RuntimeDyld behave more like a static linker: Symbol definitions
      from within the current module's "logical dylib" will be preferred to
      external definitions. We can build on this behavior in the future to properly
      support weak symbol handling.
      
      Custom symbol resolvers that override the findSymbolInLogicalDylib method may
      notice changes due to this patch. Clients who have not overridden this method
      should generally be unaffected, however users of the OrcMCJITReplacement class
      may notice changes.
      
      llvm-svn: 270716
      bf9d1aa9
  24. May 19, 2016
    • Rafael Espindola's avatar
      Delete Reloc::Default. · 8c34dd82
      Rafael Espindola authored
      Having an enum member named Default is quite confusing: Is it distinct
      from the others?
      
      This patch removes that member and instead uses Optional<Reloc> in
      places where we have a user input that still hasn't been maped to the
      default value, which is now clear has no be one of the remaining 3
      options.
      
      llvm-svn: 269988
      8c34dd82
  25. Apr 25, 2016
    • Lang Hames's avatar
      [ORC] Thread Error/Expected through the RPC library. · ef5a0ee2
      Lang Hames authored
      This replaces use of std::error_code and ErrorOr in the ORC RPC support library
      with Error and Expected. This required updating the OrcRemoteTarget API, Client,
      and server code, as well as updating the Orc C API.
      
      This patch also fixes several instances where Errors were dropped.
      
      llvm-svn: 267457
      ef5a0ee2
  26. Apr 18, 2016
    • Lang Hames's avatar
      [Orc] Re-commit r266581 with fixes for MSVC, and format cleanups. · 3fde652e
      Lang Hames authored
      Fixes:
      
      (1) Removes constexpr (unsupported in MSVC)
      (2) Move constructors (remove explicitly defaulted ones)
      (3) <future> - Add warning suppression for MSVC.
      
      llvm-svn: 266663
      3fde652e
    • Mehdi Amini's avatar
      lli: avoid global variables, use a local unique_ptr instead · a7de820a
      Mehdi Amini authored
      There was issue with order of destruction in some cases.
      
      From: Mehdi Amini <mehdi.amini@apple.com>
      llvm-svn: 266652
      a7de820a
    • Nico Weber's avatar
      Revert 266581 (and follow-up 266588), it doesn't build on Windows. · ca94d0ec
      Nico Weber authored
      Three problems:
      1. <future> can't be easily used.  If you must use it, see
         include/Support/ThreadPool.h for how.
      2. constexpr problems, even after 266588.
      3. Move assignment operators can't be defaulted in MSVC2013.
      
      llvm-svn: 266615
      ca94d0ec
    • Lang Hames's avatar
      [ORC] Generalize the ORC RPC utils to support RPC function return values and · 236cea74
      Lang Hames authored
      asynchronous call/handle. Also updates the ORC remote JIT API to use the new
      scheme.
      
      The previous version of the RPC tools only supported void functions, and
      required the user to manually call a paired function to return results. This
      patch replaces the Procedure typedef (which only supported void functions) with
      the Function typedef which supports return values, e.g.:
      
        Function<FooId, int32_t(std::string)> Foo;
      
      The RPC primitives and channel operations are also expanded. RPC channels must
      support four new operations: startSendMessage, endSendMessage,
      startRecieveMessage and endRecieveMessage, to handle channel locking. In
      addition, serialization support for tuples to RPCChannels is added to enable
      multiple return values.
      
      The RPC primitives are expanded from callAppend, call, expect and handle, to:
      
      appendCallAsync - Make an asynchronous call to the given function.
      
      callAsync - The same as appendCallAsync, but calls send on the channel when
                  done.
      
      callSTHandling - Blocking call for single-threaded code. Wraps a call to
                       callAsync then waits on the result, using a user-supplied
                       handler to handle any callbacks from the remote.
      
      callST - The same as callSTHandling, except that it doesn't handle
               callbacks - it expects the result to be the first return.
      
      expect and handle - as before.
      
      handleResponse - Handle a response from the remote.
      
      waitForResult - Wait for the response with the given sequence number to arrive.
      
      llvm-svn: 266581
      236cea74
  27. Apr 15, 2016
  28. Apr 14, 2016
  29. Apr 07, 2016
    • Kevin Enderby's avatar
      Thread Expected<...> up from createMachOObjectFile() to allow llvm-objdump to... · 3fcdf6ae
      Kevin Enderby authored
      Thread Expected<...> up from createMachOObjectFile() to allow llvm-objdump to produce a real error message
      
      Produce the first specific error message for a malformed Mach-O file describing
      the problem instead of the generic message for object_error::parse_failed of
      "Invalid data was encountered while parsing the file”.  Many more good error
      messages will follow after this first one.
      
      This is built on Lang Hames’ great work of adding the ’Error' class for
      structured error handling and threading Error through MachOObjectFile
      construction.  And making createMachOObjectFile return Expected<...> .
      
      So to to get the error to the llvm-obdump tool, I changed the stack of
      these methods to also return Expected<...> :
      
        object::ObjectFile::createObjectFile()
        object::SymbolicFile::createSymbolicFile()
        object::createBinary()
      
      Then finally in ParseInputMachO() in MachODump.cpp the error can
      be reported and the specific error message can be printed in llvm-objdump
      and can be seen in the existing test case for the existing malformed binary
      but with the updated error message.
      
      Converting these interfaces to Expected<> from ErrorOr<> does involve
      touching a number of places. To contain the changes for now use of
      errorToErrorCode() and errorOrToExpected() are used where the callers
      are yet to be converted.
      
      Also there some were bugs in the existing code that did not deal with the
      old ErrorOr<> return values.  So now with Expected<> since they must be
      checked and the error handled, I added a TODO and a comment:
      “// TODO: Actually report errors helpfully” and a call something like
      consumeError(ObjOrErr.takeError()) so the buggy code will not crash
      since needed to deal with the Error.
      
      Note there is one fix also needed to lld/COFF/InputFiles.cpp that goes along
      with this that I will commit right after this.  So expect lld not to built
      after this commit and before the next one.
      
      llvm-svn: 265606
      3fcdf6ae
Loading