aboutsummaryrefslogtreecommitdiffstats
path: root/include
Commit message (Collapse)AuthorAgeFilesLines
* Now Bitcode reader bug is fixed. Reapply 80839.Devang Patel2009-09-032-9/+31
| | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80868 91177308-0d34-0410-b5e6-96231b3b80d8
* re-commit r66920 (which has been backed out in r66953) I may have more luck ↵Gabor Greif2009-09-032-15/+33
| | | | | | this time. I'll back out if needed... git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80858 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert 80839 for now. It causes test failures.Devang Patel2009-09-022-31/+9
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80841 91177308-0d34-0410-b5e6-96231b3b80d8
* Use CallbackVH, instead of WeakVH, to hold MDNode elements. Devang Patel2009-09-022-9/+31
| | | | | | | | | Use FoldingSetNode to unique MDNodes in a context. Use CallbackVH hooks to update context's MDNodeSet appropriately. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80839 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a comment noting the memory ownership rules.Dan Gohman2009-09-021-1/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80827 91177308-0d34-0410-b5e6-96231b3b80d8
* Add convenience functions for reading in LLVM IR that autodetectDan Gohman2009-09-021-0/+117
| | | | | | | | and LLVM Assembly and LLVM Bitcode and automatically call the corresponding reader. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80809 91177308-0d34-0410-b5e6-96231b3b80d8
* Add const qualifiers for isBitcodeWrapper, and add new functionsDan Gohman2009-09-021-7/+36
| | | | | | | | isRawBitcode and isBitcode to allow clients to test whether a given memory buffer holds a bitcode image. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80804 91177308-0d34-0410-b5e6-96231b3b80d8
* Refactor common code from ParseAssemblyString and ParseAssemblyFile,Dan Gohman2009-09-021-0/+12
| | | | | | | to expose a low-level interface for parsing from an existing MemoryBuffer. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80803 91177308-0d34-0410-b5e6-96231b3b80d8
* Add const qualifiers to dominates' arguments.Dan Gohman2009-09-021-7/+11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80801 91177308-0d34-0410-b5e6-96231b3b80d8
* Retype from unsigned to CallingConv::ID accordingly. Approved by Bob Wilson.Sandeep Patel2009-09-025-22/+33
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80773 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a comment.Dan Gohman2009-09-021-0/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80749 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove Offset from ExternalSybmol MachineOperands, this is unused (and at ↵Daniel Dunbar2009-09-012-4/+3
| | | | | | least partly unsupported, in X86 encoding at least). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80726 91177308-0d34-0410-b5e6-96231b3b80d8
* OptimalEdgeProfiling: Reading in Profiles.Andreas Neustifter2009-09-011-0/+9
| | | | | | | This enables LLVM to read the OptimalEdgeProfiles. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80715 91177308-0d34-0410-b5e6-96231b3b80d8
* Addedum to r80712, forgot to add files.Andreas Neustifter2009-09-012-0/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80713 91177308-0d34-0410-b5e6-96231b3b80d8
* OptimalEdgeProfiling: Creation of profiles.Andreas Neustifter2009-09-011-1/+2
| | | | | | | This adds the instrumentation and runtime part of OptimalEdgeProfiling. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80712 91177308-0d34-0410-b5e6-96231b3b80d8
* remove CallGraphNode::replaceCallSite, it is redundant with other APIs.Chris Lattner2009-09-011-5/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80708 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a typo in a comment.Dan Gohman2009-09-011-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80697 91177308-0d34-0410-b5e6-96231b3b80d8
* Preparation for Optimal Edge Profiling:Andreas Neustifter2009-09-011-2/+7
| | | | | | | | | | Optimal edge profiling is only possible when blocks with no predecessors get an virtual edge (BB,0) that counts the execution frequencies of this function-exiting blocks. This patch makes the necessary changes before actually enabling optimal edge profiling. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80667 91177308-0d34-0410-b5e6-96231b3b80d8
* Preparation for Optimal Edge Profiling:Andreas Neustifter2009-09-012-0/+7
| | | | | | | | | This adds a pass to verify the current profile against the flow conditions. This is very helpful when later on trying to perserve the profiling information during all passes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80666 91177308-0d34-0410-b5e6-96231b3b80d8
* Change CallGraphNode to maintain it's Function as an AssertingVHChris Lattner2009-09-011-9/+18
| | | | | | | | | | | | | for sanity. This didn't turn up any bugs. Change CallGraphNode to maintain its "callsite" information in the call edges list as a WeakVH instead of as an instruction*. This fixes a broad class of dangling pointer bugs, and makes CallGraph have a number of useful invariants again. This fixes the class of problem indicated by PR4029 and PR3601. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80663 91177308-0d34-0410-b5e6-96231b3b80d8
* Add virtual destructor.Devang Patel2009-09-011-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80660 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-mc: Store MCSymbolData value as a pointer (to make MSVC happy).Daniel Dunbar2009-09-011-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80652 91177308-0d34-0410-b5e6-96231b3b80d8
* Clean up LSDA name generation and use for SJLJ exception handling. ThisJim Grosbach2009-09-011-4/+4
| | | | | | | | | | | | makes an eggregious hack somewhat more palatable. Bringing the LSDA forward and making it a GV available for reference would be even better, but is beyond the scope of what I'm looking to solve at this point. Objective C++ code could generate function names that broke the previous scheme. This fixes that. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80649 91177308-0d34-0410-b5e6-96231b3b80d8
* Introduce DILocation.Devang Patel2009-09-011-0/+20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80648 91177308-0d34-0410-b5e6-96231b3b80d8
* Add getDirectory() and getFilename() interface to DIScope.Devang Patel2009-09-011-1/+25
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80647 91177308-0d34-0410-b5e6-96231b3b80d8
* Subprogram is a scope. Derive DISubprogram from DIScope.Devang Patel2009-08-311-3/+23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80637 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename DIBlock as DILexicalBlock.Devang Patel2009-08-311-8/+11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80633 91177308-0d34-0410-b5e6-96231b3b80d8
* Derive DICompileUnit from DIScope.Devang Patel2009-08-311-3/+7
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80627 91177308-0d34-0410-b5e6-96231b3b80d8
* Add flag to mark structs for Apple Block "byref" variables; also add code toCaroline Tice2009-08-311-1/+11
| | | | | | | | modify the type and location debug information for these variables to match the programmer's expectations. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80625 91177308-0d34-0410-b5e6-96231b3b80d8
* Extend the ValuesAtScope cache to cover all expressions, not justDan Gohman2009-08-311-4/+10
| | | | | | | | | | | | | | | SCEVUnknowns, as the non-SCEVUnknown cases in the getSCEVAtScope code can also end up repeatedly climing through the same expression trees, which can be unusably slow when the trees are very tall. Also, add a quick check for SCEV pointer equality to the main SCEV comparison routine, as the full comparison code can be expensive in the case of large expression trees. These fix compile-time problems in some pathlogical cases. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80623 91177308-0d34-0410-b5e6-96231b3b80d8
* restore semantics of operator* (removing a FIXME I had to introduce in r80224)Gabor Greif2009-08-311-3/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80622 91177308-0d34-0410-b5e6-96231b3b80d8
* Introduce DIScope.Devang Patel2009-08-311-0/+10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80620 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify isDerivedType() and other predicate interface.Devang Patel2009-08-311-30/+10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80602 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert commit 80428. It completely broke exceptionDuncan Sands2009-08-311-14/+1
| | | | | | | handling on x86-32 linux. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80592 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-mc: Pass values to MCStreamer as MCExprs, not MCValues.Daniel Dunbar2009-08-311-4/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80578 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-mc: Simplify EmitAssignment ('.set' is identical to '=').Daniel Dunbar2009-08-311-5/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80577 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-mc: Remove MCAsmParser::Parse[Paren]RelocatableExpression.Daniel Dunbar2009-08-311-18/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80576 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-mc: Switch MCInst to storing an MCExpr* instead of an MCValue.Daniel Dunbar2009-08-311-15/+15
| | | | | | Also, use MCInst::print instead of custom code in MCAsmPrinter. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80575 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-mc: Add MCAsmParser::Parse[Paren]Expression forms which return an MCExpr.Daniel Dunbar2009-08-311-0/+16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80574 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-mc: Make MCSymbolData symbol member const.Daniel Dunbar2009-08-311-3/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80573 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-mc: Add MCContext to MCAssembler.Daniel Dunbar2009-08-311-1/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80572 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-mc: Add MCAsmParser::getContext.Daniel Dunbar2009-08-311-0/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80571 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-mc: Add MCExpr::{dump,print}.Daniel Dunbar2009-08-311-0/+8
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80570 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-mc: Switch MCExpr construction to using static member functions, and ↵Daniel Dunbar2009-08-311-35/+171
| | | | | | taking the MCContext (which now owns all MCExprs). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80569 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-mc: Add some doxyment markers.Daniel Dunbar2009-08-311-1/+10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80568 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-mc: Move AsmExpr into MC lib (as MCExpr).Daniel Dunbar2009-08-311-0/+179
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80567 91177308-0d34-0410-b5e6-96231b3b80d8
* Step #1 to giving Callgraph some sane invariants. The problems with callgraphChris Lattner2009-08-311-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | stem from the fact that we have two types of passes that need to update it: 1. callgraphscc and module passes that are explicitly aware of it 2. Functionpasses (and loop passes etc) that are interlaced with CGSCC passes by the CGSCC Passmgr. In the case of #1, we can reasonably expect the passes to update the call graph just like any analysis. However, functionpasses are not and generally should not be CG aware. This has caused us no end of problems, so this takes a new approach. Logically, the CGSCC Pass manager can rescan every function after it runs a function pass over it to see if the functionpass made any updates to the IR that affect the callgraph. This allows it to catch new calls introduced by the functionpass. In practice, doing this would be slow. This implementation keeps track of whether or not the current scc is dirtied by a function pass, and, if so, delays updating the callgraph until it is actually needed again. This was we avoid extraneous rescans, but we still have good invariants when the callgraph is needed. Step #2 of the "give Callgraph some sane invariants" is to change CallGraphNode to use a CallBackVH for the callsite entry of the CallGraphNode. This way we can immediately remove entries from the callgraph when a FunctionPass is active instead of having dangling pointers. The current pass tries to tolerate these dangling pointers, but it is just an evil hack. This is related to PR3601/4835/4029. This also reverts r80541, a hack working around the sad lack of invariants. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80566 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix PR4834, a tricky case where the inliner would resolve anChris Lattner2009-08-311-12/+28
| | | | | | | | | | | | | | | | indirect function pointer, inline it, then go to delete the body. The problem is that the callgraph had other references to the function, though the inliner had no way to know it, so we got a dangling pointer and an invalid iterator out of the deal. The fix to this is pretty simple: stop the inliner from deleting the function by knowing that there are references to it. Do this by making CallGraphNodes contain a refcount. This requires moving deletion of available_externally functions to the module-level cleanup sweep where it belongs. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80533 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix some nasty callgraph dangling pointer problems in Chris Lattner2009-08-313-9/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | argpromotion and structretpromote. Basically, when replacing a function, they used the 'changeFunction' api which changes the entry in the function map (and steals/reuses the callgraph node). This has some interesting effects: first, the problem is that it doesn't update the "callee" edges in any callees of the function in the call graph. Second, this covers for a major problem in all the CGSCC pass stuff, which is that it is completely broken when functions are deleted if they *don't* reuse a CGN. (there is a cute little fixme about this though :). This patch changes the protocol that CGSCC passes must obey: now the CGSCC pass manager copies the SCC and preincrements its iterator to avoid passes invalidating it. This allows CGSCC passes to mutate the current SCC. However multiple passes may be run on that SCC, so if passes do this, they are now required to *update* the SCC to be current when they return. Other less interesting parts of this patch are that it makes passes update the CG more directly, eliminates changeFunction, and requires clients of replaceCallSite to specify the new callee CGN if they are changing it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80527 91177308-0d34-0410-b5e6-96231b3b80d8
* Make sure we specify no arguments for context functions.Erick Tryzelaar2009-08-301-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80525 91177308-0d34-0410-b5e6-96231b3b80d8