aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/MachineModuleInfo.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Move the include of MachineLocation.h into MachineModuleInfo.hDan Gohman2008-10-161-1/+0
| | | | | | | | | because it declares a std::vector<MachineMove>, and strict concept checking requires the definition of MachineMove to be available. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57617 91177308-0d34-0410-b5e6-96231b3b80d8
* Instead of setPreservesAll, just mark them preseving machine loop info and ↵Evan Cheng2008-09-221-1/+3
| | | | | | machine dominators. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56475 91177308-0d34-0410-b5e6-96231b3b80d8
* Mark several codegen passes as preserving all analysis.Evan Cheng2008-09-221-0/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56469 91177308-0d34-0410-b5e6-96231b3b80d8
* Tidy up several unbeseeming casts from pointer to intptr_t.Dan Gohman2008-09-041-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55779 91177308-0d34-0410-b5e6-96231b3b80d8
* Make the DICountVisitor not a visitor. This keeps us from calling virtualBill Wendling2008-07-091-33/+154
| | | | | | | functions and junk. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53279 91177308-0d34-0410-b5e6-96231b3b80d8
* Use the canonical way to get an empty structure.Bill Wendling2008-07-071-3/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53206 91177308-0d34-0410-b5e6-96231b3b80d8
* Use StringMap for greater justice!Bill Wendling2008-07-071-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53202 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't return std::vector by value, but pass it in by reference to be filled.Bill Wendling2008-07-031-12/+10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53123 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert my previous check-in that split up MachineModuleInfo. It turns out toBill Wendling2008-07-031-61/+818
| | | | | | | | slow the compiler down at -O0 some 30% or more. Ooops. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53120 91177308-0d34-0410-b5e6-96231b3b80d8
* Use the canonical form for getting an empty structure.Bill Wendling2008-07-021-10/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53003 91177308-0d34-0410-b5e6-96231b3b80d8
* Sorry. I couldn't sleep at night knowing I put these ugly casts into the ↵Bill Wendling2008-07-021-2/+1
| | | | | | source tree. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53001 91177308-0d34-0410-b5e6-96231b3b80d8
* - Update comments. Bill Wendling2008-07-011-2/+4
| | | | | | | - Don't use GlobalVariable::LinkageTypes when unsigned works. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52987 91177308-0d34-0410-b5e6-96231b3b80d8
* - Re-apply 52748 and friends with fix. GetConstantStringInfo() returns an ↵Evan Cheng2008-06-301-1/+4
| | | | | | | | | empty string for ConstantAggregateZero case which surprises selectiondag. - Correctly handle memcpy from constant string which is zero-initialized. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52891 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert (52748 and friends):Anton Korobeynikov2008-06-291-4/+1
| | | | | | | | | | | | Move GetConstantStringInfo to lib/Analysis. Remove string output routine from Constant. Update all callers. Change debug intrinsic api slightly to accomodate move of routine, these now return values instead of strings. This unbreaks llvm-gcc bootstrap. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52884 91177308-0d34-0410-b5e6-96231b3b80d8
* Reduce number of times .size() is called on a vector. Rename some variables toBill Wendling2008-06-271-16/+22
| | | | | | | | match normal naming scheme. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52820 91177308-0d34-0410-b5e6-96231b3b80d8
* Cruft left from patch revert...sorry. :-(Bill Wendling2008-06-271-3/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52808 91177308-0d34-0410-b5e6-96231b3b80d8
* Reverting broken patch r52803.Bill Wendling2008-06-271-33/+20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52806 91177308-0d34-0410-b5e6-96231b3b80d8
* - Remove a use of std::vector.Bill Wendling2008-06-271-12/+24
| | | | | | | | - Make sure that we're not recalculating the size of a vector that never changes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52803 91177308-0d34-0410-b5e6-96231b3b80d8
* Refactor the DebugInfoDesc stuff out of the MachineModuleInfo file. Clean upBill Wendling2008-06-271-791/+32
| | | | | | | some uses of std::vector, where it's return std::vector by value. Yuck! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52800 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't create a whole new string just to copy the elements into it.Owen Anderson2008-06-261-5/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52785 91177308-0d34-0410-b5e6-96231b3b80d8
* Move GetConstantStringInfo to lib/Analysis. RemoveEric Christopher2008-06-261-1/+6
| | | | | | | | | | string output routine from Constant. Update all callers. Change debug intrinsic api slightly to accomodate move of routine, these now return values instead of strings. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52748 91177308-0d34-0410-b5e6-96231b3b80d8
* Clean up the use of static and anonymous namespaces. This turned upDan Gohman2008-05-131-3/+5
| | | | | | | | several things that were neither in an anonymous namespace nor static but not intended to be global. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51017 91177308-0d34-0410-b5e6-96231b3b80d8
* Recommitting EH patch; this should answer most of theDale Johannesen2008-04-021-6/+0
| | | | | | | | | | | | | | | | | review feedback. -enable-eh is still accepted but doesn't do anything. EH intrinsics use Dwarf EH if the target supports that, and are handled by LowerInvoke otherwise. The separation of the EH table and frame move data is, I think, logically figured out, but either one still causes full EH info to be generated (not sure how to split the metadata correctly). MachineModuleInfo::needsFrameInfo is no longer used and is removed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49064 91177308-0d34-0410-b5e6-96231b3b80d8
* A quick nm audit turned up several fixed tables and objects that wereDan Gohman2008-03-251-3/+3
| | | | | | | | marked read-write. Use const so that they can be allocated in a read-only segment. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48800 91177308-0d34-0410-b5e6-96231b3b80d8
* SDIsel processes llvm.dbg.declare by recording the variable debug ↵Evan Cheng2008-02-021-8/+10
| | | | | | | | | | information descriptor and its corresponding stack frame index in MachineModuleInfo. This only works if the local variable is "homed" in the stack frame. It does not work for byval parameter, etc. Added ISD::DECLARE node type to represent llvm.dbg.declare intrinsic. Now the intrinsic calls are lowered into a SDNode and lives on through out the codegen passes. For now, since all the debugging information recording is done at isel time, when a ISD::DECLARE node is selected, it has the side effect of also recording the variable. This is a short term solution that should be fixed in time. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46659 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename RecordLabel to RecordSourceLine because that's what it is doing.Evan Cheng2008-02-011-3/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46628 91177308-0d34-0410-b5e6-96231b3b80d8
* Add an extra operand to LABEL nodes which distinguishes between debug, EH, ↵Evan Cheng2008-01-311-1/+1
| | | | | | or misc labels. This fixes the EH breakage. However I am not convinced this is *the* solution. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46609 91177308-0d34-0410-b5e6-96231b3b80d8
* Adjust loop per review feedback.Dale Johannesen2008-01-301-4/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46569 91177308-0d34-0410-b5e6-96231b3b80d8
* Accept getelementptr starting at GV with all 0 indices as aDale Johannesen2008-01-301-0/+14
| | | | | | | | legitimate way of representing global variable GV in debug info. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46565 91177308-0d34-0410-b5e6-96231b3b80d8
* Use empty() instead of comparing size() with zero.Dan Gohman2008-01-291-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46514 91177308-0d34-0410-b5e6-96231b3b80d8
* Do not mark EH tables no-dead-strip unless theDale Johannesen2008-01-161-0/+15
| | | | | | | | associated function is so marked. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46088 91177308-0d34-0410-b5e6-96231b3b80d8
* remove #includageChris Lattner2008-01-071-3/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45697 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove attribution from file headers, per discussion on llvmdev.Chris Lattner2007-12-291-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45418 91177308-0d34-0410-b5e6-96231b3b80d8
* The C++ exception handling personality function wantsDuncan Sands2007-12-191-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | to know about calls that cannot throw ('nounwind'): if such a call does throw for some reason then the personality will terminate the program. The distinction between an ordinary call and a nounwind call is that an ordinary call gets an entry in the exception table but a nounwind call does not. This patch sets up the exception table appropriately. One oddity is that I've chosen to bracket nounwind calls with labels (like invokes) - the other choice would have been to bracket ordinary calls with labels. While bracketing ordinary calls is more natural (because bracketing by labels would then correspond exactly to getting an entry in the exception table), I didn't do it because introducing labels impedes some optimizations and I'm guessing that ordinary calls occur more often than nounwind calls. This fixes the gcc filter2 eh test, at least at -O0 (the inliner needs some tweaking at higher optimization levels). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45197 91177308-0d34-0410-b5e6-96231b3b80d8
* Change the PointerType api for creating pointer types. The old functionality ↵Christopher Lamb2007-12-171-2/+2
| | | | | | of PointerType::get() has become PointerType::getUnqual(), which returns a pointer in the generic address space. The new prototype of PointerType::get() requires both a type and an address space. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45082 91177308-0d34-0410-b5e6-96231b3b80d8
* Provide a way to update DescGlobals cache directly.Devang Patel2007-11-301-0/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44446 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix PR1628. When exception handling is turned on,Duncan Sands2007-09-051-8/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | labels are generated bracketing each call (not just invokes). This is used to generate entries in the exception table required by the C++ personality. However it gets in the way of tail-merging. This patch solves the problem by no longer placing labels around ordinary calls. Instead we generate entries in the exception table that cover every instruction in the function that wasn't covered by an invoke range (the range given by the labels around the invoke). As an optimization, such entries are only generated for parts of the function that contain a call, since for the moment those are the only instructions that can throw an exception [1]. As a happy consequence, we now get a smaller exception table, since the same region can cover many calls. While there, I also implemented folding of invoke ranges - successive ranges are merged when safe to do so. Finally, if a selector contains only a cleanup, there's a special shorthand for it - place a 0 in the call-site entry. I implemented this while there. As a result, the exception table output (excluding filters) is now optimal - it cannot be made smaller [2]. The problem with throw filters is that folding them optimally is hard, and the benefit of folding them is minimal. [1] I tested that having trapping instructions (eg divide by zero) in such a region doesn't cause trouble. [2] It could be made smaller with the help of higher layers, eg by having branch folding reorder basic blocks ending in invokes with the same landing pad so they follow each other. I don't know if this is worth doing. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41718 91177308-0d34-0410-b5e6-96231b3b80d8
* There is an impedance matching problem between LLVM andDuncan Sands2007-08-271-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | gcc exception handling: if an exception unwinds through an invoke, then execution must branch to the invoke's unwind target. We previously tried to enforce this by appending a cleanup action to every selector, however this does not always work correctly due to an optimization in the C++ unwinding runtime: if only cleanups would be run while unwinding an exception, then the program just terminates without actually executing the cleanups, as invoke semantics would require. I was hoping this wouldn't be a problem, but in fact it turns out to be the cause of all the remaining failures in the LLVM testsuite (these also fail with -enable-correct-eh-support, so turning on -enable-eh didn't make things worse!). Instead we need to append a full-blown catch-all to the end of each selector. The correct way of doing this depends on the personality function, i.e. it is language dependent, so can only be done by gcc. Thus this patch which generalizes the eh.selector intrinsic so that it can handle all possible kinds of action table entries (before it didn't accomodate cleanups): now 0 indicates a cleanup, and filters have to be specified using the number of type infos plus one rather than the number of type infos. Related gcc patches will cause Ada to pass a cleanup (0) to force the selector to always fire, while C++ will use a C++ catch-all (null). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41484 91177308-0d34-0410-b5e6-96231b3b80d8
* Long live the exception handling!Anton Korobeynikov2007-07-141-0/+4
| | | | | | | | | | | | | | | | This patch fills the last necessary bits to enable exceptions handling in LLVM. Currently only on x86-32/linux. In fact, this patch adds necessary intrinsics (and their lowering) which represent really weird target-specific gcc builtins used inside unwinder. After corresponding llvm-gcc patch will land (easy) exceptions should be more or less workable. However, exceptions handling support should not be thought as 'finished': I expect many small and not so small glitches everywhere. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@39855 91177308-0d34-0410-b5e6-96231b3b80d8
* Make sure only one copy of a filter is placed in theDuncan Sands2007-07-051-3/+21
| | | | | | | | | exception handling table if we encounter it multiple times. Filters could be folded harder than this, but that would mean a lot more work for not much gain. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37908 91177308-0d34-0410-b5e6-96231b3b80d8
* The semantics of invoke require that we always jump to the unwind blockDuncan Sands2007-06-021-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | (landing pad) when an exception unwinds through the call. This doesn't quite match the way the dwarf unwinder works: by default it only jumps to the landing pad if the catch or filter specification matches, and otherwise it keeps on unwinding. There are two ways of specifying to the unwinder that it should "always" (more on why there are quotes here later) jump to the landing pad: follow the specification by a 0 typeid, or follow it by the typeid for the NULL typeinfo. GCC does the first, and this patch makes LLVM do the same as gcc. However there is a problem: the unwinder performs optimizations based on C++ semantics (it only expects destructors to be run if the 0 typeid fires - known as "cleanups"), meaning it assumes that no exceptions will be raised and that the raised exception will be reraised at the end of the cleanup code. So if someone writes their own LLVM code using the exception intrinsics they will get a nasty surprise if they don't follow these rules. The other possibility of using the typeid corresponding to NULL (catch-all) causes the unwinder to make no assumptions, so this is probably what we should use in the long-run. However since we are still having trouble getting exception handling working properly, for the moment it seems best to closely imitate GCC. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37399 91177308-0d34-0410-b5e6-96231b3b80d8
* Integrate exception filter support and exception catch support. ThisDuncan Sands2007-06-021-4/+23
| | | | | | | | | simplifies the code in DwarfWriter, allows for multiple filters and makes it trivial to specify filters accompanied by cleanups or catch-all specifications (see next patch). What a deal! Patch blessed by Anton. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37398 91177308-0d34-0410-b5e6-96231b3b80d8
* Mark all calls as "could throw", when exceptions are enabled. Emit necessary ↵Anton Korobeynikov2007-05-231-4/+12
| | | | | | LP info too. This fixes PR1439 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37311 91177308-0d34-0410-b5e6-96231b3b80d8
* Emit multiple common EH frames for multiple (including blank) personalityAnton Korobeynikov2007-05-131-13/+30
| | | | | | | | | functions. This partly fixes PR1414: now we're restricted only to one personality function per eh frame, not per module. Further work on "multiple personalities" topic needs representative example. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37018 91177308-0d34-0410-b5e6-96231b3b80d8
* More DWARF-related things cleanup:Anton Korobeynikov2007-05-121-3/+12
| | | | | | | | | | | 1. Fix PR1380 2. Apply Duncan's patch from PR1410 3. Insert workaround for "one personality function per module" as noted in PR1414 4. Emit correct debug frames for x86/linux. This partly fixes DebugInfo/2006-11-06-StackTrace.cpp: stack trace is shown correctly, but arguments for function on top of stack are displayed incorrectly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37015 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix ↵Devang Patel2007-05-111-1/+1
| | | | | | http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20070507/049516.html git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36998 91177308-0d34-0410-b5e6-96231b3b80d8
* Ooops. Some debugging stuff :)Anton Korobeynikov2007-05-101-1/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36978 91177308-0d34-0410-b5e6-96231b3b80d8
* Allow multiple invokes per landing pad. This (probably) fixes PR1410.Anton Korobeynikov2007-05-101-8/+21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36977 91177308-0d34-0410-b5e6-96231b3b80d8
* Drop 'const'Devang Patel2007-05-031-3/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36662 91177308-0d34-0410-b5e6-96231b3b80d8
* Use 'static const char' instead of 'static const int'.Devang Patel2007-05-021-3/+3
| | | | | | | | Due to darwin gcc bug, one version of darwin linker coalesces static const int, which defauts PassID based pass identification. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36652 91177308-0d34-0410-b5e6-96231b3b80d8