Commit Graph

459 Commits

Author SHA1 Message Date
Zhou Sheng e93db8fba2 Eliminates friend function declaration inside APInt, instead, adds public
methods as those global function's internal implementation.

llvm-svn: 34083
2007-02-09 07:48:24 +00:00
Chris Lattner 751a42010b Rename CStringMap -> StringMap, since it now supports nul characters in the
strings.

llvm-svn: 34064
2007-02-08 19:20:57 +00:00
Chris Lattner 259ba20bd8 Allow cstringmap to contain strings with nul characters in them.
llvm-svn: 34062
2007-02-08 19:08:37 +00:00
Zhou Sheng 11eea86410 Switched this file on accidently.
llvm-svn: 34054
2007-02-08 16:45:48 +00:00
Zhou Sheng fbf61eaba7 As Chris and Reid suggested, remove "isSigned" field from APInt, instead,
add some signed/unsigned arithmetic operation functions into APInt.h to
handle the signed/unsigned issue. These functions will be defined inside a
namespace "APIntOps" which is inside llvm namespace.

llvm-svn: 34053
2007-02-08 14:35:19 +00:00
Zhou Sheng 3e8022d61d As Chris suggested, fixed some problems. (This is the first part)
llvm-svn: 33989
2007-02-07 06:14:53 +00:00
Chris Lattner e346767f06 do not let the table fill up with tombstones.
llvm-svn: 33973
2007-02-07 01:11:25 +00:00
Zhou Sheng 94b623aad4 As Reid suggested, fixed some problems.
llvm-svn: 33955
2007-02-06 06:04:53 +00:00
Chris Lattner 28cbd1d624 Disable this for now.
llvm-svn: 33953
2007-02-06 05:38:37 +00:00
Zhou Sheng dac63788ab Add a class APInt to represent arbitrary precision constant integral values.
It is a functional replacement for common case integer type like "unsigned",
"uint64_t", but also allows non-byte-width integer type and large integer
value types such as 3-bits, 15-bits, or more than 64-bits of precision. For
more details, see pr1043.

llvm-svn: 33951
2007-02-06 03:00:16 +00:00
Chris Lattner 92c5d1185f Fix a bug in smallptrset::erase: in the small case, return true if the
element was in the set.

llvm-svn: 33931
2007-02-05 23:10:31 +00:00
Chris Lattner 010ee96261 Encode small integers more densely in foldingset, avoiding overflowing the SmallVector as often.
llvm-svn: 33864
2007-02-04 01:48:10 +00:00
Chris Lattner 4f5cdecde3 improve comments, add an assertion
llvm-svn: 33750
2007-02-01 05:33:21 +00:00
Devang Patel 9eb2caaeb6 Add PrintVersionMessage() that tools can use to print version number
without exiting program.

llvm-svn: 33737
2007-02-01 01:43:37 +00:00
Reid Spencer e7422f6b8d Add some debug output.
llvm-svn: 33718
2007-01-31 21:27:38 +00:00
Chris Lattner 0dbb13735e minor cleanups. Fix off-by-one in accounting the number of nodes when the
table grows.

llvm-svn: 33698
2007-01-31 06:04:41 +00:00
Chris Lattner a94523df7b reformat comment
llvm-svn: 33675
2007-01-30 23:16:22 +00:00
Chris Lattner 39ab70cf80 implement SmallPtrSet::erase
llvm-svn: 33581
2007-01-27 07:59:10 +00:00
Chris Lattner ab5d0ba168 add a note
llvm-svn: 33578
2007-01-27 07:18:32 +00:00
Chris Lattner 74102df857 Add a new SmallSet ADT specialized for pointers.
llvm-svn: 33577
2007-01-27 07:10:46 +00:00
Anton Korobeynikov a41d9eca96 Moved disassembler to libSystem
llvm-svn: 33461
2007-01-23 10:26:08 +00:00
Anton Korobeynikov 3e956974b3 Adding disassembler interface and external hook to udis86 library.
llvm-svn: 33358
2007-01-19 17:25:17 +00:00
Chris Lattner dff39e53f1 wow, the link was already broken :)
llvm-svn: 32963
2007-01-06 23:20:51 +00:00
Chris Lattner 8a7183b5b8 add a note
llvm-svn: 32962
2007-01-06 23:19:38 +00:00
Bill Wendling 4ec17c3951 The previous implementation of LLVM Streams wasn't removing symbols. This
one should.

llvm-svn: 32845
2007-01-03 22:37:27 +00:00
Chris Lattner 00bb216977 eliminate constructor from Statistic class. It is now impossible to get a
static constructor for them :).   Transition complete.

llvm-svn: 32710
2006-12-19 23:17:40 +00:00
Chris Lattner 13bfd32f5d Refactor statistic a big and introduce a horrible-but-necessary macro
(STATISTIC), which allows us to define statistics that don't introduce
static ctors into the .o files.  I'm migrating code over to use this
incrementally.

llvm-svn: 32687
2006-12-19 21:27:47 +00:00
Bill Wendling a77f14265b Added an automatic cast to "std::ostream*" etc. from OStream. We then can
rework the hacks that had us passing OStream in. We pass in std::ostream*
instead, check for null, and then dispatch to the correct print() method.

llvm-svn: 32636
2006-12-17 05:15:13 +00:00
Chris Lattner 8c9969ac03 Change the implementation of statistic to not need destructors at all.
Instead, the stat info is printed when llvm_shutdown() is called.
These also don't need static ctors, but getting rid of them is uglier:
still investigating.  This reduces the number of static dtors in llvm from
~1400 to ~750.

llvm-svn: 32372
2006-12-08 20:00:42 +00:00
Bill Wendling 30c0f3367c Don't use <sstream> in Streams.h but <iosfwd> instead.
llvm-svn: 32340
2006-12-07 23:41:45 +00:00
Bill Wendling 355fc5ad50 Removed more <iostream> includes
llvm-svn: 32321
2006-12-07 20:28:15 +00:00
Bill Wendling f3baad3ee1 Changed llvm_ostream et all to OStream. llvm_cerr, llvm_cout, llvm_null, are
now cerr, cout, and NullStream resp.

llvm-svn: 32298
2006-12-07 01:30:32 +00:00
Chris Lattner 5bbf770764 merge the Statistic and StatisticBase classes, eliminating virtual methods
and eliminating #includes from the Statistic.h file.

llvm-svn: 32282
2006-12-06 18:20:44 +00:00
Chris Lattner 700b873130 Detemplatize the Statistic class. The only type it is instantiated with
is 'unsigned'.

llvm-svn: 32279
2006-12-06 17:46:33 +00:00
Chris Lattner 228bcd3802 Add a helper function
llvm-svn: 31981
2006-11-28 22:32:35 +00:00
Bill Wendling 3750ae25a0 Removed #include <iostream> and replace with llvm_* streams.
llvm-svn: 31927
2006-11-26 10:52:51 +00:00
Reid Spencer aa5c220665 Make the absolute/relative tolerance information easier to read/understand.
llvm-svn: 31908
2006-11-25 08:38:44 +00:00
Bill Wendling 9594f3a196 Moved definition of llvm_ostream wrappers to the Streams.cpp file.
llvm-svn: 31819
2006-11-17 09:54:47 +00:00
Bill Wendling 3315869498 Added wrappers for the std::cerr/std::cout objects. The wrappers will
soon replace all uses of those objects.

llvm-svn: 31817
2006-11-17 09:51:22 +00:00
Bill Wendling d7fda04420 Added "DOUT" macro. This is used as a replacement for the std::cerr
stream. It centralizes the use of std::cerr so that static c'tor/d'tors
aren't scattered around all over the place. The way to use it is like this:

       DOUT << "This is a status line: " << Var << "\n";

If "-debug" is specified, it will print. Otherwise, it'll not print. If
NDEBUG is defined, the DOUT does nothing.

llvm-svn: 31798
2006-11-17 00:49:12 +00:00
Jim Laskey 61feeb90f9 Remove redundant <cmath>.
llvm-svn: 31561
2006-11-08 19:16:44 +00:00
John Criswell 8ea2e68493 Include llvm/Support/DataTypes.h to define intptr_t.
This fixes the build on OpenBSD and potentially other systems.

llvm-svn: 31550
2006-11-08 15:04:35 +00:00
Rafael Espindola f16dbf697a assert.h -> cassert
llvm-svn: 31399
2006-11-03 01:38:14 +00:00
Rafael Espindola a1fde82b6b #include <assert.h>
llvm-svn: 31386
2006-11-02 23:48:53 +00:00
Jim Laskey eb0fd251c1 Allow FoldingSet clients to pump up the initial hash size.
llvm-svn: 31377
2006-11-02 14:21:26 +00:00
Chris Lattner 149e666baf add a highly efficient hash table that is specialized for mapping C strings
to some other type.

llvm-svn: 31286
2006-10-29 23:42:03 +00:00
Chris Lattner b9de90377f Add a new llvm::Allocator abstraction, which will be used by a container
I'm about to add.  This is similar to, but necessarily different than, the
STL allocator class.

llvm-svn: 31285
2006-10-29 22:08:03 +00:00
Jim Laskey 179ebd3fc3 Try again.
llvm-svn: 31278
2006-10-29 09:19:59 +00:00
Jim Laskey 8f05a611e9 Not handling zero length strings.
llvm-svn: 31277
2006-10-29 08:27:07 +00:00
Jim Laskey cef515fcc0 SmallVector append not insert.
llvm-svn: 31224
2006-10-27 19:38:32 +00:00