summaryrefslogtreecommitdiffstats
path: root/llvm/lib/AsmParser/ParserInternals.h
Commit message (Collapse)AuthorAgeFilesLines
* Reimplement the old and horrible bison parser for .ll files with a niceChris Lattner2009-01-021-260/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* fix leakage of APFloats in getExistingVal()Nuno Lopes2008-11-041-0/+2
| | | | llvm-svn: 58696
* s/ParameterAttributes/Attributes/gDevang Patel2008-09-231-4/+4
| | | | llvm-svn: 56513
* Rework the routines that convert AP[S]Int into a string. Now, instead ofChris Lattner2008-08-171-1/+1
| | | | | | | | | | | | | | | | | returning an std::string by value, it fills in a SmallString/SmallVector passed in. This significantly reduces string thrashing in some cases. More specifically, this: - Adds an operator<< and a print method for APInt that allows you to directly send them to an ostream. - Reimplements APInt::toString to be much simpler and more efficient algorithmically in addition to not thrashing strings quite as much. This speeds up llvm-dis on kc++ by 7%, and may also slightly speed up the asmprinter. This also fixes a bug I introduced into the asmwriter in a previous patch w.r.t. alias printing. llvm-svn: 54873
* Align comments, colons and cases. Remove trailingDuncan Sands2008-07-111-17/+17
| | | | | | whitespace. llvm-svn: 53453
* Implement PR2538Chris Lattner2008-07-111-24/+40
| | | | llvm-svn: 53438
* Forgot a file, goes with 47342.Dale Johannesen2008-02-191-3/+3
| | | | llvm-svn: 47343
* 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-21/+9
| | | | | | | 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
* Make labels work in asm blocks; allow labels asDale Johannesen2007-11-051-2/+2
| | | | | | | parameters. Rename ValueRefList to ParamList in AsmParser, since its only use is for parameters. llvm-svn: 43734
* Next round of APFloat changes.Dale Johannesen2007-09-061-7/+9
| | | | | | | | | | | | | | Use APFloat in UpgradeParser and AsmParser. Change all references to ConstantFP to use the APFloat interface rather than double. Remove the ConstantFP double interfaces. Use APFloat functions for constant folding arithmetic and comparisons. (There are still way too many places APFloat is just a wrapper around host float/double, but we're getting there.) llvm-svn: 41747
* Implement full unescaping of escaped hex characters in all quoted identifiersReid Spencer2007-05-221-23/+17
| | | | | | and strings. llvm-svn: 37291
* For PR1146:Reid Spencer2007-04-091-3/+4
| | | | | | Adapt handling of parameter attributes to use the new ParamAttrsList class. llvm-svn: 35814
* Add and Operator== method to ValID so equality can be done properly forReid Spencer2007-03-191-0/+20
| | | | | | named or numbered ValIDs. llvm-svn: 35172
* For PR645:Reid Spencer2007-01-261-14/+24
| | | | | | | | | | | | | | Implement separation of local and global symbols. Local symbols and types now use % prefix. Global variables and functions now use @ prefix. For PR761: Replace: target endian = target pointersize = With: target datalayout = llvm-svn: 33524
* For PR1043:Zhou Sheng2007-01-111-2/+2
| | | | | | | Merge ConstantIntegral and ConstantBool into ConstantInt. Remove ConstantIntegral and ConstantBool from LLVM. llvm-svn: 33073
* For PR950:Reid Spencer2006-12-311-0/+23
| | | | | | Regenerate llvm-svn: 32782
* Remove backwards compatibility goop. Now implemented in llvm-upgrade.Reid Spencer2006-12-031-52/+0
| | | | llvm-svn: 32144
* Implement signedness caching for values, value lists, constants andReid Spencer2006-11-281-7/+16
| | | | | | | | | | | constant lists. This is just an internal change to the parser in preparation for some backwards compatibility code that is to follow. This will allow things like "uint 4000000000" to retain the unsignedness of the integer constant as the value moves through the parser. In the future, all integer types will be signless but parsing "uint" and friends will be retained for backwards compatibility. llvm-svn: 31964
* For PR950:Reid Spencer2006-11-271-4/+5
| | | | | | | | | | The long awaited CAST patch. This introduces 12 new instructions into LLVM to replace the cast instruction. Corresponding changes throughout LLVM are provided. This passes llvm-test, llvm/test, and SPEC CPUINT2000 with the exception of 175.vpr which fails only on a slight floating point output difference. llvm-svn: 31931
* For PR950:Reid Spencer2006-11-191-0/+26
| | | | | | | | | Retain the signedness of the old integer types in a new TypeInfo structure so that it can be used in the grammar to implement auto-upgrade of things that depended on signedness of types. This doesn't implement any new functionality in the AsmParser, its just plumbing for future changes. llvm-svn: 31866
* For PR950:Reid Spencer2006-10-261-0/+16
| | | | | | | | Make necessary changes to support DIV -> [SUF]Div. This changes llvm to have three division instructions: signed, unsigned, floating point. The bytecode and assembler are bacwards compatible, however. llvm-svn: 31195
* Eliminate ConstantBool::True and ConstantBool::False. Instead, provideChris Lattner2006-09-281-2/+2
| | | | | | ConstantBool::getTrue() and ConstantBool::getFalse(). llvm-svn: 30665
* For PR797:Reid Spencer2006-08-181-9/+5
| | | | | | | | | | | | | 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
* Parse inline asm objectsChris Lattner2006-01-251-2/+25
| | | | llvm-svn: 25618
* Implement Regression/Assembler/2005-12-21-ZeroInitVector.llChris Lattner2005-12-211-1/+7
| | | | llvm-svn: 24903
* Give the asmparser the ability to parse strings. Patch contributed byChris Lattner2005-05-201-1/+11
| | | | | | Alexander Friedman llvm-svn: 22146
* * Remove trailing whitespaceMisha Brukman2005-04-211-7/+7
| | | | | | * Convert tabs to spaces llvm-svn: 21415
* Parse undef and unreachableChris Lattner2004-10-161-1/+7
| | | | llvm-svn: 17053
* Changes For Bug 352Reid Spencer2004-09-011-1/+1
| | | | | | | | Move include/Config and include/Support into include/llvm/Config, include/llvm/ADT and include/llvm/Support. From here on out, all LLVM public header files must be under include/llvm/. llvm-svn: 16137
* Merge i*.h headers into Instructions.h as part of bug403.Alkis Evlogimenos2004-07-291-2/+2
| | | | llvm-svn: 15325
* Eliminate some mega-cruft here. There is no reason to DERIVE FROM IR CLASSESChris Lattner2004-07-131-54/+0
| | | | | | | just to keep track of some per-object state! Gaah! Whoever wrote this stuff... oh wait, that would be me. Never mind. llvm-svn: 14790
* Rename Type::PrimitiveID to TypeId and ::getPrimitiveID() to ::getTypeID()Chris Lattner2004-06-171-2/+2
| | | | llvm-svn: 14201
* Minor cleanups, plug a minor memory leakChris Lattner2003-12-231-2/+1
| | | | llvm-svn: 10596
* Put all LLVM code into the llvm namespace, as per bug 109.Brian Gaeke2003-11-111-4/+10
| | | | llvm-svn: 9903
* Added LLVM copyright header.John Criswell2003-10-211-0/+7
| | | | llvm-svn: 9321
* Eliminate unused classChris Lattner2003-10-191-5/+0
| | | | llvm-svn: 9270
* Regularize header file commentsChris Lattner2003-10-131-1/+1
| | | | llvm-svn: 9071
* Add new linkage types to support a real frontendChris Lattner2003-04-161-1/+1
| | | | llvm-svn: 5786
* include/llvm/DataTypes.h includes this #define so we don't need it anymoreChris Lattner2002-09-131-2/+0
| | | | llvm-svn: 3709
* - Remove unused STRING token from lexer & parserChris Lattner2002-08-161-1/+12
| | | | | | | | | | - Changed parser to always use parenthesis on ConstExprs to be consistent - Parser now passes TRUE and FALSE tokens as a special case of the ConstExpr machinery instead of a special case of constant int stuff - Fix the AsmParser to use ValueRef ::= ConstExpr, and remove ResolvedVal ::= ConstExpr this allows constexprs to be used in PHI nodes llvm-svn: 3362
* Declare globals llvmAsmtext and llvmAsmleng for use in the parser.Vikram S. Adve2002-07-141-0/+2
| | | | llvm-svn: 2893
* Eliminate duplicate or unneccesary #include'sChris Lattner2002-04-291-3/+0
| | | | llvm-svn: 2397
* Remove dead codeChris Lattner2002-04-281-10/+3
| | | | llvm-svn: 2390
* Split ConstantVals.h into Constant.h and Constants.hChris Lattner2002-04-281-1/+1
| | | | llvm-svn: 2378
* isLabelType is obsoleteChris Lattner2002-04-081-1/+1
| | | | llvm-svn: 2175
* s/MethodType/FunctionTypeChris Lattner2002-04-041-6/+6
| | | | llvm-svn: 2115
* Changes to build successfully with GCC 3.02Chris Lattner2002-01-201-9/+10
| | | | llvm-svn: 1503
* Renamed inst_const_iterator -> const_inst_iteratorChris Lattner2001-12-041-4/+4
| | | | | | | Renamed op_const_iterator -> const_op_iterator Renamed PointerType::getValueType() -> PointerType::getElementType() llvm-svn: 1408
* Rename ConstPoolVal -> ConstantChris Lattner2001-12-031-1/+1
| | | | | | | Rename ConstPool* -> Constant* Rename ConstPoolVals.h -> ConstantVals.h llvm-svn: 1407
OpenPOWER on IntegriCloud