Commit Graph

231 Commits

Author SHA1 Message Date
Devang Patel
daf9e02893 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.




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73282 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-13 02:16:18 +00:00
Devang Patel
9217f793bf Clear AbstractInstanceRootMap at the end of the function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73244 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-12 19:24:05 +00:00
Dan Gohman
c965ee223c Remove some unnecessary #includes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72948 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-05 16:32:58 +00:00
Bill Wendling
8fff19ba55 Accidental commit. This isn't ready for prime time just yet.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72699 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-01 20:18:46 +00:00
Bill Wendling
51b16f4737 Untabification.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72604 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-30 01:09:53 +00:00
Bill Wendling
df7d5d3170 Temporarily revert r72191. It was causing an assert during llvm-gcc
bootstrapping.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72200 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-21 00:04:55 +00:00
Bill Wendling
39dd696282 Minor code cleanup. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72198 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-20 23:31:45 +00:00
Bill Wendling
1795616930 Merge 'ConstructFunctionDbgScope' and 'ConstructAbstractDbgScope'.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72197 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-20 23:28:48 +00:00
Bill Wendling
995f80ad5f Rename 'New*' methods to 'Create*' to be consistent. 'NewString' isn't used.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72196 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-20 23:24:48 +00:00
Bill Wendling
829e67b5ec Add comment for emit section.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72195 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-20 23:22:40 +00:00
Bill Wendling
94d04b8f80 Move 'Emit' methods down to their own place.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72194 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-20 23:21:38 +00:00
Bill Wendling
f0fb987903 Revert r72192. It was causing a build failure.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72193 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-20 23:19:06 +00:00
Bill Wendling
63ad10c004 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72192 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-20 23:04:56 +00:00
Argyrios Kyrtzidis
a3437647dc Introduce DebugScope which gets embedded into the machine instructions' DebugLoc.
DebugScope refers to a debug region, function or block.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72191 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-20 22:57:17 +00:00
Mike Stump
1d4c738603 Fix cmake builds.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72078 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-19 00:18:14 +00:00
Bill Wendling
1180c7899c Don't set the "location" information for inlined functions' variables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72064 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-18 23:08:55 +00:00
Bill Wendling
cde5d63d90 Small code cleanup.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72057 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-18 22:33:01 +00:00
Bill Wendling
6679ee4e80 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72047 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-18 22:02:36 +00:00
Bill Wendling
0310d768a1 Split out the DwarfDebug module from the DwarfWriter module.
Again, no intendtional functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71854 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-15 09:23:25 +00:00
Bill Wendling
e428e21033 Mark class as hidden.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71850 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-15 06:55:26 +00:00
Bill Wendling
bc0d23afae Move c'tor/d'tor to top of file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71828 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-15 01:18:50 +00:00
Bill Wendling
eb9072195c Split out the DwarfException class into its own file. No functionality change,
though the classes have been marked with "VISIBILITY_HIDDEN".


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71827 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-15 01:12:28 +00:00
Bill Wendling
88423eecd0 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!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71821 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-15 00:11:17 +00:00
Mike Stump
a681515ee6 Tag blocks with DW_AT_APPLE_block.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71784 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-14 18:45:49 +00:00
Bill Wendling
f59d10f1bc 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71746 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-13 23:55:49 +00:00
Bill Wendling
f3cc96e1f3 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71714 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-13 20:33:33 +00:00
Bill Wendling
bc12c2be18 - 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71519 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-12 00:06:59 +00:00
Bill Wendling
a5c8a4e4e6 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71410 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-10 23:14:38 +00:00
Duncan Sands
777d2306b3 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71349 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-09 07:06:46 +00:00
Bill Wendling
e688fafd38 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71263 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-08 21:03:15 +00:00
Bill Wendling
a9519579b7 Minor clean ups. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71256 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-08 20:38:02 +00:00
Dan Gohman
9a38e3e399 Revert 71165. It did more than just revert 71158 and it introduced
several regressions. The problem due to 71158 is now fixed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71176 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-07 19:46:24 +00:00
Bill Wendling
5b8479c385 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....



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71165 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-07 17:26:14 +00:00
Argyrios Kyrtzidis
cd76240f3d Move the tablegen-produced DebugLoc handling into a AsmWriter::processDebugLoc function.
No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71156 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-07 13:55:51 +00:00
Argyrios Kyrtzidis
116b27444a Make DwarfWriter::RecordInlinedFnStart more like the other DwarfWriter's methods:
-Have it return a label ID
-Remove the unused Instruction parameter

No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71132 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-07 00:16:31 +00:00
Bill Wendling
3f500d9358 - Move some debug fields to coincide with how GCC emits them. No functionality
change.
- Reformatting.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71118 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-06 21:21:34 +00:00
Chris Lattner
e3f6cea9e9 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70964 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-05 04:55:56 +00:00
Argyrios Kyrtzidis
28f1412c97 Restore a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70900 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-04 19:23:45 +00:00
Mike Stump
fe095f39e7 Restore minor deletion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70892 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-04 18:40:41 +00:00
Argyrios Kyrtzidis
77eaa6880b -Move the DwarfWriter::ValidDebugInfo check to a static DIDescriptor::ValidDebugInfo
-Create DebugLocs without the need to have a DwarfWriter around


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70682 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-03 08:50:41 +00:00
Bill Wendling
d5a6381195 Simplify more code and add timer stuff.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70539 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-01 08:40:06 +00:00
Bill Wendling
ff86ef33e2 Simplify more code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70537 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-01 08:35:12 +00:00
Bill Wendling
ef956fc784 Simplify some code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70534 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-01 08:32:14 +00:00
Bill Wendling
7fa8162f08 Fix whitespace. It was confusing me.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70533 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-01 08:25:13 +00:00
Argyrios Kyrtzidis
a26eae64dd Make DebugLoc independent of DwarfWriter.
-Replace DebugLocTuple's Source ID with CompileUnit's GlobalVariable*
-Remove DwarfWriter::getOrCreateSourceID
-Make necessary changes for the above (fix callsites, etc.)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70520 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-30 23:22:31 +00:00
Bill Wendling
98a366d547 Instead of passing in an unsigned value for the optimization level, use an enum,
which better identifies what the optimization is doing. And is more flexible for
future uses.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70440 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-29 23:29:43 +00:00
Bill Wendling
be8cc2a3de Second attempt:
Massive check in. This changes the "-fast" flag to "-O#" in llc. If you want to
use the old behavior, the flag is -O0. This change allows for finer-grained
control over which optimizations are run at different -O levels.

Most of this work was pretty mechanical. The majority of the fixes came from
verifying that a "fast" variable wasn't used anymore. The JIT still uses a
"Fast" flag. I'll change the JIT with a follow-up patch.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70343 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-29 00:15:41 +00:00
Sanjiv Gupta
d3d965714b Initialized arrays can be in any address space.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70297 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-28 16:34:20 +00:00
Bill Wendling
c69d56f115 r70270 isn't ready yet. Back this out. Sorry for the noise.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70275 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-28 01:04:53 +00:00
Bill Wendling
2e9d5f912a Massive check in. This changes the "-fast" flag to "-O#" in llc. If you want to
use the old behavior, the flag is -O0. This change allows for finer-grained
control over which optimizations are run at different -O levels.

Most of this work was pretty mechanical. The majority of the fixes came from
verifying that a "fast" variable wasn't used anymore. The JIT still uses a
"Fast" flag. I'm not 100% sure if it's necessary to change it there...


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70270 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-28 00:21:31 +00:00