summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IRReader/IRReader.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Return a unique_ptr from getLazyBitcodeModule and parseBitcodeFile. NFC.Rafael Espindola2015-06-161-4/+5
| | | | llvm-svn: 239858
* Remove unused variable. NFC.Rafael Espindola2014-11-061-1/+0
| | | | llvm-svn: 221497
* Pass a && to getLazyBitcodeModule.Rafael Espindola2014-09-031-1/+2
| | | | | | | | This forces callers to use std::move when calling it. It is somewhat odd to have code with std::move that doesn't always move, but it is also odd to have code without std::move that sometimes moves. llvm-svn: 217049
* Pass a std::unique_ptr<MemoryBuffer>& to getLazyBitcodeModule.Rafael Espindola2014-08-261-3/+1
| | | | | | | By taking a reference we can do the ownership transfer in one place instead of expecting every caller to do it. llvm-svn: 216492
* Pass a MemoryBufferRef when we can avoid taking ownership.Rafael Espindola2014-08-261-10/+9
| | | | | | | | | | | | | The attached patch simplifies a few interfaces that don't need to take ownership of a buffer. For example, both parseAssembly and parseBitcodeFile will parse the entire buffer before returning. There is no need to take ownership. Using a MemoryBufferRef makes it obvious in the type signature that there is no ownership transfer. llvm-svn: 216488
* Return a std::unique_ptr from the IRReader.h functions. NFC.Rafael Espindola2014-08-261-16/+15
| | | | llvm-svn: 216466
* Modernize the .ll parsing interface.Rafael Espindola2014-08-191-7/+8
| | | | | | | | | | * Use StringRef instead of std::string& * Return a std::unique_ptr<Module> instead of taking an optional module to write to (was not really used). * Use current comment style. * Use current naming convention. llvm-svn: 215989
* Pass a std::uinque_ptr to ParseAssembly to make the ownership explicit. NFC.Rafael Espindola2014-08-171-3/+3
| | | | llvm-svn: 215852
* getLazyIRModule always takes ownership. Make that explicit.Rafael Espindola2014-08-171-10/+9
| | | | llvm-svn: 215851
* Update the MemoryBuffer API to use ErrorOr.Rafael Espindola2014-07-061-8/+10
| | | | llvm-svn: 212405
* Make a helper function static. No functionality change.Rafael Espindola2014-07-051-3/+2
| | | | llvm-svn: 212364
* IRReader: don't mark MemoryBuffers constAlp Toker2014-06-271-1/+1
| | | | llvm-svn: 211883
* Propagate const-correctness into parseBitcodeFile()Alp Toker2014-06-271-2/+1
| | | | llvm-svn: 211864
* ParseIR: don't take ownership of the MemoryBufferAlp Toker2014-06-271-7/+10
| | | | | | | | | | clang was needlessly duplicating whole memory buffer contents in an attempt to satisfy unclear ownership semantics. Let's just hide internal LLVM quirks and present a simple non-owning interface. The public C API preserves previous behaviour for stability. llvm-svn: 211861
* Revert "Introduce a string_ostream string builder facilty"Alp Toker2014-06-261-3/+6
| | | | | | Temporarily back out commits r211749, r211752 and r211754. llvm-svn: 211814
* MSVC build fix following r211749Alp Toker2014-06-261-1/+2
| | | | | | Avoid strndup() llvm-svn: 211752
* Introduce a string_ostream string builder faciltyAlp Toker2014-06-261-6/+2
| | | | | | | | | | | | | | | | | | | | string_ostream is a safe and efficient string builder that combines opaque stack storage with a built-in ostream interface. small_string_ostream<bytes> additionally permits an explicit stack storage size other than the default 128 bytes to be provided. Beyond that, storage is transferred to the heap. This convenient class can be used in most places an std::string+raw_string_ostream pair or SmallString<>+raw_svector_ostream pair would previously have been used, in order to guarantee consistent access without byte truncation. The patch also converts much of LLVM to use the new facility. These changes include several probable bug fixes for truncated output, a programming error that's no longer possible with the new interface. llvm-svn: 211749
* Remove 'using std::errro_code' from lib.Rafael Espindola2014-06-131-5/+4
| | | | llvm-svn: 210871
* Don't use 'using std::error_code' in include/llvm.Rafael Espindola2014-06-121-0/+1
| | | | | | This should make sure that most new uses use the std prefix. llvm-svn: 210835
* Remove system_error.h.Rafael Espindola2014-06-121-1/+1
| | | | | | | This is a minimal change to remove the header. I will remove the occurrences of "using std::error_code" in a followup patch. llvm-svn: 210803
* [C++11] More 'nullptr' conversion. In some cases just using a boolean check ↵Craig Topper2014-04-151-7/+7
| | | | | | instead of comparing to nullptr. llvm-svn: 206252
* Replace OwningPtr<T> with std::unique_ptr<T>.Ahmed Charles2014-03-061-3/+2
| | | | | | | | | | This compiles with no changes to clang/lld/lldb with MSVC and includes overloads to various functions which are used by those projects and llvm which have OwningPtr's as parameters. This should allow out of tree projects some time to move. There are also no changes to libs/Target, which should help out of tree targets have time to move, if necessary. llvm-svn: 203083
* [C++11] Replace OwningPtr::take() with OwningPtr::release().Ahmed Charles2014-03-051-2/+2
| | | | llvm-svn: 202957
* Make parseBitcodeFile return an ErrorOr<Module *>.Rafael Espindola2014-01-151-5/+7
| | | | llvm-svn: 199279
* Update getLazyBitcodeModule to use ErrorOr for error handling.Rafael Espindola2014-01-131-4/+5
| | | | llvm-svn: 199125
* Move the LLVM IR asm writer header files into the IR directory, as theyChandler Carruth2014-01-071-1/+1
| | | | | | | | | | | | | | | | | are part of the core IR library in order to support dumping and other basic functionality. Rename the 'Assembly' include directory to 'AsmParser' to match the library name and the only functionality left their -- printing has been in the core IR library for quite some time. Update all of the #includes to match. All of this started because I wanted to have the layering in good shape before I started adding support for printing LLVM IR using the new pass infrastructure, and commandline support for the new pass infrastructure. llvm-svn: 198688
* Re-sort all of the includes with ./utils/sort_includes.py so thatChandler Carruth2014-01-071-3/+3
| | | | | | | | | | subsequent changes are easier to review. About to fix some layering issues, and wanted to separate out the necessary churn. Also comment and sink the include of "Windows.h" in three .inc files to match the usage in Memory.inc. llvm-svn: 198685
* [llvm-c] Expose IRReader interfacePeter Zotov2013-11-061-0/+32
| | | | | | Original patch by Chris Wailes llvm-svn: 194137
* Add 'const' qualifiers to static const char* variables.Craig Topper2013-07-161-2/+2
| | | | llvm-svn: 186371
* keep only the StringRef version of getFileOrSTDIN.Rafael Espindola2013-06-251-2/+2
| | | | llvm-svn: 184826
* Measure time that IR parsing took as part of the -time-passes measurement.Eli Bendersky2013-04-031-0/+11
| | | | llvm-svn: 178662
* Fix top-comment header and some indentationEli Bendersky2013-04-011-2/+2
| | | | llvm-svn: 178492
* Split out the IRReader header and the utility functions it provides intoChandler Carruth2013-03-261-0/+78
its own library. These functions are bridging between the bitcode reader and the ll parser which are in different libraries. Previously we didn't have any good library to do this, and instead played fast and loose with a "header only" set of interfaces in the Support library. This really doesn't work well as evidenced by the recent attempt to add timing logic to the these routines. As part of this, make them normal functions rather than weird inline functions, and sink the implementation into the library. Also clean up the header to be nice and minimal. This requires updating lots of build system dependencies to specify that the IRReader library is needed, and several source files to not implicitly rely upon the header file to transitively include all manner of other headers. If you are using IRReader.h, this commit will break you (the header moved) and you'll need to also update your library usage to include 'irreader'. I will commit the corresponding change to Clang momentarily. llvm-svn: 177971
OpenPOWER on IntegriCloud