Commit Graph

3082 Commits

Author SHA1 Message Date
Devang Patel 93056ec4e2 Gracefully destroy MDNodes.
llvm-svn: 81353
2009-09-09 17:07:07 +00:00
Devang Patel 926fc3d68d Remove dead code.
llvm-svn: 81235
2009-09-08 18:14:36 +00:00
Nick Lewycky 12c77d73a9 Hoist out the test+insert to CheckedTypes. This doesn't seem to affect
performance.

llvm-svn: 81193
2009-09-08 05:46:15 +00:00
Nick Lewycky 984161af16 Simplify from my last change. Assert1 is a macro that makes its caller return,
so "Assert1(isa<>); cast<>" is a valid idiom.

Actually check the PHI node's odd-numbered operands for BasicBlock-ness, like
the comment said.

llvm-svn: 81182
2009-09-08 02:02:39 +00:00
Nick Lewycky b2b0467e18 Verify types. Invalid types can be constructed when assertions are off.
Make the verifier more robust by avoiding unprotected cast<> calls. Notably,
Assert1(isa<>); cast<> is not safe as Assert1 does not terminate the program.

llvm-svn: 81179
2009-09-08 01:23:52 +00:00
Dan Gohman 1b84908f92 Reappy r80998, now that the GlobalOpt bug that it exposed on MiniSAT is fixed.
llvm-svn: 81172
2009-09-07 23:54:19 +00:00
Nick Lewycky d7fb16d895 Express this in the canonical way.
llvm-svn: 81157
2009-09-07 21:50:24 +00:00
Nick Lewycky 3fc89804a6 Homogenize whitespace.
llvm-svn: 81156
2009-09-07 20:44:51 +00:00
Daniel Dunbar 10fcf3354b Disable MDNode uniquing.
- Hopefully this unbreaks some llvm-gcc bootstraps.

llvm-svn: 81141
2009-09-07 04:05:49 +00:00
Duncan Sands 0f5bbb585c Public and private corrections, warned about by icc (#304).
Patch by Erick Tryzelaar.

llvm-svn: 81107
2009-09-06 08:55:57 +00:00
Duncan Sands 2fbeaf084f Remove some unused variables and methods warned about by
icc (#177, partial).  Patch by Erick Tryzelaar.

llvm-svn: 81106
2009-09-06 08:33:48 +00:00
Daniel Dunbar 10ea8bb8e0 Revert "Include optional subclass flags, such as inbounds, nsw, etc., ...", this
breaks MiniSAT on x86_64.

llvm-svn: 81098
2009-09-06 00:11:24 +00:00
Devang Patel a33c5a922d While replacing an MDNode elment, properly update MDNode's operand list.
MDNode's operand list does not include all elements.

llvm-svn: 81045
2009-09-04 21:32:05 +00:00
Dan Gohman 0c2477c26b Include optional subclass flags, such as inbounds, nsw, etc., in the
Constant uniquing tables. This allows distinct ConstantExpr objects
with the same operation and different flags.

Even though a ConstantExpr "a + b" is either always overflowing or
never overflowing (due to being a ConstantExpr), it's still necessary
to be able to represent it both with and without overflow flags at
the same time within the IR, because the safety of the flag may
depend on the context of the use. If the constant really does overflow,
it wouldn't ever be safe to use with the flag set, however the use
may be in code that is never actually executed.

This also makes it possible to merge all the flags tests into a single test.

llvm-svn: 80998
2009-09-04 12:08:11 +00:00
Dan Gohman e4ca02da1b Revert 80959. It isn't sufficient to solve the full problem. And it
introduced regressions in the Ocaml bindings tests.

llvm-svn: 80969
2009-09-03 23:34:49 +00:00
Dan Gohman 2a53b30f6d Remove the API for creating ConstantExprs with the nsw, nuw, inbounds,
and exact flags. Because ConstantExprs are uniqued, creating an
expression with this flag causes all expressions with the same operands
to have the same flag, which may not be safe. Add, sub, mul, and sdiv
ConstantExprs are usually folded anyway, so the main interesting flag
here is inbounds, and the constant folder already knows how to set the
inbounds flag automatically in most cases, so there isn't an urgent need
for the API support.

This can be reconsidered in the future, but for now just removing these
API bits eliminates a source of potential trouble with little downside.

llvm-svn: 80959
2009-09-03 22:17:40 +00:00
Devang Patel 85dac4771f Use WeakVH to hold dead mdnodes. Check use_empty() before deleting a node.
llvm-svn: 80928
2009-09-03 17:03:47 +00:00
Dan Gohman 22571485b3 Change PHINode::hasConstantValue to have a DominatorTree argument
instead of a bool argument, and to do the dominator check itself.
This makes it eaiser to use when DominatorTree information is
available.

llvm-svn: 80920
2009-09-03 15:34:35 +00:00
Gabor Greif 2d60e1ec0c back out my recent commit (r80858), it seems to break self-hosting buildbot's stage 2 configure
llvm-svn: 80871
2009-09-03 02:02:59 +00:00
Devang Patel f7188325ef Now Bitcode reader bug is fixed. Reapply 80839.
Use CallbackVH, instead of WeakVH, to hold MDNode elements.
Use FoldingSetNode to unique MDNodes in a context.
Use CallbackVH hooks to update context's MDNodeSet appropriately.

llvm-svn: 80868
2009-09-03 01:39:20 +00:00
Gabor Greif 14dfba6d66 re-commit r66920 (which has been backed out in r66953) I may have more luck this time. I'll back out if needed...
llvm-svn: 80858
2009-09-03 00:18:58 +00:00
Devang Patel c180029be4 Revert 80839 for now. It causes test failures.
llvm-svn: 80841
2009-09-02 21:49:26 +00:00
Devang Patel 36309cd391 Use CallbackVH, instead of WeakVH, to hold MDNode elements.
Use FoldingSetNode to unique MDNodes in a context.
Use CallbackVH hooks to update context's MDNodeSet appropriately.

llvm-svn: 80839
2009-09-02 21:22:09 +00:00
Torok Edwin 82131d6ad7 Opaque types didn't work if llvm_is_multithreaded().
AlwaysOpaqueTy is always NULL at this point, and it causes an assertion failure.
Fix it by using the just constructed tmp instead.

llvm-svn: 80780
2009-09-02 12:23:05 +00:00
Torok Edwin 18e03dd70c Fix DbgStopPointInst->getFileName/getDirectory, broken by the MDNodification in
r80406, and readd a -print-dbginfo test.

llvm-svn: 80778
2009-09-02 11:13:56 +00:00
Sandeep Patel 68c5f477fa Retype from unsigned to CallingConv::ID accordingly. Approved by Bob Wilson.
llvm-svn: 80773
2009-09-02 08:44:58 +00:00
Devang Patel 8c7f86e698 For now disable MDNode uniquing. This fixes llvm-gcc bootstrap failure on certain Mac OS X 10.5. I am working on a proper fix.
llvm-svn: 80738
2009-09-01 23:56:42 +00:00
Torok Edwin d18e668fbc Free the constants that have no uses in ~LLVMContext.
This fixes leaks from LLVMContext in multithreaded apps.
Since constants are only deleted if they have no uses, it is safe to not delete
a Module on shutdown, as many single-threaded tools do.
Multithreaded apps should however delete the Module before destroying the
Context to ensure that there are no leaks (assuming they use a different context
for each thread).

llvm-svn: 80590
2009-08-31 16:14:59 +00:00
Dan Gohman 062d378603 Cleanup whitespace and indentation.
llvm-svn: 80451
2009-08-29 23:35:16 +00:00
Dan Gohman 07d0a55a9b Remove some unused fields.
llvm-svn: 80450
2009-08-29 23:34:14 +00:00
Devang Patel 80ae34974b Reapply 79977.
Use MDNodes to encode debug info in llvm IR.

llvm-svn: 80406
2009-08-28 23:24:31 +00:00
Dan Gohman 4ce5ade09d Teach getUnderlyingObject and skipPointerCasts about GlobalAliases.
llvm-svn: 80265
2009-08-27 17:55:13 +00:00
Devang Patel 7b8f61f3c8 Remove an entry from ValueMap before removing elements.
llvm-svn: 80247
2009-08-27 15:32:38 +00:00
Devang Patel f08e35d9dc Revert 79977. It causes llvm-gcc bootstrap failures on some platforms.
llvm-svn: 80073
2009-08-26 05:01:18 +00:00
Dale Johannesen 2aaf539564 Add an 'inline hint' attribute to represent source
code hints that it would be a good idea to inline
a function ("inline" keyword).  No functional change
yet; FEs do not emit this and inliner does not use it.

llvm-svn: 80063
2009-08-26 01:08:21 +00:00
Dan Gohman e5af8cd13b Fix the InsertAtEnd form of ShuffleVectorInst constructor to use
the correct type.

llvm-svn: 80050
2009-08-25 23:27:45 +00:00
Dan Gohman ad1f0a1101 Eliminate the unused Context argument on one of the ICmpInst and FCmpInst
constructors.

llvm-svn: 80049
2009-08-25 23:17:54 +00:00
Dan Gohman faf516f34d Use covariant return types for Instruction::clone, and eliminate
the forms of ExtractElementInst and InsertElementInst that are
equivalent to clone.

llvm-svn: 80041
2009-08-25 22:29:08 +00:00
Dan Gohman 23d2c76f31 This should use isIndenticalToWhenDefined.
llvm-svn: 80039
2009-08-25 22:24:20 +00:00
Dan Gohman c8a27f2a5c Rename Instruction::isIdenticalTo to Instruction::isIdenticalToWhenDefined,
and introduce a new Instruction::isIdenticalTo which tests for full
identity, including the SubclassOptionalData flags. Also, fix the
Instruction::clone implementations to preserve the SubclassOptionalData
flags. Finally, teach several optimizations how to handle
SubclassOptionalData correctly, given these changes.

This fixes the counterintuitive behavior of isIdenticalTo not comparing
the full value, and clone not returning an identical clone, as well as
some subtle bugs that could be caused by these.

Thanks to Nick Lewycky for reporting this, and for an initial patch!

llvm-svn: 80038
2009-08-25 22:11:20 +00:00
Dan Gohman 97d2cb8394 Allocate the basic types inside the LLVMContextImpl instance,
rather than separately with new. Move the members above the
TypeMap members to avoid destruction order issues. This fixes
a leak of these objects, and eliminates an extra level of
indirection in Type::getInt32Ty and friends.

llvm-svn: 79997
2009-08-25 16:00:35 +00:00
Devang Patel 02aac922b4 Update DebugInfo interface to use metadata, instead of special named llvm.dbg.... global variables, to encode debugging information in llvm IR. This is mostly a mechanical change that tests metadata support very well.
This change speeds up llvm-gcc by more then 6% at "-O0 -g" (measured by compiling InstructionCombining.cpp!)

llvm-svn: 79977
2009-08-25 05:24:07 +00:00
Benjamin Kramer 1a25d733f9 Kill off more cerr/cout uses and prune includes a bit.
llvm-svn: 79852
2009-08-23 11:37:21 +00:00
Chris Lattner 1362602eb2 Change Pass::print to take a raw ostream instead of std::ostream,
update all code that this affects.

llvm-svn: 79830
2009-08-23 06:03:38 +00:00
Chris Lattner b1d782bec9 eliminate the std::ostream form of WriteAsOperand and update clients.
This also updates dominator related stuff.

llvm-svn: 79825
2009-08-23 05:17:37 +00:00
Chris Lattner 3924bb5792 remove the std::ostream version of module and type printing.
llvm-svn: 79823
2009-08-23 04:52:46 +00:00
Chris Lattner 34822f6ec7 remove some DOUTs
llvm-svn: 79821
2009-08-23 04:44:11 +00:00
Chris Lattner b25de3ff60 eliminate the "Value" printing methods that print to a std::ostream.
This required converting a bunch of stuff off DOUT and other cleanups.

llvm-svn: 79819
2009-08-23 04:37:46 +00:00
Owen Anderson 3fb4aabc06 Use standard LLVM-style headers.
llvm-svn: 79817
2009-08-23 04:24:24 +00:00
Chris Lattner 78683a7013 switch a couple things off std::ostream
llvm-svn: 79816
2009-08-23 04:02:03 +00:00
Chris Lattner 213a9f933d switch from std::ostream to raw ostream, fix file header.
llvm-svn: 79815
2009-08-23 03:56:06 +00:00
Owen Anderson c1a3a471c4 Reduce contention on the Attributes lock by using atomic operations for reference counting rather than locking.
llvm-svn: 79560
2009-08-20 19:03:20 +00:00
Dan Gohman 16f5415f5b Rename hasNoUnsignedOverflow and hasNoSignedOverflow to hasNoUnsignedWrap
and hasNoSignedWrap, for consistency with the nuw and nsw properties.

llvm-svn: 79539
2009-08-20 17:11:38 +00:00
Daniel Dunbar cb13b48969 Add a fast path for setName("") on an unnamed value.
llvm-svn: 79492
2009-08-19 23:37:23 +00:00
Owen Anderson d6f7af652e AttrListPtr operations need to be atomic.
llvm-svn: 79486
2009-08-19 22:58:34 +00:00
Daniel Dunbar 948f82b8e4 Change ValueSymbolTable to use raw_svector_ostream for string concatenation.
llvm-svn: 79449
2009-08-19 19:22:52 +00:00
Owen Anderson 6d549d6450 Reapply my less-lock-contention-in-leak-detector patch, now with new files
actually added.

llvm-svn: 79429
2009-08-19 17:07:46 +00:00
Daniel Dunbar acf0b258de Make a SmallVector size more reasonable.
llvm-svn: 79403
2009-08-19 05:08:06 +00:00
Owen Anderson 077df2c4ce Revert my last patch temporarily.
llvm-svn: 79388
2009-08-19 00:52:13 +00:00
Owen Anderson 3042539089 Privatize part of the leak detector mechanism, which turned out to be heavily contended
when trying to run opt in parallel.  This lets parallel opt crunch 403.gcc in about a third
of the time.

llvm-svn: 79387
2009-08-19 00:37:02 +00:00
Owen Anderson e8f2185a2f Privatize the ValueHandle global map. Because this is used so heavily throughout the code base, locking all accesses to
it is not practical performance-wise.

llvm-svn: 79355
2009-08-18 18:28:58 +00:00
Devang Patel c6faffde6c Add prefix only if it is needed.
llvm-svn: 79289
2009-08-17 23:17:17 +00:00
Owen Anderson 9801560ace Privatize the last bits of static type state.
llvm-svn: 79258
2009-08-17 17:59:35 +00:00
Owen Anderson 286b3af6ae Move the TypeMap lock to a member on LLVMContextImpl.
llvm-svn: 79256
2009-08-17 17:34:27 +00:00
Owen Anderson d91e6b097d Add locking around the attributes list.
llvm-svn: 79255
2009-08-17 17:10:58 +00:00
Chris Lattner ee97b8b11c the MinPad argument to PadToColumn only really makes sense to be 1,
just remove the argument and replace it with 1.

llvm-svn: 79246
2009-08-17 15:48:08 +00:00
Dan Gohman d04f9bf01a Fix printing of instructions with null operands.
llvm-svn: 79243
2009-08-17 15:28:08 +00:00
Dan Gohman d0cc3f31c0 Always print at least one space before adding a comment.
llvm-svn: 79242
2009-08-17 15:27:30 +00:00
Erick Tryzelaar dd99135721 Expose creating constant ints and floats from strings in llvm-c.
llvm-svn: 79213
2009-08-16 23:36:46 +00:00
Erick Tryzelaar fc2280d874 Add helper functions to ConstantInt and ConstantFP to accept strings.
llvm-svn: 79212
2009-08-16 23:36:33 +00:00
Dan Gohman ff3af725ea Add a getOffsetOf, for building a target-independent expression for
offsetof, similar to getSizeOf for sizeof.

llvm-svn: 79208
2009-08-16 21:26:11 +00:00
Erick Tryzelaar 9813beadcd Add an llvm-c function that lets you insert an instruction with a name.
llvm-svn: 79163
2009-08-16 02:20:57 +00:00
Erick Tryzelaar 4cc690cce4 Expose most of the Constant creation functions to llvm-c.
llvm-svn: 79160
2009-08-16 02:20:12 +00:00
Erick Tryzelaar 3045b8b5d6 Expose most of the rest of IRBuilder's functions to llvm-c.
llvm-svn: 79159
2009-08-16 02:19:59 +00:00
Chris Lattner b1bf2009a4 switch DominanceFrontier::splitBlock to use a smallvector for
the pred list instead of a vector, saving a boat load of malloc/free's.

llvm-svn: 79062
2009-08-15 01:39:28 +00:00
Erick Tryzelaar 262332f24b Expose LLVMContext to llvm-c.
llvm-svn: 78964
2009-08-14 00:01:31 +00:00
Owen Anderson a42ac6953b Actually privatize a IntegerTypes, and fix a few bugs exposed by this.
llvm-svn: 78955
2009-08-13 23:27:32 +00:00
Dan Gohman d57cbfc7d8 Make formatted_raw_ostream restore the buffer settings of the
underlying stream when it is finished, so that clients don't
have to do this manually.

llvm-svn: 78952
2009-08-13 23:16:59 +00:00
Dan Gohman 0809712def Take the fast path for any named value and any GlobalValue, which doesn't
need TypePrinting despite being a subclass of Constant. This fixes
compile-time problems especially visible on 403.gcc when -asm-verbose is
enabled.

llvm-svn: 78951
2009-08-13 23:07:11 +00:00
Owen Anderson 55f1c09e31 Push LLVMContexts through the IntegerType APIs.
llvm-svn: 78948
2009-08-13 21:58:54 +00:00
Dan Gohman 8061d9e23f Fix a 4x slowdown in llc -asm-verbose caused by the use of
WriteAsOperand in more places.

Now that more things are using WriteAsOperand, its behavior of
constructing a TypePrinting object and populating it with strings for all
the numbered types in the Module on each call is a significant bottleneck.
Fancier solutions could be pursued here, but for now, just bypass the
TypePrinting overhead in obvious cases.

llvm-svn: 78906
2009-08-13 15:27:57 +00:00
Dan Gohman b4583b1b36 Change the indentation for LLVM Assembly files from 1 tab to 2 spaces.
This is vaguely consistent with LLVM's own source code, but more
importantly it lets more lines stay within 80 columns.

llvm-svn: 78879
2009-08-13 01:41:52 +00:00
Dan Gohman 69273e6474 Now that numbered types have their number printed, it's no longer
interesting to print the number in a comment. Numbered instructions
don't need their number in a comment either.

Also, tidy up newline printing.

llvm-svn: 78865
2009-08-12 23:54:22 +00:00
Dan Gohman 466876b0a6 Extend the AsmWriter to print unnamed numbered types as "%0 = type ..."
and unnamed numbered global variables as "@0 = global ...". Extend the
AsmParser to recognize these forms.

llvm-svn: 78859
2009-08-12 23:32:33 +00:00
Dan Gohman 12dad639b5 Make AsmWriter more careful with formatted_raw_ostream so that
it doesn't leave the underlying stream in unbuffered mode when
the stream was originally buffered.

Also, change WriteAsOperand back to plain raw_ostream. This
lets it work for either formatted_raw_ostream or plain
raw_ostream, so that it doesn't have to force a buffer flush
on a plain raw_ostream.

llvm-svn: 78837
2009-08-12 20:56:03 +00:00
Dan Gohman e274526d78 Make LLVM Assembly dramatically easier to read by aligning the comments,
using formatted_raw_ostream's PadToColumn.

Before:

bb1:            ; preds = %bb
  %2 = sext i32 %i.01 to i64            ; <i64> [#uses=1]
  %3 = getelementptr double* %p, i64 %2         ; <double*> [#uses=1]
  %4 = load double* %3, align 8         ; <double> [#uses=1]
  %5 = fmul double %4, 1.100000e+00             ; <double> [#uses=1]
  %6 = sext i32 %i.01 to i64            ; <i64> [#uses=1]
  %7 = getelementptr double* %p, i64 %6         ; <double*> [#uses=1]

After:

bb1:                                        ; preds = %bb
  %2 = sext i32 %i.01 to i64                ; <i64> [#uses=1]
  %3 = getelementptr double* %p, i64 %2     ; <double*> [#uses=1]
  %4 = load double* %3, align 8             ; <double> [#uses=1]
  %5 = fmul double %4, 1.100000e+00         ; <double> [#uses=1]
  %6 = sext i32 %i.01 to i64                ; <i64> [#uses=1]
  %7 = getelementptr double* %p, i64 %6     ; <double*> [#uses=1]

Several tests required whitespace adjustments.

llvm-svn: 78816
2009-08-12 17:23:50 +00:00
Dan Gohman 5476cfdb15 Remove a bunch more now-unnecessary Context arguments.
llvm-svn: 78809
2009-08-12 16:23:25 +00:00
Owen Anderson 117c9e8497 Add contexts to some of the MVT APIs. No functionality change yet, just the infrastructure work needed to get the contexts to where they need to be first.
llvm-svn: 78759
2009-08-12 00:36:31 +00:00
Dan Gohman 76733748e1 Simplify this code, and use an in-bounds GEP.
llvm-svn: 78755
2009-08-12 00:32:55 +00:00
Owen Anderson 9f94459d24 Split EVT into MVT and EVT, the former representing _just_ a primitive type, while
the latter is capable of representing either a primitive or an extended type.

llvm-svn: 78713
2009-08-11 20:47:22 +00:00
Dan Gohman 77ad32ab0e Add convenience functions for creating nsw add operators.
llvm-svn: 78707
2009-08-11 20:20:39 +00:00
Dan Gohman 221a2c711d Don't set the isexact flag if an sdiv operator has been folded into
something else.

llvm-svn: 78702
2009-08-11 19:56:00 +00:00
Daniel Dunbar 919fe2bd2f Simplify ConstantExpr::getInBoundsGetElementPtr and fix a possible crash, if
constant folding eliminated the GEP instruction.
 - clang was hitting this on its test suite (for x86_64, at least).

llvm-svn: 78698
2009-08-11 18:28:09 +00:00
Daniel Dunbar 270968279b Revert 78680 until I figure out why it completely broke things.
llvm-svn: 78697
2009-08-11 18:11:15 +00:00
Devang Patel 5c310be0ff Link NamedMDNodes.
llvm-svn: 78696
2009-08-11 18:01:24 +00:00
Dan Gohman 50c09d0ca3 Add convenience functions for creating inbounds GEPs.
llvm-svn: 78695
2009-08-11 17:57:01 +00:00
Benjamin Kramer 78c3bcb582 Make LLVMContext and LLVMContextImpl classes instead of structs.
llvm-svn: 78690
2009-08-11 17:45:13 +00:00
Daniel Dunbar 5c13812e2f Remove some unnecessary LoadInst constructors, missed during Twinification.
llvm-svn: 78689
2009-08-11 17:38:47 +00:00
Dan Gohman 58f4d89a10 Add convenience functions for creating exact sdiv operators, and
use them in CreatePtrDiff.

llvm-svn: 78682
2009-08-11 17:05:24 +00:00
Dan Gohman 7c50c9bd63 Tidy #includes.
llvm-svn: 78677
2009-08-11 16:02:12 +00:00
Dan Gohman 5211b0128b Fix a typo in an assertion string.
llvm-svn: 78671
2009-08-11 15:53:15 +00:00
Devang Patel c5aa8c6d29 Remove dead metadata.
llvm-svn: 78651
2009-08-11 06:31:57 +00:00
Bob Wilson 2cd5da8300 Add a new overloaded EVT::vAny type for use in TableGen to allow intrinsic
arguments that are vectors of any size and element type.

llvm-svn: 78631
2009-08-11 01:14:02 +00:00
Devang Patel 9b4ea1c474 Remove MDNode from ValueMap when MDNode is destroyed.
llvm-svn: 78612
2009-08-10 22:59:46 +00:00
Owen Anderson 53aa7a960c Rename MVT to EVT, in preparation for splitting SimpleValueType out into its own struct type.
llvm-svn: 78610
2009-08-10 22:56:29 +00:00
Devang Patel 2c6c743039 Rename MDNodeSet as MDNodes.
llvm-svn: 78607
2009-08-10 22:31:31 +00:00
Daniel Dunbar 009ac1ae04 Rename ConvertType to ConvertConstant to avoid a name conflict on llvm-gcc.
llvm-svn: 78596
2009-08-10 20:56:46 +00:00
Devang Patel 0bdbee14cd We are not using FoldingSet for metadata uniquing anymore.
llvm-svn: 78585
2009-08-10 18:59:07 +00:00
Benjamin Kramer 850e0f9e7e g++ 4.0 doesn't have std::vector::data.
llvm-svn: 78579
2009-08-10 18:27:33 +00:00
Owen Anderson 13234f83ac Change the MDNode uniquing to a ValueMap, at Devang's request.
llvm-svn: 78577
2009-08-10 18:16:08 +00:00
Dan Gohman a6d0afcb74 Fix a bunch of namespace pollution.
llvm-svn: 78363
2009-08-07 01:32:21 +00:00
Daniel Dunbar 84f399103b Don't search the entire type table just to delete a type by name.
- This also fixes the ENABLE_EXPENSIVE_CHECKS failure on vmcore.ml.

llvm-svn: 78287
2009-08-06 06:04:35 +00:00
Owen Anderson 03cb69fbd1 Privatize the StructType table, which unfortunately involves routing contexts through a number of APIs.
llvm-svn: 78258
2009-08-05 23:16:16 +00:00
Owen Anderson 4b5c761af2 Privatize the FunctionType table.
llvm-svn: 78221
2009-08-05 18:13:27 +00:00
Chris Lattner 0aff0b2b58 common globals may also not be marked constant.
llvm-svn: 78169
2009-08-05 05:41:44 +00:00
Chris Lattner d055488c72 Clarify common linkage and the requirements on it. Enforce
them in the verifier.

llvm-svn: 78160
2009-08-05 05:21:07 +00:00
Owen Anderson e565995c65 Privatize the PointerType factory.
llvm-svn: 78130
2009-08-05 00:15:12 +00:00
Owen Anderson d918649d5f Privatize the VectorType uniquing.
llvm-svn: 78125
2009-08-04 23:47:44 +00:00
Owen Anderson 542cffc3eb Begin the process of privatizing the type uniquing tables. No API changes yet, but there will be in the near future.
llvm-svn: 78122
2009-08-04 23:33:01 +00:00
Chris Lattner 694285ca6d revert r78048, it isn't worth using assertingvh here.
llvm-svn: 78119
2009-08-04 23:07:12 +00:00
Benjamin Kramer 83c917a627 Update CMakeLists.
llvm-svn: 78118
2009-08-04 23:02:53 +00:00
Owen Anderson 9b67698574 It helps if I remember to actually add the file...
llvm-svn: 78116
2009-08-04 22:55:26 +00:00
Owen Anderson afd0c4cd56 Factor some of the constants+context related code out into a separate header, to make LLVMContextImpl.h
not hideous.  Also, fix some MSVC compile errors.

llvm-svn: 78115
2009-08-04 22:41:48 +00:00
Owen Anderson 1584a29536 Privatize the last bit of Constant-creation state.
llvm-svn: 78097
2009-08-04 20:25:11 +00:00
Chris Lattner 59c08e76ca switch ValueMap to using AssertingVH. This is an old patch I had laying
around in a tree I forgot about.

llvm-svn: 78048
2009-08-04 04:31:02 +00:00
Devang Patel d7fd6aba7c Keep track of metadata used by other metadata.
llvm-svn: 78012
2009-08-03 22:51:10 +00:00
Dan Gohman f011f5a8a2 Add a new Constant::getIntegerValue helper function, and convert a
few places in InstCombine to use it, to fix problems handling pointer
types. This fixes the recent llvm-gcc bootstrap error.

llvm-svn: 78005
2009-08-03 22:07:33 +00:00
Devang Patel 79238d7e6b Add NamedMDNode destructor.
llvm-svn: 77959
2009-08-03 06:19:01 +00:00
Edward O'Callaghan 4bf58b8add One two many newlines at end of file LLVMContextImpl.cpp
llvm-svn: 77911
2009-08-02 20:06:26 +00:00
Edward O'Callaghan 2dd529c9ef Fix no newline at end of LLVMContextImpl.cpp
llvm-svn: 77907
2009-08-02 19:38:12 +00:00
Owen Anderson c8c302644c Privatize all but one of the remaining constant tables.
llvm-svn: 77748
2009-07-31 22:45:43 +00:00
Owen Anderson 0087fe6e5c Move the metadata constructors back to 2.5 syntax.
llvm-svn: 77733
2009-07-31 21:35:40 +00:00
Owen Anderson 5a1acd9912 Move a few more APIs back to 2.5 forms. The only remaining ones left to change back are
metadata related, which I'm waiting on to avoid conflicting with Devang.

llvm-svn: 77721
2009-07-31 20:28:14 +00:00
Dan Gohman b53e26c7eb Fix printing of Alloca instructions with null operands.
llvm-svn: 77697
2009-07-31 18:23:24 +00:00
Owen Anderson 23a204d91b Move getTrue() and getFalse() to 2.5-like APIs.
llvm-svn: 77685
2009-07-31 17:39:07 +00:00
Devang Patel 98250795e8 Add getOrInsertNamedMetadata().
llvm-svn: 77646
2009-07-30 23:59:04 +00:00
Owen Anderson b292b8ce70 Move more code back to 2.5 APIs.
llvm-svn: 77635
2009-07-30 23:03:37 +00:00
Devang Patel 3f4ab29f45 Do not use getNamedValue() to lookup NamedMDNode. NamedMDNode is not a GlobalValue.
Thanks Benjamin Kramer!

llvm-svn: 77619
2009-07-30 18:46:29 +00:00
Benjamin Kramer 5656e4fcd3 fix a unitialized pointer in NamedMDNode (and reenable unittest)
llvm-svn: 77597
2009-07-30 15:35:55 +00:00
Nate Begeman 50b69eaa36 Typo
llvm-svn: 77568
2009-07-30 02:00:06 +00:00
Devang Patel 847fcacd48 Check null NameMDNode elements.
llvm-svn: 77559
2009-07-30 01:02:04 +00:00
Devang Patel b4a4e774db print single NamedMDNode.
llvm-svn: 77549
2009-07-30 00:02:57 +00:00
Owen Anderson 4056ca9568 Move types back to the 2.5 API.
llvm-svn: 77516
2009-07-29 22:17:13 +00:00
Devang Patel 23e68308b5 Print named metadata.
llvm-svn: 77513
2009-07-29 22:04:47 +00:00
Devang Patel 4a942d0863 There is no need to keep name ref in NamedMDNode.
llvm-svn: 77511
2009-07-29 21:58:56 +00:00
Owen Anderson 487375e9a2 Move ConstantExpr to 2.5 API.
llvm-svn: 77494
2009-07-29 18:55:55 +00:00
Devang Patel 18dfdc99af Keep track of named mdnodes in a Module using an ilist.
llvm-svn: 77476
2009-07-29 17:16:17 +00:00
Bob Wilson 5be9ee399f Fix an assumption that there is a single return value when verifying
overloaded types for intrinsic parameters.

llvm-svn: 77466
2009-07-29 16:25:56 +00:00
Devang Patel 05a26fb6dd Add NamedMDNode.
llvm-svn: 77409
2009-07-29 00:33:07 +00:00
Devang Patel f869caa03f Remove unused method.
llvm-svn: 77378
2009-07-28 22:04:55 +00:00