Commit Graph

92 Commits

Author SHA1 Message Date
Bill Wendling f5f6f74c16 Add comments to function.
llvm-svn: 58781
2008-11-05 23:42:27 +00:00
Bill Wendling 2f40956c68 - Add a "getOrInsertGlobal" method to the Module class. This acts similarly to
"getOrInsertFunction" in that it either adds a new declaration of the global
  and returns it, or returns the current one -- optionally casting it to the
  correct type.
- Use the new getOrInsertGlobal in the stack protector code.
- Use "splitBasicBlock" in the stack protector code.

llvm-svn: 58727
2008-11-04 22:51:24 +00:00
Chris Lattner 0c19df4871 Switch the asmprinter (.ll) and all the stuff it requires over to
use raw_ostream instead of std::ostream.  Among other goodness,
this speeds up llvm-dis of kc++ with a release build from 0.85s
to 0.49s (88% faster).

Other interesting changes:
 1) This makes Value::print be non-virtual.
 2) AP[S]Int and ConstantRange can no longer print to ostream directly, 
    use raw_ostream instead.
 3) This fixes a bug in raw_os_ostream where it didn't flush itself 
    when destroyed.
 4) This adds a new SDNode::print method, instead of only allowing "dump".


A lot of APIs have both std::ostream and raw_ostream versions, it would
be useful to go through and systematically anihilate the std::ostream 
versions.

This passes dejagnu, but there may be minor fallout, plz let me know if
so and I'll fix it.

llvm-svn: 55263
2008-08-23 22:23:09 +00:00
Chris Lattner 42e983e5a9 simplify some code to avoid string thrashing.
llvm-svn: 52837
2008-06-27 21:25:24 +00:00
Chris Lattner e43649fa62 Add a new version of Module::getFunction that takes a const char* instead
of a std::string.  This avoids copying the string to the heap in common
cases.  Patch by Pratik Solanki!

llvm-svn: 52834
2008-06-27 21:09:10 +00:00
Gabor Greif e9ecc68d8f API changes for class Use size reduction, wave 1.
Specifically, introduction of XXX::Create methods
for Users that have a potentially variable number of
Uses.

llvm-svn: 49277
2008-04-06 20:25:17 +00:00
Dan Gohman de66dc88cd Remove an unnecessary #include
llvm-svn: 48193
2008-03-10 23:37:12 +00:00
Dan Gohman 929391a19a Fix 80-col violations.
llvm-svn: 46510
2008-01-29 12:09:55 +00:00
Chris Lattner f3ebc3f3d2 Remove attribution from file headers, per discussion on llvmdev.
llvm-svn: 45418
2007-12-29 20:36:04 +00:00
Christopher Lamb edf0788758 Change the PointerType api for creating pointer types. The old functionality 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-12-17 01:12:55 +00:00
Anton Korobeynikov b18f8f85e9 Implement review feedback. Aliasees can be either GlobalValue's or
bitcasts of them.

llvm-svn: 36537
2007-04-28 13:45:00 +00:00
Anton Korobeynikov a97b694c82 Implement aliases. This fixes PR1017 and it's dependent bugs. CFE part
will follow.

llvm-svn: 36435
2007-04-25 14:27:10 +00:00
Chris Lattner 422cfcdcb3 The (negative) offset from a SymbolTableListTraits-using ilist to its container
object is always constant.  As such, evaluate it at compile time instead of storing
it as an ivar in SymbolTableListTraits.  This shrinks every SymbolTableListTraits
ilist by a word, shrinking BasicBlock from 44->40 bytes, Function from 96->88 bytes,
and Module from 60->52 bytes.

llvm-svn: 36189
2007-04-17 04:04:14 +00:00
Chris Lattner b47aa543bb Refactor SymbolTableListTraits to only have a single pointer in it, instead
of two.  This shrinkifies Function by 8 bytes (104->96) and Module by 8
bytes (68->60).  On a testcase of mine, this reduces the memory used to
read a module header from 565680b to 561024, a little over 4K.

llvm-svn: 36188
2007-04-17 03:26:42 +00:00
Reid Spencer e76289b8ea For PR1146:
Simplify construction of FunctionType to use default arguments.

llvm-svn: 35810
2007-04-09 06:12:07 +00:00
Reid Spencer 1241d6d5ab For PR411:
Adjust to changes in Module interface:
getMainFunction() -> getFunction("main")
getNamedFunction(X) -> getFunction(X)

llvm-svn: 33922
2007-02-05 21:19:13 +00:00
Reid Spencer 3aaaa0b2bd For PR411:
This patch replaces the SymbolTable class with ValueSymbolTable which does
not support types planes. This means that all symbol names in LLVM must now
be unique. The patch addresses the necessary changes to deal with this and
removes code no longer needed as a result. This completes the bulk of the
changes for this PR. Some cleanup patches will follow.

llvm-svn: 33918
2007-02-05 20:47:22 +00:00
Reid Spencer 3f4e6e84dc For PR1163:
Make the Module's dependent library use a std::vector instead of SetVector
adjust #includes in .cpp files because SetVector.h is no longer included.

llvm-svn: 33855
2007-02-04 00:40:42 +00:00
Reid Spencer 5301e7c605 For PR1136: Rename GlobalVariable::isExternal as isDeclaration to avoid
confusion with external linkage types.

llvm-svn: 33663
2007-01-30 20:08:39 +00:00
Reid Spencer 93b2d78121 For PR761:
Remove the setEndianess and setPointerSize methods. These are now
handled via the setDataLayout method.

llvm-svn: 33527
2007-01-26 08:07:57 +00:00
Chris Lattner 505c06b739 Change the interface to Module::getOrInsertFunction to be easier to use,
to resolve PR1088, and to help PR411.

llvm-svn: 32988
2007-01-07 08:09:25 +00:00
Reid Spencer 32af9e8cc5 For PR411:
Take an incremental step towards type plane elimination. This change
separates types from values in the symbol tables by finally making use
of the TypeSymbolTable class. This yields more natural interfaces for
dealing with types and unclutters the SymbolTable class.

llvm-svn: 32956
2007-01-06 07:24:44 +00:00
Reid Spencer 8d9336d065 For PR950:
Change signed integer type names to unsigned equivalents.

llvm-svn: 32780
2006-12-31 05:26:44 +00:00
Bill Wendling 22e978a736 Removing even more <iostream> includes.
llvm-svn: 32320
2006-12-07 20:04:42 +00:00
Reid Spencer 9fef163d19 Make the getNamedFunction and getNamedGlobal methods be const. They don't
change the module in any way and we should enforce that.

llvm-svn: 28588
2006-05-31 16:40:28 +00:00
Owen Anderson 08aecf56e7 Fix some think-o's in my last commit. Thanks to Chris for pointing them out.
llvm-svn: 28380
2006-05-18 05:46:08 +00:00
Owen Anderson 9eb1a268c1 Change Module to use TargetData-compatible strings internally.
This is part of the on-going work on PR 761.

llvm-svn: 28379
2006-05-18 02:10:31 +00:00
Chris Lattner 48a8e09ad0 add a new helper method.
llvm-svn: 26618
2006-03-08 18:39:13 +00:00
Chris Lattner 8bbcda2fda Change inline asms to be uniqued like constants, not embedded in a Module.
llvm-svn: 25610
2006-01-25 18:57:27 +00:00
Chris Lattner eef2fe72c0 Initial checkin of the InlineAsm class
llvm-svn: 25570
2006-01-24 04:13:11 +00:00
Chris Lattner 7d4d93c52c Add a flag to Module::getGlobalVariable to allow it to return vars with
internal linkage.

Patch provided by Evan Jones, thanks!

llvm-svn: 24604
2005-12-05 05:30:21 +00:00
Misha Brukman b1c9317bb4 Remove trailing whitespace
llvm-svn: 21427
2005-04-21 23:48:37 +00:00
Chris Lattner 531f9e92d4 This mega patch converts us from using Function::a{iterator|begin|end} to
using Function::arg_{iterator|begin|end}.  Likewise Module::g* -> Module::global_*.

This patch is contributed by Gabor Greif, thanks!

llvm-svn: 20597
2005-03-15 04:54:21 +00:00
Chris Lattner f6c93e36c7 Improve conformance with the Misha spelling benchmark suite
llvm-svn: 19930
2005-01-30 00:09:23 +00:00
Chris Lattner e5c7b9a215 Adjust to ilist changes.
llvm-svn: 19923
2005-01-29 18:41:12 +00:00
Reid Spencer f27c4cde06 Okay, the list of link-time passes wasn't such a hot idea. Its prone to
error. We'll strategize on this when we have multiple front ends to deal
with. For now llvm-ld just runs a standard set of transforms.

llvm-svn: 16333
2004-09-14 05:43:23 +00:00
Reid Spencer b9e0877223 Add support for the link-time pass list to Modules.
llvm-svn: 16321
2004-09-13 23:44:23 +00:00
Reid Spencer 7c16caa336 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/.

llvm-svn: 16137
2004-09-01 22:55:40 +00:00
Reid Spencer a0b05b399d bug 263:
Ensure the list of libraries is cleared.

llvm-svn: 15212
2004-07-25 18:08:57 +00:00
Reid Spencer 3c4824af7c bug 122:
- Module doesn't need to manage ConstantPointerRefs any more.

llvm-svn: 14931
2004-07-17 23:53:23 +00:00
Reid Spencer f9776c34b6 Replace use of defunct Type::setName method with SymbolTable::insert.
Patch found and provided by Vladimir Merzliakov. Thanks Vladimir!

llvm-svn: 14732
2004-07-10 16:37:42 +00:00
Reid Spencer 8baf8e270a - #include <iostream> since its not in Value.h any more.
llvm-svn: 14617
2004-07-04 11:55:37 +00:00
Reid Spencer abb6f008ca Convert to SymbolTable's new lookup and iteration interfaces.
llvm-svn: 13751
2004-05-25 08:52:20 +00:00
Misha Brukman 3bcead7201 I'm allergic to the word `stuff'.
llvm-svn: 13096
2004-04-21 18:27:56 +00:00
Chris Lattner c3ecaae16c Remove Module::mutateConstantPointerRef, which is now thankfully dead!
This is one small step towards the complete obliteration of
ConstantPointerRef's entirely!! Woot!

llvm-svn: 12216
2004-03-08 06:16:10 +00:00
Chris Lattner 09bd1a06c1 Add some comments, add new getGlobalVariable method
llvm-svn: 10671
2003-12-31 08:43:01 +00:00
Chris Lattner be3596c8ca * Make Module::getTypeName const
* Add new Module::getTypeByName method
* Group methods in Module.cpp better

llvm-svn: 10668
2003-12-31 07:09:33 +00:00
Chris Lattner 189d19fb04 Finegrainify namespacification
llvm-svn: 10131
2003-11-21 20:23:48 +00:00
Brian Gaeke 960707c335 Put all LLVM code into the llvm namespace, as per bug 109.
llvm-svn: 9903
2003-11-11 22:41:34 +00:00
Chris Lattner 41baa98478 Make code gcc 3.4 clean
llvm-svn: 9719
2003-11-05 05:15:42 +00:00