Commit Graph

49 Commits

Author SHA1 Message Date
Owen Anderson 4056ca9568 Move types back to the 2.5 API.
llvm-svn: 77516
2009-07-29 22:17:13 +00:00
Daniel Dunbar d43b86d4a4 Finish migrating VMCore to StringRef/Twine based APIs.
llvm-svn: 77051
2009-07-25 06:02:13 +00:00
Daniel Dunbar 4975db6276 Initial update to VMCore to use Twines for string arguments.
- The only meat here is in Value.{h,cpp} the rest is essential 'const
   std::string &' -> 'const Twine &'.

llvm-svn: 77048
2009-07-25 04:41:11 +00:00
Dan Gohman 1ddf98ad8e Convert a few more things to use raw_ostream.
llvm-svn: 77039
2009-07-25 01:43:01 +00:00
Torok Edwin fbcc663cbf llvm_unreachable->llvm_unreachable(0), LLVM_UNREACHABLE->llvm_unreachable.
This adds location info for all llvm_unreachable calls (which is a macro now) in
!NDEBUG builds.
In NDEBUG builds location info and the message is off (it only prints
"UREACHABLE executed").

llvm-svn: 75640
2009-07-14 16:55:14 +00:00
Owen Anderson 785c56ce1d LLVMContext-ification.
llvm-svn: 75072
2009-07-08 23:50:31 +00:00
Torok Edwin fb8d6d5b58 Implement changes from Chris's feedback.
Finish converting lib/Target.

llvm-svn: 75043
2009-07-08 20:53:28 +00:00
Owen Anderson b17f32945f Switch GlobalVariable ctors to a sane API, where *either* a context or a module is required.
llvm-svn: 75025
2009-07-08 19:03:57 +00:00
Torok Edwin 6dd2730024 Start converting to new error handling API.
cerr+abort -> llvm_report_error
assert(0)+abort -> LLVM_UNREACHABLE (assert(0)+llvm_unreachable-> abort() included)

llvm-svn: 75018
2009-07-08 18:01:40 +00:00
Owen Anderson 5948fdf68b Push LLVMContext through GlobalVariables and IRBuilder.
llvm-svn: 74985
2009-07-08 01:26:06 +00:00
Owen Anderson 0d2de8c35e Revert r73790, and replace it with a significantly less ugly solution. Rather than trying to make the global reader-writer lock work,
create separate recursive mutexes for each value map.  The recursive-ness fixes the double-acquiring issue, which having one per ValueMap
lets us continue to maintain some concurrency.

llvm-svn: 73801
2009-06-20 00:24:58 +00:00
Owen Anderson b07dd959a4 Fix a serious bug that would cause deadlock during abstract type refinement. The constant creation
gets involved, and we end up trying to recursively acquire a writer lock.  The fix for this is slightly horrible,
and involves passing a boolean "locked" parameter around in Constants.cpp, but it's better than having locked and
unlocked versions of most of the code.

llvm-svn: 73790
2009-06-19 23:16:19 +00:00
Chris Lattner 6f884e07c5 make GlobalValue::removeDeadConstantUsers() const.
llvm-svn: 66403
2009-03-09 05:50:45 +00:00
Duncan Sands 715b2897d8 Use mayBeOverridden here, in anticipation of the
day when more linkage types will be handled.

llvm-svn: 61944
2009-01-08 20:55:49 +00:00
Anton Korobeynikov 1a1140429e Make safer variant of alias resolution routine to be default
llvm-svn: 56005
2008-09-09 20:05:04 +00:00
Anton Korobeynikov 4e518041d3 Fix typo
llvm-svn: 55998
2008-09-09 18:24:07 +00:00
Anton Korobeynikov ac2c655808 Fix incorrect linker behaviour: we shouldn't resolve weak aliases.
llvm-svn: 55997
2008-09-09 18:23:48 +00:00
Gabor Greif 2d3024d838 eliminate calls to deprecated Use::init() interface
llvm-svn: 51570
2008-05-26 21:33:52 +00:00
Duncan Sands dd7daee850 Factor code to copy global value attributes like
the section or the visibility from one global
value to another: copyAttributesFrom.  This is
particularly useful for duplicating functions:
previously this was done by explicitly copying
each attribute in turn at each place where a
new function was created out of an old one, with
the result that obscure attributes were regularly
forgotten (like the collector or the section).
Hopefully now everything is uniform and nothing
is forgotten.

llvm-svn: 51567
2008-05-26 19:58:59 +00:00
Gabor Greif f6caff66a1 merge of use-diet branch to trunk
llvm-svn: 50943
2008-05-10 08:32:32 +00:00
Anton Korobeynikov 2fb3897f1b Slightly increase default set size. It's cheap and won't hurt.
llvm-svn: 48682
2008-03-22 07:48:40 +00:00
Anton Korobeynikov da7db7d9a1 Add helper for ultimate aliasee resoltion
llvm-svn: 48255
2008-03-11 22:28:56 +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 54dd24c2a7 Implement address space attribute for LLVM pointer types. Address spaces are
regions of memory that have a target specific relationship, as described in the 
Embedded C Technical Report. 

This also implements the 2007-12-11-AddressSpaces test, 
which demonstrates how address space attributes can be used in LLVM IR.

In addition, this patch changes the bitcode signature for stores (in a backwards 
compatible manner), such that the pointer type, rather than the pointee type, is 
encoded. This permits type information in the pointer (e.g. address space) to be 
preserved for stores.

LangRef updates are forthcoming.

llvm-svn: 44858
2007-12-11 08:59:05 +00:00
Chris Lattner c2d0530030 handle gep aliasee
llvm-svn: 36815
2007-05-05 23:49:02 +00:00
Jeff Cohen ee7bf76342 Unbreak VC++ build.
llvm-svn: 36700
2007-05-03 22:09:21 +00:00
Anton Korobeynikov a30bc8fccf Fix typo. Interesting, but old variant worked too :)
llvm-svn: 36588
2007-04-30 10:28:40 +00:00
Anton Korobeynikov 546ea7ea88 Implement review feedback
llvm-svn: 36564
2007-04-29 18:02:48 +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
Lauro Ramos Venancio 749e4668e7 Implement the "thread_local" keyword.
llvm-svn: 35950
2007-04-12 18:32:50 +00:00
Chris Lattner dd89d9c648 reapply my previous patch with a bugfix.
llvm-svn: 34627
2007-02-26 05:02:39 +00:00
Chris Lattner b5359f0994 revert my previous change, something strange is happening.
llvm-svn: 34626
2007-02-26 04:43:19 +00:00
Chris Lattner 76ac8f82bd Rework GlobalValue::removeDeadConstantUsers to always remove dead constant
exprs hanging off a global, even if the global is not otherwise dead.  This
requires some tricky iterator gymnastics.

This implements Transforms/GlobalOpt/constantexpr-dangle.ll by deleting a
constantexpr that made it appear that the address of the function was taken.

llvm-svn: 34608
2007-02-25 21:06: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
Chris Lattner 87732cfb71 Add a version of the globalvariable ctor that inserts at a specific location.
llvm-svn: 30677
2006-09-30 21:31:26 +00:00
Chris Lattner eef2fe72c0 Initial checkin of the InlineAsm class
llvm-svn: 25570
2006-01-24 04:13:11 +00:00
Chris Lattner 7a1450dbc6 Change the signature of replaceUsesOfWithOnConstant. The bool was always
true dynamically.  Finally, pass the Use* that replaceAllUsesWith has into
the method for future use.

llvm-svn: 23626
2005-10-04 18:13:04 +00:00
Misha Brukman b1c9317bb4 Remove trailing whitespace
llvm-svn: 21427
2005-04-21 23:48:37 +00:00
Chris Lattner cdb9bfc150 remove all of the various setName implementations, consolidating them into
Value::setName, which is no longer virtual.

llvm-svn: 20464
2005-03-05 19:51:50 +00:00
Chris Lattner ed2fb1cf93 Remove the 2nd argument to Value::setName
llvm-svn: 20458
2005-03-05 19:01:49 +00:00
Chris Lattner 5d1bc2c408 Adjust to changes in User class.
llvm-svn: 19892
2005-01-29 00:35:33 +00:00
Chris Lattner 02a71e7748 Implement remove/eraseFromParent methods
llvm-svn: 16922
2004-10-11 22:21:39 +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
Alkis Evlogimenos f45cc7a56e Make GlobalVariable constructor assert when an initializer is of
incorrect type.

llvm-svn: 15519
2004-08-05 11:28:34 +00:00
Chris Lattner 37b570a049 Add a cast
llvm-svn: 15457
2004-08-04 02:27:17 +00:00
Chris Lattner 2730e6aef1 Method now returns null, dtor is inlined
llvm-svn: 14983
2004-07-19 00:55:35 +00:00
Chris Lattner 0145eb7835 Fix infinite loop gccld'ing povray
llvm-svn: 14962
2004-07-18 08:12:57 +00:00
Reid Spencer 3d169b1c0d bug 122:
- Move these functions from other places
- Provide implementations of Constant class overrides in GlobalValue

llvm-svn: 14936
2004-07-18 00:06:26 +00:00