summaryrefslogtreecommitdiffstats
path: root/llvm/lib/AsmParser/Parser.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Remove std::move that was preventing return value optimization.Richard Trieu2015-01-171-1/+1
| | | | llvm-svn: 226356
* Pass a MemoryBufferRef when we can avoid taking ownership.Rafael Espindola2014-08-261-13/+10
| | | | | | | | | | | | | 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
* Explicitly pass ownership of the MemoryBuffer to AddNewSourceBuffer using ↵David Blaikie2014-08-211-1/+1
| | | | | | std::unique_ptr llvm-svn: 216223
* Split parseAssembly into parseAssembly and parseAssemblyInto.Rafael Espindola2014-08-191-6/+13
| | | | | | | This should restore the functionality of parsing new code into an existing module without the confusing interface. llvm-svn: 216031
* Modernize the .ll parsing interface.Rafael Espindola2014-08-191-18/+17
| | | | | | | | | | * 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
* These classes only need a StringRef, not a MemoryBuffer.Rafael Espindola2014-08-181-2/+2
| | | | llvm-svn: 215945
* Pass a std::uinque_ptr to ParseAssembly to make the ownership explicit. NFC.Rafael Espindola2014-08-171-10/+9
| | | | llvm-svn: 215852
* Update the MemoryBuffer API to use ErrorOr.Rafael Espindola2014-07-061-4/+5
| | | | llvm-svn: 212405
* ParseIR: don't take ownership of the MemoryBufferAlp Toker2014-06-271-2/+1
| | | | | | | | | | 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
* Remove 'using std::errro_code' from lib.Rafael Espindola2014-06-131-2/+1
| | | | 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-4/+4
| | | | | | 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
* Move the LLVM IR asm writer header files into the IR directory, as theyChandler Carruth2014-01-071-2/+2
| | | | | | | | | | | | | | | | | 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
* keep only the StringRef version of getFileOrSTDIN.Rafael Espindola2013-06-251-1/+1
| | | | llvm-svn: 184826
* Move all of the header files which are involved in modelling the LLVM IRChandler Carruth2013-01-021-1/+1
| | | | | | | | | | | | | | | | | | | | | into their new header subdirectory: include/llvm/IR. This matches the directory structure of lib, and begins to correct a long standing point of file layout clutter in LLVM. There are still more header files to move here, but I wanted to handle them in separate commits to make tracking what files make sense at each layer easier. The only really questionable files here are the target intrinsic tablegen files. But that's a battle I'd rather not fight today. I've updated both CMake and Makefile build systems (I think, and my tests think, but I may have missed something). I've also re-sorted the includes throughout the project. I'll be committing updates to Clang, DragonEgg, and Polly momentarily. llvm-svn: 171366
* Use the new script to sort the includes of every file under lib.Chandler Carruth2012-12-031-2/+2
| | | | | | | | | | | | | | | | | Sooooo many of these had incorrect or strange main module includes. I have manually inspected all of these, and fixed the main module include to be the nearest plausible thing I could find. If you own or care about any of these source files, I encourage you to take some time and check that these edits were sensible. I can't have broken anything (I strictly added headers, and reordered them, never removed), but they may not be the headers you'd really like to identify as containing the API being implemented. Many forward declarations and missing includes were added to a header files to allow them to parse cleanly when included first. The main module rule does in fact have its merits. =] llvm-svn: 169131
* Make SMDiagnostic a little more sane. Instead of passing around ↵Chris Lattner2011-10-161-1/+1
| | | | | | | | note/warning/error as a string, pass it around as an enum. llvm-svn: 142107
* MemoryBuffer now return an error_code and returns a OwningPtr<MemoryBuffer> ↵Michael J. Spencer2010-12-161-4/+3
| | | | | | via an out parm. llvm-svn: 121958
* Support/MemoryBuffer: Replace all uses of std::string *ErrMsg with ↵Michael J. Spencer2010-12-091-3/+4
| | | | | | error_code &ec. And fix clients. llvm-svn: 121379
* Don't print the filename twice in file-not-found errors.Dan Gohman2010-08-041-2/+1
| | | | llvm-svn: 110179
* enhance SMDiagnostic to also maintain a pointer to the SourceMgr.Chris Lattner2010-04-061-2/+2
| | | | | | | Add a simplified constructor for clients that don't have locations like "file not found" errors. llvm-svn: 100538
* Give llvm::SourceMgr the ability to have a client-specifiedChris Lattner2010-04-061-1/+1
| | | | | | diagnostic handler. llvm-svn: 100503
* stringref-ize the MemoryBuffer::get apis. This requiresChris Lattner2010-04-051-1/+1
| | | | | | a co-committed clang patch. llvm-svn: 100485
* Make the parser include the lower level error message in its own errorDan Gohman2010-01-211-1/+2
| | | | | | message, to be more informative. llvm-svn: 94072
* Use MemoryBuffer::getBufferIdentifier() in the AsmPrinter insteadDan Gohman2009-09-081-4/+3
| | | | | | | of requiring a name be passed in. This makes it use "<stdin>" instead of "-" and makes it more consistent with the Bitcode reader. llvm-svn: 81256
* Refactor common code from ParseAssemblyString and ParseAssemblyFile,Dan Gohman2009-09-021-19/+21
| | | | | | to expose a low-level interface for parsing from an existing MemoryBuffer. llvm-svn: 80803
* switch the .ll parser to use SourceMgr.Chris Lattner2009-07-021-8/+13
| | | | llvm-svn: 74735
* switch the .ll parser into SMDiagnostic.Chris Lattner2009-07-021-38/+6
| | | | llvm-svn: 74734
* Make the use of const with respect to LLVMContext sane. Hopefully this is ↵Owen Anderson2009-07-011-2/+2
| | | | | | | | the last time, for the moment, that I will need to make far-reaching changes. llvm-svn: 74655
* Hold the LLVMContext by reference rather than by pointer.Owen Anderson2009-07-011-2/+2
| | | | llvm-svn: 74640
* Add a pointer to the owning LLVMContext to Module. This requires threading ↵Owen Anderson2009-07-011-4/+5
| | | | | | | | | | LLVMContext through a lot of the bitcode reader and ASM parser APIs, as well as supporting it in all of the tools. Patches for Clang and LLVM-GCC to follow. llvm-svn: 74614
* Fix the path to llvm/Assembly/Parser.h in a comment.Dan Gohman2009-01-081-1/+1
| | | | llvm-svn: 61948
* Refactor some parser interfaces to fix PR3278 and a FIXME:Chris Lattner2009-01-041-11/+20
| | | | | | | ParseAssemblyString with a specified module would not parse into the module, it would create and return a new one. llvm-svn: 61635
* Down with trailing whitespace!Misha Brukman2009-01-021-9/+8
| | | | llvm-svn: 61594
* Reimplement the old and horrible bison parser for .ll files with a niceChris Lattner2009-01-021-46/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and clean recursive descent parser. This change has a couple of ramifications: 1. The parser code is about 400 lines shorter (in what we maintain, not including what is autogenerated). 2. The code should be significantly faster than the old code because we don't have to work around bison's poor handling of datatypes with ctors/dtors. This also makes the code much more resistant to memory leaks. 3. We now get caret diagnostics from the .ll parser, woo. 4. The actual diagnostics emited from the parser are completely different so a bunch of testcases had to be updated. 5. I now disallow "%ty = type opaque %ty = type i32". There was no good reason to support this, it was just an accident of the old implementation. I have no reason to think that anyone is actually using this. 6. The syntax for sticking a global variable has changed to make it unambiguous. I don't think anyone is depending on this since only clang supports this and it is not solid yet, so I'm not worried about anything breaking. 7. This gets rid of the last use of bison, and along with it the .cvs files. I'll prune this from the makefiles as a subsequent commit. There are a few minor cleanups that can be done after this commit (suggestions welcome!) but this passes dejagnu testing and is ready for its time in the limelight. llvm-svn: 61558
* Change the MemoryBuffer::getFile* methods to take just a pointer to theChris Lattner2008-04-011-2/+1
| | | | | | | | start of a filename, not a filename+length. All clients can produce a null terminated name, and the system api's require null terminated strings anyway. llvm-svn: 49041
* Unbreak build with gcc 4.3: provide missed includes and silence most ↵Anton Korobeynikov2008-02-201-0/+1
| | | | | | annoying warnings. llvm-svn: 47367
* Remove attribution from file headers, per discussion on llvmdev.Chris Lattner2007-12-291-2/+2
| | | | llvm-svn: 45418
* Replace the original flex lexer with a hand writen one. This Chris Lattner2007-11-181-23/+21
| | | | | | | drops a dependency on flex and lets us make future progress more easily. Yay for 2 fewer .cvs files to make silly conflicts with. llvm-svn: 44213
* For PR797:Reid Spencer2006-08-181-22/+26
| | | | | | | | | | | | | Rid the Assembly Parser of exceptions. This is a really gross hack but it will do until the Assembly Parser is re-written as a recursive descent. The basic premise is that wherever the old "ThrowException" function was called (new name: GenerateError) we set a flag (TriggerError). Every production checks that flag and calls YYERROR if it is set. Additionally, each call to ThrowException in the grammar is replaced with GEN_ERROR which calls GenerateError and then YYERROR immediately. This prevents the remaining production from continuing after an error condition. llvm-svn: 29763
* Give the asmparser the ability to parse strings. Patch contributed byChris Lattner2005-05-201-0/+4
| | | | | | Alexander Friedman llvm-svn: 22146
* * Remove trailing whitespaceMisha Brukman2005-04-211-8/+8
| | | | | | * Convert tabs to spaces llvm-svn: 21415
* Fine-grainify namespacification, prune #includeChris Lattner2004-07-131-6/+2
| | | | llvm-svn: 14792
* Put all LLVM code into the llvm namespace, as per bug 109.Brian Gaeke2003-11-111-0/+4
| | | | llvm-svn: 9903
* * Eliminate `using' directiveMisha Brukman2003-10-231-9/+10
| | | | | | * Order #includes as per style guide llvm-svn: 9429
* Added LLVM project notice to the top of every C++ source file.John Criswell2003-10-201-0/+7
| | | | | | Header files will be on the way. llvm-svn: 9298
* Uppercase the acronym ASCII.Misha Brukman2003-09-221-1/+1
| | | | llvm-svn: 8676
OpenPOWER on IntegriCloud