Commit Graph

746 Commits

Author SHA1 Message Date
Nuno Lopes 99f3dc6798 fix memleak in GetForwardRefForGlobal()
llvm-svn: 57576
2008-10-15 12:04:36 +00:00
Nuno Lopes 6f6e4e94be regenerate
llvm-svn: 57575
2008-10-15 11:20:21 +00:00
Nuno Lopes a4a546cb40 fix memleak in getTypeVal()
llvm-svn: 57574
2008-10-15 11:19:34 +00:00
Nuno Lopes bb683f953e regenerate
llvm-svn: 57573
2008-10-15 11:11:12 +00:00
Nuno Lopes 48e9028000 fix memleak in ResolveTypeTo()
llvm-svn: 57572
2008-10-15 11:10:21 +00:00
Chris Lattner 3f399451cd regenerate
llvm-svn: 57561
2008-10-15 06:16:57 +00:00
Chris Lattner 25f74dc574 Fix the .ll grammar rules to allow any type before an 'i32', not just an
integer type.  Invalid things like 'float 42' are now rejected by the
semantic analysis in the productions not the parser.  This fixes PR2733.

llvm-svn: 57560
2008-10-15 06:16:45 +00:00
Chris Lattner 9535c94015 regenerate
llvm-svn: 57559
2008-10-15 06:03:48 +00:00
Chris Lattner d253878724 Eliminate the "IntType ::= INTTYPE" production, just use
INTTYPE everywhere.

llvm-svn: 57558
2008-10-15 06:03:37 +00:00
Dale Johannesen 62a2e5cb2f Generated files for previous checkin.
llvm-svn: 57331
2008-10-09 23:01:34 +00:00
Dale Johannesen 4f0bd68cfe Add a "loses information" return value to APFloat::convert
and APFloat::convertToInteger.  Restore return value to
IEEE754.  Adjust all users accordingly.

llvm-svn: 57329
2008-10-09 23:00:39 +00:00
Chris Lattner 9b1300ba55 regenerate
llvm-svn: 57290
2008-10-08 06:44:45 +00:00
Chris Lattner 152acb5325 Add missing semicolumns in parser rules, those missing semicolumns
are required to compile with the latest Bison.

Patch by Samuel Tardieu!

llvm-svn: 57289
2008-10-08 06:44:36 +00:00
Nuno Lopes 0ea0fce8fe regenerate
llvm-svn: 57114
2008-10-05 16:49:34 +00:00
Nuno Lopes 33b90e3f59 clean ArgTypeListI production: free the PATypeHolder
llvm-svn: 57113
2008-10-05 16:49:03 +00:00
Nuno Lopes cbff1d08f2 regenerate
llvm-svn: 57009
2008-10-03 15:52:39 +00:00
Nuno Lopes bc7b224ce4 fix more memleaks in ResolveTypeTo() and ParseGlobalVariable()
llvm-svn: 57008
2008-10-03 15:51:46 +00:00
Nuno Lopes 877b7e2128 regenerate with bison 2.3
llvm-svn: 57007
2008-10-03 15:45:58 +00:00
Nuno Lopes 6d8e67f512 fix memleak in FunctionHeaderH
llvm-svn: 57005
2008-10-03 15:44:21 +00:00
Devang Patel 221fe42006 Support inreg, zext and sext as return value attributes.
llvm-svn: 56801
2008-09-29 20:49:50 +00:00
Devang Patel 9eb525d4f9 Implement function notes as function attributes.
llvm-svn: 56716
2008-09-26 23:51:19 +00:00
Dale Johannesen c4b02eb4e5 Generated files for warning fix.
llvm-svn: 56715
2008-09-26 23:46:20 +00:00
Dale Johannesen e2ea91e7cb Fix a compiler warning.
llvm-svn: 56714
2008-09-26 23:45:53 +00:00
Devang Patel a05633e105 Now Attributes are divided in three groups
- return attributes - inreg, zext and sext
- parameter attributes
- function attributes - nounwind, readonly, readnone, noreturn

Return attributes use 0 as the index.
Function attributes use ~0U as the index.

This patch requires corresponding changes in llvm-gcc and clang.

llvm-svn: 56704
2008-09-26 22:53:05 +00:00
Dale Johannesen c0f4d00d67 Generated files for previous patch.
llvm-svn: 56679
2008-09-26 19:32:34 +00:00
Dale Johannesen 0e32a2c935 Add "inreg" field to CallSDNode (doesn't increase
its size).  Adjust various lowering functions to
pass this info through from CallInst.  Use it to
implement sseregparm returns on X86.  Remove
X86_ssecall calling convention.

llvm-svn: 56677
2008-09-26 19:31:26 +00:00
Devang Patel 4c758ea3e0 Large mechanical patch.
s/ParamAttr/Attribute/g
s/PAList/AttrList/g
s/FnAttributeWithIndex/AttributeWithIndex/g
s/FnAttr/Attribute/g

This sets the stage 
- to implement function notes as function attributes and 
- to distinguish between function attributes and return value attributes.

This requires corresponding changes in llvm-gcc and clang.

llvm-svn: 56622
2008-09-25 21:00:45 +00:00
Eric Christopher a867337344 Fix fallout from revision r56535.
llvm-svn: 56545
2008-09-24 04:55:49 +00:00
Devang Patel e15607b7bb Put FN_NOTE_AlwaysInline and others in FnAttr namespace.
llvm-svn: 56527
2008-09-24 00:06:15 +00:00
Devang Patel e87abd26ba Move FN_NOTE_AlwaysInline and other out of ParamAttrs namespace.
Do not check isDeclaration() in hasNote(). It is clients' responsibility.

llvm-svn: 56524
2008-09-23 23:52:03 +00:00
Devang Patel a987d3e3fb s/ParameterAttributes/Attributes/g
llvm-svn: 56520
2008-09-23 23:25:44 +00:00
Devang Patel ba3fa6c6e1 s/ParameterAttributes/Attributes/g
llvm-svn: 56513
2008-09-23 23:03:40 +00:00
Devang Patel 82fed6702b Use parameter attribute store (soon to be renamed) for
Function Notes also. Function notes are stored at index ~0.

llvm-svn: 56511
2008-09-23 22:35:17 +00:00
Chris Lattner 4f6646780e regenerate
llvm-svn: 56502
2008-09-23 21:18:31 +00:00
Chris Lattner 7f0a77f11d allow inreg on the result of a function
llvm-svn: 56501
2008-09-23 21:18:08 +00:00
Oscar Fuentes a229b3c9a7 Initial support for the CMake build system.
llvm-svn: 56419
2008-09-22 01:08:49 +00:00
Dan Gohman 72eb6e76e4 Update generated files.
llvm-svn: 55972
2008-09-09 01:13:24 +00:00
Dan Gohman c579d978a3 Extend the vcmp/fcmp LLVM IR instructions to take vectors as arguments
and, if so, to return a vector of boolean as a result;

Extend the select LLVM IR instruction to allow you to specify a result
type which is a vector of boolean, in which case the result will be an
element-wise selection instead of choosing one vector or the other; and

Update LangRef.html to describe these changes.

This patch was contributed by Preston Gurd!

llvm-svn: 55969
2008-09-09 01:02:47 +00:00
Devang Patel 3771a1281f Parse and print opt_size note.
llvm-svn: 55740
2008-09-03 22:10:21 +00:00
Devang Patel 7e59270272 s/FP_AlwaysInline/FN_NOTE_AlwaysInline/g
llvm-svn: 55676
2008-09-02 22:43:57 +00:00
Devang Patel c57b7a0fc8 Parse function notes.
llvm-svn: 55646
2008-09-02 20:52:40 +00:00
Chris Lattner b1a635b30c regenerate
llvm-svn: 55542
2008-08-29 17:20:18 +00:00
Chris Lattner a51c7030e2 Add support for parsing .ll files that have numbers in front of
nameless values, such as:

%3 = add i32 4, 2

This fixes the first half of PR2480

llvm-svn: 55539
2008-08-29 17:12:13 +00:00
Gordon Henriksen a149e7ab25 Regenerate.
llvm-svn: 54900
2008-08-17 18:48:50 +00:00
Gordon Henriksen d930f913e6 Rename some GC classes so that their roll will hopefully be clearer.
In particular, Collector was confusing to implementors. Several
thought that this compile-time class was the place to implement
their runtime GC heap. Of course, it doesn't even exist at runtime.
Specifically, the renames are:

  Collector               -> GCStrategy
  CollectorMetadata       -> GCFunctionInfo
  CollectorModuleMetadata -> GCModuleInfo
  CollectorRegistry       -> GCRegistry
  Function::getCollector  -> getGC (setGC, hasGC, clearGC)

Several accessors and nested types have also been renamed to be
consistent. These changes should be obvious.

llvm-svn: 54899
2008-08-17 18:44:35 +00:00
Chris Lattner 17f7165f84 Rework the routines that convert AP[S]Int into a string. Now, instead of
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
2008-08-17 07:19:36 +00:00
Dale Johannesen a7a2f22fe5 Generated files for 54744.
llvm-svn: 54745
2008-08-13 18:41:46 +00:00
Dale Johannesen 332dd535e0 Add read/write support for X86's sseregparm.
llvm-svn: 54744
2008-08-13 18:40:23 +00:00
Nate Begeman fecbc8cff1 Add vector shifts to the IR, patch by Eli Friedman.
CodeGen & Clang work coming next.

llvm-svn: 54161
2008-07-29 15:49:41 +00:00
Dan Gohman 16a84c6e2d Update the generated .cvs files.
llvm-svn: 53943
2008-07-23 00:54:54 +00:00
Dan Gohman fa1211f69b Enable first-class aggregates support.
Remove the GetResultInst instruction. It is still accepted in LLVM assembly
and bitcode, where it is now auto-upgraded to ExtractValueInst. Also, remove
support for return instructions with multiple values. These are auto-upgraded
to use InsertValueInst instructions.

The IRBuilder still accepts multiple-value returns, and auto-upgrades them
to InsertValueInst instructions.

llvm-svn: 53941
2008-07-23 00:34:11 +00:00
Duncan Sands 914ca2d368 Align comments, colons and cases. Remove trailing
whitespace.

llvm-svn: 53453
2008-07-11 07:37:30 +00:00
Chris Lattner c9046b286b regenerate
llvm-svn: 53440
2008-07-11 00:30:39 +00:00
Chris Lattner 61622615ae Implement PR2538
llvm-svn: 53438
2008-07-11 00:30:06 +00:00
Mon P Wang 6a490371c9 Added MemOperands to Atomic operations since Atomics touches memory.
Added abstract class MemSDNode for any Node that have an associated MemOperand
Changed atomic.lcs => atomic.cmp.swap, atomic.las => atomic.load.add, and
atomic.lss => atomic.load.sub

llvm-svn: 52706
2008-06-25 08:15:39 +00:00
Dan Gohman 4aef821183 Fix some signed vs. unsigned issues in array and vector handling.
llvm-svn: 52664
2008-06-24 01:17:52 +00:00
Dan Gohman b936ea7fc4 Update the .cvs files.
llvm-svn: 52637
2008-06-23 18:43:26 +00:00
Dan Gohman a7c3e0e120 Fix the types for NumElements variables, and add a comment
explaining why empty array constants use ValID::createUndef().

llvm-svn: 52636
2008-06-23 18:40:28 +00:00
Dan Gohman 3ab46f1383 AsmParser support for immediate constant aggregate values.
llvm-svn: 52149
2008-06-09 14:45:02 +00:00
Dan Gohman 1ecaf45cf1 IR, bitcode reader, bitcode writer, and asmparser changes to
insertvalue and extractvalue to use constant indices instead of
Value* indices. And begin updating LangRef.html.

There's definately more to come here, but I'm checking this 
basic support in now to make it available to people who are
interested.

llvm-svn: 51806
2008-05-31 00:58:22 +00:00
Dan Gohman fa9dac2859 Don't silently truncate array extents to 32 bits.
llvm-svn: 51505
2008-05-23 21:40:55 +00:00
Dan Gohman 0fb92a65b3 Issue errors in several situations instead of aborting.
llvm-svn: 51493
2008-05-23 18:23:11 +00:00
Dan Gohman 30499844ea Make structs and arrays first-class types, and add assembly
and bitcode support for the extractvalue and insertvalue
instructions and constant expressions.

Note that this does not yet include CodeGen support.

llvm-svn: 51468
2008-05-23 01:55:30 +00:00
Dan Gohman 298a1d6d5f Recognize the "default" keyword, which is documented in LangRef.html
and supported in the grammar, in the lexer.

llvm-svn: 51448
2008-05-22 22:30:09 +00:00
Gordon Henriksen 8bd151d194 Reverting accidental commit of generated files.
llvm-svn: 51239
2008-05-19 05:57:12 +00:00
Gordon Henriksen 00889ccfca Remove a duplicative binding. Patch by Mahadevan R.
llvm-svn: 51238
2008-05-19 05:47:10 +00:00
Gabor Greif e1f6e4b21d API change for {BinaryOperator|CmpInst|CastInst}::create*() --> Create. Legacy interfaces will be in place for some time. (Merge from use-diet branch.)
llvm-svn: 51200
2008-05-16 19:29:10 +00:00
Dan Gohman 12fce7751b IR support for extractvalue and insertvalue instructions. Also, begin
moving toward making structs and arrays first-class types.

llvm-svn: 51157
2008-05-15 19:50:34 +00:00
Gabor Greif 697e94cc22 Fix a bunch of 80col violations that arose from the Create API change. Tweak makefile targets to find these better.
llvm-svn: 51143
2008-05-15 10:04:30 +00:00
Dale Johannesen 21160df793 CommonLinkage (missed a file)
llvm-svn: 51120
2008-05-14 20:14:09 +00:00
Dale Johannesen 5c1b6db9ed Generated files for CommonLinkage.
llvm-svn: 51119
2008-05-14 20:13:36 +00:00
Dale Johannesen ce4396bc92 Add CommonLinkage; currently tentative definitions
are represented as "weak", but there are subtle differences
in some cases on Darwin, so we need both.  The intent
is that "common" will behave identically to "weak" unless
somebody changes their target to do something else.
No functional change as yet.

llvm-svn: 51118
2008-05-14 20:12:51 +00:00
Nate Begeman d21957002a Add two new instructions to the llvm IR, vicmp and vfcmp. see updated LangRef
for details.  CodeGen support coming in a follow up patch

llvm-svn: 50985
2008-05-12 19:01:56 +00:00
Chris Lattner c17c8f3ec4 regenerate
llvm-svn: 50621
2008-05-04 17:18:47 +00:00
Nick Lewycky 4d43d3c72c Remove 'unwinds to' support from mainline. This patch undoes r47802 r47989
r48047 r48084 r48085 r48086 r48088 r48096 r48099 r48109 and r48123.

llvm-svn: 50265
2008-04-25 16:53:59 +00:00
Dan Gohman 6e9185093d Allow llvm-as to parse a getresult with an undef operand.
llvm-svn: 50175
2008-04-23 20:11:27 +00:00
Chris Lattner 6e0284bba7 regenerate
llvm-svn: 50139
2008-04-23 05:37:08 +00:00
Chris Lattner ff9089eb90 Validate that the result of a function type is valid using shared
logic with vmcore.

llvm-svn: 50138
2008-04-23 05:36:58 +00:00
Chris Lattner 167dbe5e39 regenerate
llvm-svn: 49978
2008-04-20 00:41:19 +00:00
Chris Lattner 3b18762f40 Switch to using Simplified ConstantFP::get API.
llvm-svn: 49977
2008-04-20 00:41:09 +00:00
Dan Gohman 41eb949aaf Teach llvm-as to accept function types with multiple return types.
llvm-svn: 49945
2008-04-19 00:24:39 +00:00
Gabor Greif 92f493dc72 regenerate
llvm-svn: 49293
2008-04-06 23:07:54 +00:00
Gabor Greif e9ecc68d8f API changes for class Use size reduction, wave 1.
Specifically, introduction of XXX::Create methods
for Users that have a potentially variable number of
Uses.

llvm-svn: 49277
2008-04-06 20:25:17 +00:00
Chris Lattner 6f2ffdb73f Change the MemoryBuffer::getFile* methods to take just a pointer to the
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
2008-04-01 18:04:03 +00:00
Dan Gohman c60c67fc37 Add explicit keywords.
llvm-svn: 48801
2008-03-25 22:06:05 +00:00
Chris Lattner 8a923e7c28 Reimplement the parameter attributes support, phase #1. hilights:
1. There is now a "PAListPtr" class, which is a smart pointer around
   the underlying uniqued parameter attribute list object, and manages
   its refcount.  It is now impossible to mess up the refcount.
2. PAListPtr is now the main interface to the underlying object, and
   the underlying object is now completely opaque.
3. Implementation details like SmallVector and FoldingSet are now no
   longer part of the interface.
4. You can create a PAListPtr with an arbitrary sequence of
   ParamAttrsWithIndex's, no need to make a SmallVector of a specific 
   size (you can just use an array or scalar or vector if you wish).
5. All the client code that had to check for a null pointer before
   dereferencing the pointer is simplified to just access the 
   PAListPtr directly.
6. The interfaces for adding attrs to a list and removing them is a
   bit simpler.

Phase #2 will rename some stuff (e.g. PAListPtr) and do other less 
invasive changes.

llvm-svn: 48289
2008-03-12 17:45:29 +00:00
Nick Lewycky 5cb21155e4 Update the .cvs files to match today's asm syntax change.
llvm-svn: 48128
2008-03-10 05:01:34 +00:00
Nick Lewycky fb2c1a999a Turn unwind_to into "unwinds to".
llvm-svn: 48123
2008-03-10 02:20:00 +00:00
Devang Patel 83558f9f46 regenerate.
llvm-svn: 47849
2008-03-03 18:58:47 +00:00
Nick Lewycky 3cc9be0b59 Add an unwind_to field to basic blocks, making them Users instead of Values.
This is the first checkin for PR1269, the new EH infrastructure.

llvm-svn: 47802
2008-03-02 02:48:09 +00:00
Devang Patel 0362de154e regenerate.
llvm-svn: 47642
2008-02-26 23:19:08 +00:00
Devang Patel 4db58fce82 Add assert.
llvm-svn: 47641
2008-02-26 23:17:50 +00:00
Devang Patel 8490c6935b regenerate
llvm-svn: 47634
2008-02-26 22:17:48 +00:00
Devang Patel a58b1c9b6b Remove unncessary ReturnInst constructors.
llvm-svn: 47633
2008-02-26 22:12:58 +00:00
Devang Patel 14f9994562 Regenerate.
llvm-svn: 47519
2008-02-23 01:17:37 +00:00
Devang Patel 6c4bc99c44 Use isa check instead of getTypeID() check.
llvm-svn: 47518
2008-02-23 01:17:17 +00:00
Devang Patel a22220d8f6 Regenerate
llvm-svn: 47509
2008-02-23 00:38:56 +00:00
Devang Patel 59643e575f To support multiple return values, now ret instruction supports multiple operands instead of one aggregate operand.
llvm-svn: 47508
2008-02-23 00:35:18 +00:00
Dale Johannesen 09f410b6d7 Split ParameterAttributes.h, putting the complicated
stuff into ParamAttrsList.h.  Per feedback from
ParamAttrs changes.

llvm-svn: 47504
2008-02-22 22:17:59 +00:00
Devang Patel faafcfd3ce Regenerate
llvm-svn: 47495
2008-02-22 19:31:30 +00:00