aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MachineModuleInfo.cpp
AgeCommit message (Collapse)AuthorFilesLines
2009-07-20implement a new magic global "llvm.compiler.used" which is like llvm.used, butChris Lattner1-1/+2
doesn't cause ".no_dead_strip" to be emitted on darwin. llvm-svn: 76399
2009-07-20use stripPointerCasts to simplify some code.Chris Lattner1-6/+4
llvm-svn: 76397
2009-07-14llvm_unreachable->llvm_unreachable(0), LLVM_UNREACHABLE->llvm_unreachable.Torok Edwin1-1/+1
This adds location info for all llvm_unreachable calls (which is a macro now) in !NDEBUG builds. In NDEBUG builds location info and the message is off (it only prints "UREACHABLE executed"). llvm-svn: 75640
2009-07-11assert(0) -> LLVM_UNREACHABLE.Torok Edwin1-1/+2
Make llvm_unreachable take an optional string, thus moving the cerr<< out of line. LLVM_UNREACHABLE is now a simple wrapper that makes the message go away for NDEBUG builds. llvm-svn: 75379
2009-04-10DebugLabelFolder ruthlessly deletes redundant labels. However, sometimes the ↵Devang Patel1-1/+1
redundant labels is referenced by debug info somewhere else. This patch provies a way so that dwarf writer can mark labels as used. llvm-svn: 68813
2009-02-03Remove dead code.Devang Patel1-1/+0
llvm-svn: 63653
2009-01-28Rename getAnalysisToUpdate to getAnalysisIfAvailable.Duncan Sands1-1/+1
llvm-svn: 63198
2009-01-13Removoe MachineModuleInfo methods (and related DebugInfoDesc class ↵Devang Patel1-1711/+0
hierarchy) that were used to handle debug info. llvm-svn: 62199
2009-01-13Keep "has debug info" big in MachineModuleInfo to avoid circular dependency ↵Devang Patel1-0/+1
between AsmPrinter and CodeGen. llvm-svn: 62191
2008-12-10Fix a couple of Dwarf bugs.Evan Cheng1-3/+6
- Emit DW_AT_byte_size for struct and union of size zero. - Emit DW_AT_declaration for forward type declaration. llvm-svn: 60812
2008-11-10Fix an over aggressive assumption that struct decls will have a pointer toChris Lattner1-1/+1
an array that is empty. Instead of requiring this array, allow a null pointer. This shrinks all forward references of structs. llvm-svn: 58959
2008-10-16Move the include of MachineLocation.h into MachineModuleInfo.hDan Gohman1-1/+0
because it declares a std::vector<MachineMove>, and strict concept checking requires the definition of MachineMove to be available. llvm-svn: 57617
2008-09-22Instead of setPreservesAll, just mark them preseving machine loop info and ↵Evan Cheng1-1/+3
machine dominators. llvm-svn: 56475
2008-09-22Mark several codegen passes as preserving all analysis.Evan Cheng1-0/+5
llvm-svn: 56469
2008-09-04Tidy up several unbeseeming casts from pointer to intptr_t.Dan Gohman1-2/+2
llvm-svn: 55779
2008-07-09Make the DICountVisitor not a visitor. This keeps us from calling virtualBill Wendling1-33/+154
functions and junk. llvm-svn: 53279
2008-07-07Use the canonical way to get an empty structure.Bill Wendling1-3/+2
llvm-svn: 53206
2008-07-07Use StringMap for greater justice!Bill Wendling1-1/+1
llvm-svn: 53202
2008-07-03Don't return std::vector by value, but pass it in by reference to be filled.Bill Wendling1-12/+10
llvm-svn: 53123
2008-07-03Revert my previous check-in that split up MachineModuleInfo. It turns out toBill Wendling1-61/+818
slow the compiler down at -O0 some 30% or more. Ooops. llvm-svn: 53120
2008-07-02Use the canonical form for getting an empty structure.Bill Wendling1-10/+5
llvm-svn: 53003
2008-07-02Sorry. I couldn't sleep at night knowing I put these ugly casts into the ↵Bill Wendling1-2/+1
source tree. llvm-svn: 53001
2008-07-01- Update comments. Bill Wendling1-2/+4
- Don't use GlobalVariable::LinkageTypes when unsigned works. llvm-svn: 52987
2008-06-30- Re-apply 52748 and friends with fix. GetConstantStringInfo() returns an ↵Evan Cheng1-1/+4
empty string for ConstantAggregateZero case which surprises selectiondag. - Correctly handle memcpy from constant string which is zero-initialized. llvm-svn: 52891
2008-06-29Revert (52748 and friends):Anton Korobeynikov1-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. llvm-svn: 52884
2008-06-27Reduce number of times .size() is called on a vector. Rename some variables toBill Wendling1-16/+22
match normal naming scheme. llvm-svn: 52820
2008-06-27Cruft left from patch revert...sorry. :-(Bill Wendling1-3/+6
llvm-svn: 52808
2008-06-27Reverting broken patch r52803.Bill Wendling1-33/+20
llvm-svn: 52806
2008-06-27- Remove a use of std::vector.Bill Wendling1-12/+24
- Make sure that we're not recalculating the size of a vector that never changes. llvm-svn: 52803
2008-06-27Refactor the DebugInfoDesc stuff out of the MachineModuleInfo file. Clean upBill Wendling1-791/+32
some uses of std::vector, where it's return std::vector by value. Yuck! llvm-svn: 52800
2008-06-26Don't create a whole new string just to copy the elements into it.Owen Anderson1-5/+3
llvm-svn: 52785
2008-06-26Move GetConstantStringInfo to lib/Analysis. RemoveEric Christopher1-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. llvm-svn: 52748
2008-05-13Clean up the use of static and anonymous namespaces. This turned upDan Gohman1-3/+5
several things that were neither in an anonymous namespace nor static but not intended to be global. llvm-svn: 51017
2008-04-02Recommitting EH patch; this should answer most of theDale Johannesen1-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. llvm-svn: 49064
2008-03-25A quick nm audit turned up several fixed tables and objects that wereDan Gohman1-3/+3
marked read-write. Use const so that they can be allocated in a read-only segment. llvm-svn: 48800
2008-02-02SDIsel processes llvm.dbg.declare by recording the variable debug ↵Evan Cheng1-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. llvm-svn: 46659
2008-02-01Rename RecordLabel to RecordSourceLine because that's what it is doing.Evan Cheng1-3/+3
llvm-svn: 46628
2008-01-31Add an extra operand to LABEL nodes which distinguishes between debug, EH, ↵Evan Cheng1-1/+1
or misc labels. This fixes the EH breakage. However I am not convinced this is *the* solution. llvm-svn: 46609
2008-01-30Adjust loop per review feedback.Dale Johannesen1-4/+2
llvm-svn: 46569
2008-01-30Accept getelementptr starting at GV with all 0 indices as aDale Johannesen1-0/+14
legitimate way of representing global variable GV in debug info. llvm-svn: 46565
2008-01-29Use empty() instead of comparing size() with zero.Dan Gohman1-1/+1
llvm-svn: 46514
2008-01-16Do not mark EH tables no-dead-strip unless theDale Johannesen1-0/+15
associated function is so marked. llvm-svn: 46088
2008-01-07remove #includageChris Lattner1-3/+0
llvm-svn: 45697
2007-12-29Remove attribution from file headers, per discussion on llvmdev.Chris Lattner1-2/+2
llvm-svn: 45418
2007-12-19The C++ exception handling personality function wantsDuncan Sands1-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). llvm-svn: 45197
2007-12-17Change the PointerType api for creating pointer types. The old functionality ↵Christopher Lamb1-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. llvm-svn: 45082
2007-11-30Provide a way to update DescGlobals cache directly.Devang Patel1-0/+6
llvm-svn: 44446
2007-09-05Fix PR1628. When exception handling is turned on,Duncan Sands1-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. llvm-svn: 41718
2007-08-27There is an impedance matching problem between LLVM andDuncan Sands1-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). llvm-svn: 41484
2007-07-14Long live the exception handling!Anton Korobeynikov1-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. llvm-svn: 39855