Commit Graph

240 Commits

Author SHA1 Message Date
Chris Lattner b84764516d move mangler quote handling from asm printers to TargetAsmInfo.
llvm-svn: 73738
2009-06-18 23:41:35 +00:00
Chris Lattner 09081b25a5 simplify macro debug info directive handling.
llvm-svn: 73736
2009-06-18 23:31:37 +00:00
Evan Cheng de9e36a74e On Darwin, ams printer should output a second label before a jump table so the linker knows it's a new atom. But this is only needed if the jump table is put in a separate section from the function body.
llvm-svn: 73720
2009-06-18 20:37:15 +00:00
Bill Wendling 4a172428e5 Fix typos.
llvm-svn: 73464
2009-06-16 04:02:03 +00:00
Devang Patel 14491abe48 Use MainCU if it is available.
llvm-svn: 73457
2009-06-16 02:09:30 +00:00
Devang Patel 56e6fe1642 Gracefully handle imbalanced inline function begin and end markers.
llvm-svn: 73426
2009-06-15 21:45:50 +00:00
Dan Gohman 4fe64deb7b Fix old-style type names in comments.
llvm-svn: 73362
2009-06-14 23:30:43 +00:00
Devang Patel 64e6529e76 llvm.dbg.region.end() intrinsic is not required to be in _last_ basic block in a function. If that happens then any basic block that follows (lexically) the block with regin.end will not have scope info available. LexicalScopeStack relies on processing basic block in CFG order, but this processing order is not guaranteed. Things get complicated when the optimizer gets a chance to optimizer IR with dbg intrinsics.
Apply defensive patch to preserve at least one lexical scope till the end of function.

llvm-svn: 73282
2009-06-13 02:16:18 +00:00
Devang Patel c1fee72162 Clear AbstractInstanceRootMap at the end of the function.
llvm-svn: 73244
2009-06-12 19:24:05 +00:00
Dan Gohman d9ef48a73e Remove some unnecessary #includes.
llvm-svn: 72948
2009-06-05 16:32:58 +00:00
Bill Wendling 5ea3e9db43 Accidental commit. This isn't ready for prime time just yet.
llvm-svn: 72699
2009-06-01 20:18:46 +00:00
Bill Wendling 09f17a8479 Untabification.
llvm-svn: 72604
2009-05-30 01:09:53 +00:00
Bill Wendling f99bd3a82b Temporarily revert r72191. It was causing an assert during llvm-gcc
bootstrapping.

llvm-svn: 72200
2009-05-21 00:04:55 +00:00
Bill Wendling 8658bb565d Minor code cleanup. No functionality change.
llvm-svn: 72198
2009-05-20 23:31:45 +00:00
Bill Wendling 744668d5af Merge 'ConstructFunctionDbgScope' and 'ConstructAbstractDbgScope'.
llvm-svn: 72197
2009-05-20 23:28:48 +00:00
Bill Wendling bcad77a8d5 Rename 'New*' methods to 'Create*' to be consistent. 'NewString' isn't used.
llvm-svn: 72196
2009-05-20 23:24:48 +00:00
Bill Wendling 806535f908 Add comment for emit section.
llvm-svn: 72195
2009-05-20 23:22:40 +00:00
Bill Wendling 480ff32120 Move 'Emit' methods down to their own place.
llvm-svn: 72194
2009-05-20 23:21:38 +00:00
Bill Wendling 2b128d70c5 Revert r72192. It was causing a build failure.
llvm-svn: 72193
2009-05-20 23:19:06 +00:00
Bill Wendling 8d7533d3e5 Do some mechanical changes. Combine the 'construct abastract dbg thingy' in with
the 'constract function dbg thingy'. Rename some methods to make them consistent
with the rest of the methods. Move the 'Emit' methods to the end of the file.

llvm-svn: 72192
2009-05-20 23:04:56 +00:00
Argyrios Kyrtzidis 2b59a5fc6c Introduce DebugScope which gets embedded into the machine instructions' DebugLoc.
DebugScope refers to a debug region, function or block.

llvm-svn: 72191
2009-05-20 22:57:17 +00:00
Mike Stump ebf04f2843 Fix cmake builds.
llvm-svn: 72078
2009-05-19 00:18:14 +00:00
Bill Wendling ec78f1516d Don't set the "location" information for inlined functions' variables.
llvm-svn: 72064
2009-05-18 23:08:55 +00:00
Bill Wendling 1992f86733 Small code cleanup.
llvm-svn: 72057
2009-05-18 22:33:01 +00:00
Bill Wendling bc308569a3 RecordVariable is called each time a DECLARE node is encountered. For an inlined
function, this could be many, many times. We don't want to re-add variables to
that DIE for each time. We just want to add them once. Check to make sure that
we haven't added them already.

llvm-svn: 72047
2009-05-18 22:02:36 +00:00
Bill Wendling 2f921f82e4 Split out the DwarfDebug module from the DwarfWriter module.
Again, no intendtional functionality change.

llvm-svn: 71854
2009-05-15 09:23:25 +00:00
Bill Wendling 1c5fd604b3 Mark class as hidden.
llvm-svn: 71850
2009-05-15 06:55:26 +00:00
Bill Wendling dd20b98c35 Move c'tor/d'tor to top of file.
llvm-svn: 71828
2009-05-15 01:18:50 +00:00
Bill Wendling d64cd2bb6e Split out the DwarfException class into its own file. No functionality change,
though the classes have been marked with "VISIBILITY_HIDDEN".

llvm-svn: 71827
2009-05-15 01:12:28 +00:00
Bill Wendling 47054f3d57 Split out the Dwarf writer stuff into separate files. This is a much more
logical/sane approach to organizing all of the stuff that goes into writing out
DWARF information. Honestly? even this is too complex for what it's supposed to
be doing.

Trivia: It *looks* like there would be functionality changes, however there aren't!
llvm-svn: 71821
2009-05-15 00:11:17 +00:00
Mike Stump 207fbf4320 Tag blocks with DW_AT_APPLE_block.
llvm-svn: 71784
2009-05-14 18:45:49 +00:00
Bill Wendling cdec744869 There's yet more ugliness (surprise!) in DebugInfo. This needs major reworking.
Basically, there was a situation where it was getting an empty vector and doing
a .back() on that. Which isn't cool.

llvm-svn: 71746
2009-05-13 23:55:49 +00:00
Bill Wendling 1d601cdaf4 Move the bookkeeping of the debug scopes back to the place where it
belonged. The variable declaration stuff wasn't happy with it where it
was. Sorry that the testcase is so big. Bugpoint wasn't able to reduce it
successfully.

llvm-svn: 71714
2009-05-13 20:33:33 +00:00
Bill Wendling 6c60dbb3cb - Record that the debug info is actually used so that the label folder doesn't
blast it away.
- Move InlineInfo bookkeeping to bookkeep the correct debug info object.

llvm-svn: 71519
2009-05-12 00:06:59 +00:00
Bill Wendling 59b1ca2a8f This is a large rewrite of how Dwarf info for inlined functions is handled.
The DwarfWriter expects DbgScopes and DIEs to behave themselves according to
DwarfWriter's rules. However, inlined functions violate these rules. There are
two different types of DIEs associated with an inlined function: an abstract
instance, which has information about the original source code for the function
being inlined; and concrete instances, which are created for each place the
function was inlined and point back to the abstract instance.

This patch tries to stay true to this schema. It bypasses how regular DbgScopes
and DIEs are created and used when necessary. It provides special handling for
DIEs of abstract and concrete instances.

This doesn't take care of all of the problems with debug info for inlined
functions, but it's a step in the right direction. For one thing, llvm-gcc
generates wrong IR (it's missing some llvm.dbg intrinsics at the point where the
function's inlined) for this example:

#include <stdio.h>
static __inline__ __attribute__((always_inline))  int bar(int x) { return 4; }
void foo() {
  long long b = 1;
  int Y = bar(4);
  printf("%d\n", Y);
}

while clang generates correct IR.

llvm-svn: 71410
2009-05-10 23:14:38 +00:00
Duncan Sands af9eaa830a Rename PaddedSize to AllocSize, in the hope that this
will make it more obvious what it represents, and stop
it being confused with the StoreSize.

llvm-svn: 71349
2009-05-09 07:06:46 +00:00
Bill Wendling fa03b0084a Compute the offsets of the compile units. We need this so that when we emit a
concrete instance of an inlined function, we can get the actual address of the
abstract instance inside of the compile unit.

This isn't currently used, but will be by a future check-in.

llvm-svn: 71263
2009-05-08 21:03:15 +00:00
Bill Wendling 2dc580c954 Minor clean ups. No functionality change.
llvm-svn: 71256
2009-05-08 20:38:02 +00:00
Dan Gohman 4bb6fa23cb Revert 71165. It did more than just revert 71158 and it introduced
several regressions. The problem due to 71158 is now fixed.

llvm-svn: 71176
2009-05-07 19:46:24 +00:00
Bill Wendling 17f0f65499 Temporarily revert r71158. It was causing a failure during a full bootstrap:
checking for bcopy... no
checking for getc_unlocked... Assertion failed: (0 && "Unknown SCEV kind!"), function operator(), file /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore.roots/llvmCore~obj/src/lib/Analysis/ScalarEvolution.cpp, line 511.
/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmgcc42.roots/llvmgcc42~obj/src/libdecnumber/decUtility.c:360: internal compiler error: Abort trap
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://developer.apple.com/bugreporter> for instructions.
make[4]: *** [decUtility.o] Error 1
make[4]: *** Waiting for unfinished jobs....
Assertion failed: (0 && "Unknown SCEV kind!"), function operator(), file /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore.roots/llvmCore~obj/src/lib/Analysis/ScalarEvolution.cpp, line 511.
/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmgcc42.roots/llvmgcc42~obj/src/libdecnumber/decNumber.c:5591: internal compiler error: Abort trap
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://developer.apple.com/bugreporter> for instructions.
make[4]: *** [decNumber.o] Error 1
make[3]: *** [all-stage2-libdecnumber] Error 2
make[3]: *** Waiting for unfinished jobs....

llvm-svn: 71165
2009-05-07 17:26:14 +00:00
Argyrios Kyrtzidis 58f3811300 Move the tablegen-produced DebugLoc handling into a AsmWriter::processDebugLoc function.
No functionality change.

llvm-svn: 71156
2009-05-07 13:55:51 +00:00
Argyrios Kyrtzidis baf3fee885 Make DwarfWriter::RecordInlinedFnStart more like the other DwarfWriter's methods:
-Have it return a label ID
-Remove the unused Instruction parameter

No functionality change.

llvm-svn: 71132
2009-05-07 00:16:31 +00:00
Bill Wendling 4d11693f33 - Move some debug fields to coincide with how GCC emits them. No functionality
change.
- Reformatting.

llvm-svn: 71118
2009-05-06 21:21:34 +00:00
Chris Lattner 929b644b0f Do not require variable debug info nodes to have a compile unit.
For implicit decls like "self" and "_cmd" in ObjC, these decls
should not have a location.

llvm-svn: 70964
2009-05-05 04:55:56 +00:00
Argyrios Kyrtzidis 71fb950b73 Restore a comment.
llvm-svn: 70900
2009-05-04 19:23:45 +00:00
Argyrios Kyrtzidis 9ae29b2d8f -Remove the DwarfWriter::RecordSourceLine calls from the instruction selectors.
-Depend on DebugLocs for source line info.

(Comes with Regression-Be-Gone(tm))

llvm-svn: 70871
2009-05-04 16:23:49 +00:00
Argyrios Kyrtzidis 79be34012f Revert r70803 for now, it causes a regression.
llvm-svn: 70811
2009-05-03 23:27:19 +00:00
Argyrios Kyrtzidis ce7196b903 -Remove the DwarfWriter::RecordSourceLine calls from the instruction selectors.
-Depend on DebugLocs for source line info.

llvm-svn: 70803
2009-05-03 22:03:35 +00:00
Argyrios Kyrtzidis 97324cec99 -Move the DwarfWriter::ValidDebugInfo check to a static DIDescriptor::ValidDebugInfo
-Create DebugLocs without the need to have a DwarfWriter around

llvm-svn: 70682
2009-05-03 08:50:41 +00:00
Bill Wendling 80b9abf8f4 Simplify more code and add timer stuff.
llvm-svn: 70539
2009-05-01 08:40:06 +00:00