aboutsummaryrefslogtreecommitdiffstats
path: root/lib/AsmParser
Commit message (Collapse)AuthorAgeFilesLines
* turn an assert into a proper check, fixing crash on invalid here:Chris Lattner2010-04-101-2/+1
| | | | | | | | | | | | $ llvm-as t.ll llvm-as: t.ll:1:6: error: expected 'type' after '=' %0 = = type { i32, float, float, double } ^ PR6810. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100934 91177308-0d34-0410-b5e6-96231b3b80d8
* fix a crash on invalid metadata, e.g.: call i32 @foo(), XXXXChris Lattner2010-04-072-3/+5
| | | | | | | | | | We would return the error without inserting the new instruction into the program, so it wouldn't get deallocated, and an abort would trigger when the module was deleted. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100602 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100538 91177308-0d34-0410-b5e6-96231b3b80d8
* Give llvm::SourceMgr the ability to have a client-specifiedChris Lattner2010-04-061-1/+1
| | | | | | | diagnostic handler. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100503 91177308-0d34-0410-b5e6-96231b3b80d8
* stringref-ize the MemoryBuffer::get apis. This requiresChris Lattner2010-04-051-1/+1
| | | | | | | a co-committed clang patch. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100485 91177308-0d34-0410-b5e6-96231b3b80d8
* include header.Chris Lattner2010-04-011-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100087 91177308-0d34-0410-b5e6-96231b3b80d8
* rewrite handling of forward ref'd instruction metadata Chris Lattner2010-04-012-9/+60
| | | | | | | | | to used deferred resolution instead of creating a temporary node + rauw. There is no reason to create the temporary mdnode, then do rauw, then destroy it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100086 91177308-0d34-0410-b5e6-96231b3b80d8
* no really, we don't need to copy strings around in the accessor.Chris Lattner2010-04-011-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100083 91177308-0d34-0410-b5e6-96231b3b80d8
* eliminate a temporary smallvectorChris Lattner2010-04-012-13/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100082 91177308-0d34-0410-b5e6-96231b3b80d8
* Introduce isOpaqueTy and use it rather than isa<OpaqueType>. Also, move someDuncan Sands2010-02-161-7/+7
| | | | | | | methods to try to have the type predicates be more logically positioned. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96349 91177308-0d34-0410-b5e6-96231b3b80d8
* There are two ways of checking for a given type, for example isa<PointerType>(T)Duncan Sands2010-02-161-17/+17
| | | | | | | | and T->isPointerTy(). Convert most instances of the first form to the second form. Requested by Chris. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96344 91177308-0d34-0410-b5e6-96231b3b80d8
* Uniformize the names of type predicates: rather than having isFloatTy andDuncan Sands2010-02-151-18/+18
| | | | | | | isInteger, we now have isFloatTy and isIntegerTy. Requested by Chris! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96223 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for a union type in LLVM IR. Patch by Talin!Chris Lattner2010-02-124-9/+77
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96011 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a new function attribute, 'alignstack'. It will indicate (when the backendsCharles Davis2010-02-122-0/+29
| | | | | | | | implement support for it) that the stack should be forcibly realigned in the prologue (and the process reversed in the epilogue). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95945 91177308-0d34-0410-b5e6-96231b3b80d8
* Reintroduce the InlineHint function attribute.Jakob Stoklund Olesen2010-02-063-0/+3
| | | | | | | | | | | | This time it's for real! I am going to hook this up in the frontends as well. The inliner has some experimental heuristics for dealing with the inline hint. When given a -respect-inlinehint option, functions marked with the inline keyword are given a threshold just above the default for -O3. We need some experiments to determine if that is the right thing to do. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95466 91177308-0d34-0410-b5e6-96231b3b80d8
* Kill ModuleProvider and ghost linkage by inverting the relationship betweenJeffrey Yasskin2010-01-271-1/+0
| | | | | | | | | | | | | | | | | | | | | | Modules and ModuleProviders. Because the "ModuleProvider" simply materializes GlobalValues now, and doesn't provide modules, it's renamed to "GVMaterializer". Code that used to need a ModuleProvider to materialize Functions can now materialize the Functions directly. Functions no longer use a magic linkage to record that they're materializable; they simply ask the GVMaterializer. Because the C ABI must never change, we can't remove LLVMModuleProviderRef or the functions that refer to it. Instead, because Module now exposes the same functionality ModuleProvider used to, we store a Module* in any LLVMModuleProviderRef and translate in the wrapper methods. The bindings to other languages still use the ModuleProvider concept. It would probably be worth some time to update them to follow the C++ more closely, but I don't intend to do it. Fixes http://llvm.org/PR5737 and http://llvm.org/PR5735. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94686 91177308-0d34-0410-b5e6-96231b3b80d8
* make -fno-rtti the default unless a directory builds with REQUIRES_RTTI.Chris Lattner2010-01-241-1/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94378 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove MetadataBase class because it is not adding significant value.Devang Patel2010-01-221-1/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94243 91177308-0d34-0410-b5e6-96231b3b80d8
* Stop building RTTI information for *most* llvm libraries. NotableChris Lattner2010-01-221-0/+1
| | | | | | | | | | | | | missing ones are libsupport, libsystem and libvmcore. libvmcore is currently blocked on bugpoint, which uses EH. Once it stops using EH, we can switch it off. This #if 0's out 3 unit tests, because gtest requires RTTI information. Suggestions welcome on how to fix this. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94164 91177308-0d34-0410-b5e6-96231b3b80d8
* Make the parser include the lower level error message in its own errorDan Gohman2010-01-211-1/+2
| | | | | | | message, to be more informative. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94072 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove the InlineHint attribute. There are no current or plannedEric Christopher2010-01-153-3/+0
| | | | | | | users. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93558 91177308-0d34-0410-b5e6-96231b3b80d8
* Consolidate ConvertGlobalValIDToValue, ConvertGlobalOrMetadataValIDToValue, ↵Victor Hernandez2010-01-112-111/+74
| | | | | | and ConvertValIDToValue into a more powerful ConvertValIDToValue() that does all three's work git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93197 91177308-0d34-0410-b5e6-96231b3b80d8
* Compute isFunctionLocal in MDNode ctor or via argument in new function ↵Victor Hernandez2010-01-102-18/+17
| | | | | | | | | | getWhenValsUnresolved(). Document PFS argument to ParseValID() and ConvertGlobalOrMetadataValIDToValue(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93108 91177308-0d34-0410-b5e6-96231b3b80d8
* fix PR5983, reject function bodies with no blocks per the grammar.Chris Lattner2010-01-091-0/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93067 91177308-0d34-0410-b5e6-96231b3b80d8
* When parsing function-local metadata, create a function-local MDNodeVictor Hernandez2010-01-062-10/+16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92838 91177308-0d34-0410-b5e6-96231b3b80d8
* Re-add parsing of function-local metadata; this time with testcase.Victor Hernandez2010-01-052-21/+28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92793 91177308-0d34-0410-b5e6-96231b3b80d8
* Allow null to be an element of NamedMDNode. e.g. !llvm.stuff = !{!0, !1, null}Devang Patel2010-01-051-0/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92783 91177308-0d34-0410-b5e6-96231b3b80d8
* Move remaining stuff to the isInteger predicate.Benjamin Kramer2010-01-051-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92771 91177308-0d34-0410-b5e6-96231b3b80d8
* NamedMDNode is a collection MDNodes.Devang Patel2010-01-051-2/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92761 91177308-0d34-0410-b5e6-96231b3b80d8
* Avoid going through the LLVMContext for type equality where it's safe to ↵Benjamin Kramer2010-01-051-6/+3
| | | | | | dereference the type pointer. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92726 91177308-0d34-0410-b5e6-96231b3b80d8
* remove some fixme'sChris Lattner2009-12-301-2/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92304 91177308-0d34-0410-b5e6-96231b3b80d8
* now that instruction metadata is only parsed in one place, eliminate theChris Lattner2009-12-302-10/+12
| | | | | | | | parser-global MDsOnInst vector and make ParseInstructionMetadata return its result by-ref through an argument like the entire rest of the parser. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92302 91177308-0d34-0410-b5e6-96231b3b80d8
* reimplement ParseOptionalInfo as ParseOptionalCommaAlign, correctlyChris Lattner2009-12-302-37/+46
| | | | | | | handle the comma case for metadata. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92301 91177308-0d34-0410-b5e6-96231b3b80d8
* rename ParseOptionalCustomMetadata -> ParseInstructionMetadata,Chris Lattner2009-12-302-20/+11
| | | | | | | | and make it non-optional. This fixes the bug where we'd accept and ignore a spurious comma after some instructions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92300 91177308-0d34-0410-b5e6-96231b3b80d8
* convert 4 more instructions over.Chris Lattner2009-12-302-31/+24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92299 91177308-0d34-0410-b5e6-96231b3b80d8
* add facilities to start factoring instruction metadata parsingChris Lattner2009-12-302-14/+33
| | | | | | | out of each opcode's handler. Change ret over so far. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92298 91177308-0d34-0410-b5e6-96231b3b80d8
* reimplement insertvalue/extractvalue metadata handling to not blindly Chris Lattner2009-12-302-10/+35
| | | | | | | accept invalid input. Actually add a testcase. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92297 91177308-0d34-0410-b5e6-96231b3b80d8
* remove two bogus calls that accepted metadata in the middle of ↵Chris Lattner2009-12-301-5/+0
| | | | | | | | | insert/extract value *constant exprs*. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92296 91177308-0d34-0410-b5e6-96231b3b80d8
* rename NamedOrCustomMD -> MetadataVar to follow conventions of all the rest ↵Chris Lattner2009-12-303-22/+24
| | | | | | of the code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92295 91177308-0d34-0410-b5e6-96231b3b80d8
* rename lltok::Metadata -> lltok::exclaim. We name tokens Chris Lattner2009-12-304-19/+15
| | | | | | | after their syntactic form, not their semantic form. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92294 91177308-0d34-0410-b5e6-96231b3b80d8
* rename MetadataCache -> NumberedMetadata to follow the conventionChris Lattner2009-12-302-17/+18
| | | | | | | | used by other things. Convert it to a vector since it is a dense numbering. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92293 91177308-0d34-0410-b5e6-96231b3b80d8
* rewrite ParseMDNodeVector to follow the normal patter used in the .ll parser.Chris Lattner2009-12-302-31/+40
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92292 91177308-0d34-0410-b5e6-96231b3b80d8
* rename ParseMDNode -> ParseMDNodeID, since it parses !42, not !{... } as ↵Chris Lattner2009-12-302-6/+6
| | | | | | you'd expect. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92291 91177308-0d34-0410-b5e6-96231b3b80d8
* fix parsing of mdstring values.Chris Lattner2009-12-301-7/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92290 91177308-0d34-0410-b5e6-96231b3b80d8
* remove the code added in r90497. It has several major issues and no tests.Chris Lattner2009-12-302-43/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92288 91177308-0d34-0410-b5e6-96231b3b80d8
* split t_Metadata into t_MDNode and t_MDString, eliminating some unsafe casting.Chris Lattner2009-12-302-24/+36
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92287 91177308-0d34-0410-b5e6-96231b3b80d8
* factor code even more.Chris Lattner2009-12-291-26/+14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92280 91177308-0d34-0410-b5e6-96231b3b80d8
* simplify some code and unbreak the build by not consuming anChris Lattner2009-12-291-10/+4
| | | | | | | extra token. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92279 91177308-0d34-0410-b5e6-96231b3b80d8
* remove a really wrong parenthesis.Benjamin Kramer2009-12-291-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92277 91177308-0d34-0410-b5e6-96231b3b80d8
* clean up some really strange code.Chris Lattner2009-12-291-8/+8
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92275 91177308-0d34-0410-b5e6-96231b3b80d8