Commit Graph

63 Commits

Author SHA1 Message Date
Bill Wendling
2e3def1177 Removed iostream #includes. Replaced std::cerr with DOUT.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31814 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-17 08:03:48 +00:00
Vladimir Prus
cb29bd7fc9 Reset DEBUG_SYMBOL_TABLE back to 0.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28538 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-29 12:54:52 +00:00
Vladimir Prus
6ba568fabb Fix compile error when DEBUG_SYMBOL_TABLE is defined.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28537 91177308-0d34-0410-b5e6-96231b3b80d8
2006-05-29 12:45:15 +00:00
Chris Lattner
306f6fefc9 Fix an iterator invalidation problem in code used by the -strip pass
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24124 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-31 18:42:37 +00:00
Misha Brukman
fd93908ae8 Remove trailing whitespace
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21427 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-21 23:48:37 +00:00
Chris Lattner
f1b4d1dee6 rename insertEntry to insert
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20484 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-06 05:55:40 +00:00
Chris Lattner
e4c872a8fa Merge SymbolTable::removeEntry into SymbolTable::remove, its only caller
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20483 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-06 05:51:09 +00:00
Chris Lattner
c27aa8ddb2 Delete the really inefficient method: void remove(const Type* Typ);
Speed up the symbol stripping code by avoiding a linear search of the
type table.

Get rid of removeEntry(type_iterator), since 'remove' is exactly the same
operation.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20481 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-06 05:46:41 +00:00
Chris Lattner
a98cbe57ea Remove some really gross and hard to understand code now that
InternallyInconsistent is always false.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20477 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-06 05:21:40 +00:00
Chris Lattner
ee4da939b0 Simplify some code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20476 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-06 05:13:42 +00:00
Chris Lattner
921c565888 remove these methods.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20474 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-06 02:37:47 +00:00
Chris Lattner
04cb800c32 This fixes PR531, a crash when running the CBE on a bytecode file.
The problem is that Function::renameLocalSymbols is iterating through
the symbol table planes, occasionally calling setName to rename a value
(which used to do a symbol table remove/insert pair).

The problem is that if there is only a single value in a particular type
plane that the remove will nuke the symbol table plane, and the insert
will create and insert a new one.  This hoses Function::renameLocalSymbols
because it has an iterator to the old plane, under the (very reasonable)
assumption that simply renaming a value won't cause the type plane to
disappear.

This patch fixes the bug by making the rename operation a single atomic
operation, which has a side effect of making the whole thing faster too. :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20469 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-06 02:14:28 +00:00
Chris Lattner
8e1b8473eb 2nd arg to setName goes away.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20460 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-05 19:02:15 +00:00
Chris Lattner
1117bb0e99 Nuke blank line.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20154 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-13 17:54:21 +00:00
Reid Spencer
551ccae044 Changes For Bug 352
Move include/Config and include/Support into include/llvm/Config,
include/llvm/ADT and include/llvm/Support. From here on out, all LLVM
public header files must be under include/llvm/.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16137 91177308-0d34-0410-b5e6-96231b3b80d8
2004-09-01 22:55:40 +00:00
Chris Lattner
1c06891186 Change SymbolTable::insertEntry to be more careful about how many map
lookups it does.  This shaves another 5% off of bcreading 252.eon.  Note that
the proper solution to this problem is to fix PR411, but that will have to
wait until later.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15455 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-04 00:37:31 +00:00
Reid Spencer
ffe77d36eb bug 122:
- Correct isa<Constant> for GlobalValue subclass
- Fix some tabs and indentation.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14932 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-17 23:57:36 +00:00
Reid Spencer
db8e515b43 Constify SymbolTable's use of Type* so that it never modifies them.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14616 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-04 11:55:08 +00:00
Chris Lattner
e1cacce400 Remove unused var
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14033 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-05 00:03:27 +00:00
Reid Spencer
875510805f Made it illegal to pass a Type* through one of the Value* interfaces. The
SymbolTable will now assert if this is done. This didn't find any incorrect
usage of SymbolTable but will prevent future mistakes until Type != Value.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13755 91177308-0d34-0410-b5e6-96231b3b80d8
2004-05-25 15:20:47 +00:00
Reid Spencer
b870c5f7c5 Completely rewrote the class. SymbolTable now separates Type* from Value* in preparation\
for making Type not derive from Value. There are now separate interfaces \
for looking up, finding, and inserting Types and Values. There are also \
three separate iterator interfaces, one for type planes, one for the types \
(type type plane), and one for values within a type plane. See the \
documentation in the Header file.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13752 91177308-0d34-0410-b5e6-96231b3b80d8
2004-05-25 08:52:42 +00:00
Chris Lattner
69284b03d1 Make the lookup method const.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10667 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-31 07:08:19 +00:00
Chris Lattner
31f8499e83 Finegrainify namespacification
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10131 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-21 20:23:48 +00:00
Chris Lattner
7dadaa2785 Fix PR130, and testcase test/Regression/Linker/2003-11-18-TypeResolution.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10075 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-19 01:02:52 +00:00
Brian Gaeke
d0fde30ce8 Put all LLVM code into the llvm namespace, as per bug 109.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9903 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-11 22:41:34 +00:00
Chris Lattner
d5b1245e8c Fix PR95. I'm checking this patch in for Reid Spencer, who figured it out
and wrote it up.  Thanks!!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9832 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-09 19:39:48 +00:00
John Criswell
b576c94c15 Added LLVM project notice to the top of every C++ source file.
Header files will be on the way.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9298 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-20 19:43:21 +00:00
Chris Lattner
cf3056db0f Regularize header file comments
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9071 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-13 03:32:08 +00:00
Chris Lattner
7685ac8d35 This checkin basically amounts to a complete rewrite of the type-resolution
machinery.  This dramatically simplifies how things works, removes irritating
little corner cases, and overall improves speed and reliability.

Highlights of this change are:

1. The exponential algorithm built into the code is now gone.  For example
   the time to disassemble one bytecode file from the mesa benchmark went
   from taking 12.5s to taking 0.16s.
2. The linker bugs should be dramatically reduced.  The one remaining bug
   has to do with constant handling, which I actually introduced in
   "union-find" checkins.
3. The code is much easier to follow, as a result of fewer special cases.
   It's probably also smaller.  yaay.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8842 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-03 18:46:24 +00:00
Misha Brukman
c6315d9b27 Spell `occurrence' correctly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8388 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-08 03:08:43 +00:00
Chris Lattner
c34c13245a This is now unnecessary
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8347 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-04 23:38:22 +00:00
Chris Lattner
ad217a4ca2 Fix bug: Linker/2003-08-28-TypeResolvesGlobal2.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8206 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-29 05:11:34 +00:00
Chris Lattner
652f032ce9 Fix bug: Linker/2003-08-28-TypeResolvesGlobal.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8202 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-29 04:49:54 +00:00
Chris Lattner
949a362802 Remove redundant const qualifiers from cast<> expressions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7253 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-23 15:30:06 +00:00
Chris Lattner
e3d3219f76 Remove using declarations and extraneous #includes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6303 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-22 21:47:17 +00:00
Chris Lattner
197ff79a8c Fix bug: Assembler/2002-12-15-GlobalResolve.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5039 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-15 16:41:52 +00:00
Chris Lattner
8e637a9383 planes is not spelled with an O
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5037 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-15 16:20:23 +00:00
Chris Lattner
0dad6e9c95 - Eliminate SymbolTable::ParentSymTab, ST::localLookup, and
Function::ParentSymTab.  These aren't needed at all.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4186 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-15 21:26:29 +00:00
Chris Lattner
7e70829632 MEGAPATCH checkin.
For details, See: docs/2002-06-25-MegaPatchInfo.txt


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2779 91177308-0d34-0410-b5e6-96231b3b80d8
2002-06-25 16:13:24 +00:00
Chris Lattner
d6b60805e8 We actually need this code for the release build to prevent link errors,
un#ifdef it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2606 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-10 18:54:35 +00:00
Chris Lattner
25d15a7ff7 Remove some gross code by using the Value::dump method to do debug dumps
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2150 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-07 22:33:13 +00:00
Chris Lattner
79df7c0aaa Change references from Method to Function
change references from MethodARgument to FunctionArgument


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1991 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-26 18:01:55 +00:00
Chris Lattner
e82f1c6cb7 * Add new method localLookup
* SymbolTable::remove(Value *N) checks to see if we are internally
  inconsistent before looking for a type plane (caused a crash)
* insertEntry now does a local lookup instead of a global lookup, which was
  causing an infinite loop in the renamer logic.
* Added assertions to make sure stuff stays happy
* Now the linker correctly links the SPECINT2000 mcf benchmark


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1840 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-08 20:26:17 +00:00
Chris Lattner
d71cc4b518 This checkin fixes the bug described in:
test/Regression/Assembler/2002-01-24-BadSymbolTableAssert.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1583 91177308-0d34-0410-b5e6-96231b3b80d8
2002-01-25 03:56:34 +00:00
Chris Lattner
697954c15d Changes to build successfully with GCC 3.02
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1503 91177308-0d34-0410-b5e6-96231b3b80d8
2002-01-20 22:54:45 +00:00
Chris Lattner
e9bb2df410 Rename ConstPoolVal -> Constant
Rename ConstPool*   -> Constant*
Rename ConstPoolVals.h -> ConstantVals.h


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1407 91177308-0d34-0410-b5e6-96231b3b80d8
2001-12-03 22:26:30 +00:00
Chris Lattner
cee8f9ae67 Create a new #include "Support/..." directory structure to move things
from "llvm/Support/..." that are not llvm dependant.

Move files and fix #includes


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1400 91177308-0d34-0410-b5e6-96231b3b80d8
2001-11-27 00:03:19 +00:00
Chris Lattner
c267f7bcc0 If a name conflict occurs when inserting a value, rename it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1346 91177308-0d34-0410-b5e6-96231b3b80d8
2001-11-26 17:01:18 +00:00
Chris Lattner
e244a25014 Fix major bugs in type resolution
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1092 91177308-0d34-0410-b5e6-96231b3b80d8
2001-11-03 03:27:53 +00:00
Chris Lattner
2172ca1bab Remove unnamed prototypes that are created.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@964 91177308-0d34-0410-b5e6-96231b3b80d8
2001-10-23 15:30:18 +00:00