Commit Graph

191 Commits

Author SHA1 Message Date
Dan Gohman
ef1af7d6d5 Add Type::isIntOrIntVector, like Type::isFPOrFPVector.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41190 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-20 19:25:59 +00:00
Dale Johannesen
320fc8a39e Long double, part 1 of N. Support in IR.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40774 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-03 01:03:46 +00:00
Chris Lattner
1bfb8b7333 This enum is dead
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37920 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-05 17:28:01 +00:00
Dan Gohman
fa73ea2d9f Minor comment cleanups.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37321 91177308-0d34-0410-b5e6-96231b3b80d8
2007-05-24 14:36:04 +00:00
Chris Lattner
645fc4edc2 if functiontype is going to have a pointer to a paramattr object, it better
be const.  The only way to get a pointer to these returns a const pointer.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36734 91177308-0d34-0410-b5e6-96231b3b80d8
2007-05-04 03:39:28 +00:00
Jeff Cohen
dc4cb35105 Have compiler enforce this.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36353 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-22 22:16:55 +00:00
Reid Spencer
4f859aa532 For PR1146:
Make ParamAttrsList objects unique. You can no longer directly create or
destroy them but instead must go through the ParamAttrsList::get()
interface.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36327 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-22 05:46:44 +00:00
Chris Lattner
a5f5a9c8e2 Fix a problem where primitive types lose their name after llvm_shutdown is called.
This also reduces the amount of work done at static construction time.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36285 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-20 22:33:47 +00:00
Chris Lattner
17fcdd5e1b Refactor SymbolTableListTraits to only have a single pointer in it, instead
of two.  This shrinkifies Function by 8 bytes (104->96) and Module by 8
bytes (68->60).  On a testcase of mine, this reduces the memory used to
read a module header from 565680b to 561024, a little over 4K.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36188 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-17 03:26:42 +00:00
Reid Spencer
18da072088 For PR1146:
Put the parameter attributes in their own ParamAttr name space. Adjust the
rest of llvm as a result.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35877 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-11 02:44:20 +00:00
Reid Spencer
3aad26e4da Remove a memory leak, until ParamAttrsList is uniqued.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35823 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-09 17:20:18 +00:00
Reid Spencer
4746ecf16e For PR1146:
* Add ParamAttrList pointers to Function and CallInst.
* Move the implementation of ParamAttrList from Type.cpp to Function.cpp


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35818 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-09 15:01:12 +00:00
Reid Spencer
89b1f46a10 For PR1146:
Move parameter attributes functionality to ParamAttrsList class.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35806 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-09 06:07:52 +00:00
Reid Spencer
5a1ebb3c99 For PR1209:
Implement Type class's ContainedTys without using a std::vector.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35693 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-06 02:02:20 +00:00
Reid Spencer
66123626ad Add the NoUnwind function attribute.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35260 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-22 02:14:48 +00:00
Reid Spencer
9e57414e69 Reduce #includage by taking a method out of line.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34774 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-01 04:02:06 +00:00
Chris Lattner
f00c6add97 remove dead method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34436 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-20 05:29:47 +00:00
Reid Spencer
ac9dcb94dd For PR1195:
Change use of "packed" term to "vector" in comments, strings, variable
names, etc.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34300 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-15 03:39:18 +00:00
Reid Spencer
a85210ac66 For PR1195:
Change a comment: Packed Type -> Vector Type


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34299 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-15 03:11:50 +00:00
Reid Spencer
9d6565a5b1 For PR1195:
Rename PackedType -> VectorType, ConstantPacked -> ConstantVector, and
PackedTyID -> VectorTyID. No functional changes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34293 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-15 02:26:10 +00:00
Reid Spencer
cc5dc2e792 Assert that elements of packed are pointer/float/opaque.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34165 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-10 22:02:45 +00:00
Reid Spencer
e463fc8098 Allow PackedType to be constructed with an abstract type.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34152 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-10 19:03:01 +00:00
Chris Lattner
d1f711fa6d Fix clients like this:
delete ParseBytecodeFile(InputFilename, 0, &ErrorMessage);
  llvm_shutdown();
  delete ParseBytecodeFile(InputFilename, 0, &ErrorMessage);

The primitive type objects failed to ressurect themselves after shutdown, leading
to crashes in clients that used them after llvm_shutdown().

This solution isn't wonderful, because we clearly have static ctors.  However,
the code it replaces was just as bad, so it's not a regression.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34106 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-09 22:24:04 +00:00
Reid Spencer
ef9b9a7939 For PR411:
This patch replaces the SymbolTable class with ValueSymbolTable which does
not support types planes. This means that all symbol names in LLVM must now
be unique. The patch addresses the necessary changes to deal with this and
removes code no longer needed as a result. This completes the bulk of the
changes for this PR. Some cleanup patches will follow.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33918 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-05 20:47:22 +00:00
Anton Korobeynikov
b10308e440 Propagate changes from my local tree. This patch includes:
1. New parameter attribute called 'inreg'. It has meaning "place this
parameter in registers, if possible". This is some generalization of
gcc's regparm(n) attribute. It's currently used only in X86-32 backend.
2. Completely rewritten CC handling/lowering code inside X86 backend.
Merged stdcall + c CCs and fastcall + fast CC.
3. Dropped CSRET CC. We cannot add struct return variant for each
target-specific CC (e.g. stdcall + csretcc and so on).
4. Instead of CSRET CC introduced 'sret' parameter attribute. Setting in
on first attribute has meaning 'This is hidden pointer to structure
return. Handle it gently'.
5. Fixed small bug in llvm-extract + add new feature to
FunctionExtraction pass, which relinks all internal-linkaged callees
from deleted function to external linkage. This will allow further
linking everything together.

NOTEs: 1. Documentation will be updated soon.
       2. llvm-upgrade should be improved to translate csret => sret.
          Before this, there will be some unexpected test fails.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33597 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-28 13:31:35 +00:00
Reid Spencer
43276ee280 IntegerType is a sized DerivedType too.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33521 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-26 07:51:36 +00:00
Reid Spencer
ab60be7a00 Remove dead methods in the ValTypes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33372 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-19 21:25:12 +00:00
Reid Spencer
c10305743c For PR1043:
This is the final patch for this PR. It implements some minor cleanup
in the use of IntegerType, to wit:
1. Type::getIntegerTypeMask -> IntegerType::getBitMask
2. Type::Int*Ty changed to IntegerType* from Type*
3. ConstantInt::getType() returns IntegerType* now, not Type*

This also fixes PR1120.

Patch by Sheng Zhou.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33370 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-19 21:13:56 +00:00
Reid Spencer
b5f378e11b Use a cheaper computation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33336 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-18 18:14:49 +00:00
Reid Spencer
7808dcba05 Provide an isPowerOf2ByteWidth method for the IntegerType class. This will
mostly be used by back ends that wish to distinguish between integer types
that fit evenly within a natural integer type and those that don't.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33328 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-18 02:59:54 +00:00
Chris Lattner
42a7551725 rename Type::isIntegral to Type::isInteger, eliminating the old Type::isInteger.
rename Type::getIntegralTypeMask to Type::getIntegerTypeMask.

This makes naming much more consistent.  For example, there are now no longer any
instances of IntegerType that are not considered isInteger! :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33225 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-15 02:27:26 +00:00
Reid Spencer
a1fed2d1c0 Fix a FIXME. 1 bit integer types are now printed as i1 not bool.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33176 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-13 01:09:33 +00:00
Reid Spencer
062f0360ed Make sure the IntegerValType has enough space for 2^23 bits.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33168 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-13 00:12:29 +00:00
Reid Spencer
a54b7cbd45 For PR1064:
Implement the arbitrary bit-width integer feature. The feature allows
integers of any bitwidth (up to 64) to be defined instead of just 1, 8,
16, 32, and 64 bit integers.

This change does several things:
1. Introduces a new Derived Type, IntegerType, to represent the number of
   bits in an integer. The Type classes SubclassData field is used to
   store the number of bits. This allows 2^23 bits in an integer type.
2. Removes the five integer Type::TypeID values for the 1, 8, 16, 32 and
   64-bit integers. These are replaced with just IntegerType which is not
   a primitive any more.
3. Adjust the rest of LLVM to account for this change.

Note that while this incremental change lays the foundation for arbitrary
bit-width integers, LLVM has not yet been converted to actually deal with
them in any significant way. Most optimization passes, for example, will
still only deal with the byte-width integer types.  Future increments
will rectify this situation.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33113 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-12 07:05:14 +00:00
Reid Spencer
4fe16d607d Rename BoolTy as Int1Ty. Patch by Sheng Zhou.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33076 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-11 18:21:29 +00:00
Reid Spencer
877e7ce051 Parameter attributes are part of a FunctionType and deserve to be factored
into comparisons of two FunctionTypes. Make it so.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33020 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-08 19:41:01 +00:00
Reid Spencer
2c261789d3 Change the syntax for parameter attributes:
1. The @ sign is no longer necessary.
2. We now support "function attributes" as parameter attribute 0.
3. Instead of locating the return type attributes after the type of a
   function result, they are now located after the function header's
   closing paranthesis and before any alignment or section options.
4. The way has been prepared for a new "noreturn" function attribute but
   there is no support for recognizing it in the lexer nor doing anything
   with it if it does get set.
5. The FunctionType::getParamAttrsText method now has support for
   returning multiple attributes. This required a change in its interface.

I'm unhappy that this change leads to 6 new shift/reduce conflicts, but
in each case bison's decision to choose the shift is correct so there
shouldn't be any damage from these conflicts.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32904 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-05 17:06:19 +00:00
Reid Spencer
1fd79b8c42 Fix a bug in getParamAttrs where an invalid value would be returned if the
index passed in was out of range for the number of parameter attributes set.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32794 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-31 17:50:33 +00:00
Reid Spencer
9c2e86a8d0 For PR950:
Implement signless integer types and FunctionType parameter attributes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32779 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-31 05:25:34 +00:00
Andrew Lenharth
38ecbf18eb Packed Structures
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32361 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-08 18:06:16 +00:00
Reid Spencer
3da59db637 For PR950:
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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31931 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-27 01:05:10 +00:00
Bill Wendling
2e3def1177 Removed iostream #includes. Replaced std::cerr with DOUT.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31814 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-17 08:03:48 +00:00
Chris Lattner
2e1c196470 Add isFPOrFPVector() method, which indicates if a type is either FP or a
vector of FP types.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31198 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-26 18:22:45 +00:00
Reid Spencer
b83eb6447b For PR950:
This patch implements the first increment for the Signless Types feature.
All changes pertain to removing the ConstantSInt and ConstantUInt classes
in favor of just using ConstantInt.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31063 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-20 07:07:24 +00:00
Chris Lattner
f53104051e label* is not a valid type, add an assertion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30968 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-15 23:21:12 +00:00
Chris Lattner
ab4fa4f377 Minor cleanups
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30668 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-28 23:45:00 +00:00
Chris Lattner
de65fb3a8b Now that ConstantBool::True/False are gone, we can modify Type.cpp to
eliminate its static dtors, without having code that depends on order of
initialization.  Eliminate static ctors/dtors from Type.cpp.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30667 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-28 23:38:07 +00:00
Chris Lattner
a4f0b3a084 s|llvm/Support/Visibility.h|llvm/Support/Compiler.h|
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29911 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-27 12:54:02 +00:00
Jim Laskey
8884060a25 No Need to live in the past.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29282 91177308-0d34-0410-b5e6-96231b3b80d8
2006-07-26 09:59:01 +00:00
Jim Laskey
a25dfd2963 Moving this function to a permanent home to prevent a dependency cycle created
by the inline heuristic.  Was preventing llvm-gcc4 from building.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29278 91177308-0d34-0410-b5e6-96231b3b80d8
2006-07-25 23:22:00 +00:00