summaryrefslogtreecommitdiffstats
path: root/llvm/lib/VMCore/Globals.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Rename VMCore directory to IR.Chandler Carruth2013-01-021-264/+0
| | | | | | | | | | | | | | | | | | Aside from moving the actual files, this patch only updates the build system and the source file comments under lib/... that are relevant. I'll be updating other docs and other files in smaller subsequnet commits. While I've tried to test this, but it is entirely possible that there will still be some build system fallout. Also, note that I've not changed the library name itself: libLLVMCore.a is still the library name. I'd be interested in others' opinions about whether we should rename this as well (I think we should, just not sure what it might break) llvm-svn: 171359
* Use the new script to sort the includes of every file under lib.Chandler Carruth2012-12-031-3/+4
| | | | | | | | | | | | | | | | | Sooooo many of these had incorrect or strange main module includes. I have manually inspected all of these, and fixed the main module include to be the nearest plausible thing I could find. If you own or care about any of these source files, I encourage you to take some time and check that these edits were sensible. I can't have broken anything (I strictly added headers, and reordered them, never removed), but they may not be the headers you'd really like to identify as containing the API being implemented. Many forward declarations and missing includes were added to a header files to allow them to parse cleanly when included first. The main module rule does in fact have its merits. =] llvm-svn: 169131
* Clean-up after r159077.Hans Wennborg2012-06-231-46/+1
| | | | | | | Remove temporary GlobalVariable constructors now that Clang has been updated (r159078). llvm-svn: 159079
* Extend the IL for selecting TLS models (PR9788)Hans Wennborg2012-06-231-3/+48
| | | | | | | | | | | | | | | This allows the user/front-end to specify a model that is better than what LLVM would choose by default. For example, a variable might be declared as @x = thread_local(initialexec) global i32 42 if it will not be used in a shared library that is dlopen'ed. If the specified model isn't supported by the target, or if LLVM can make a better choice, a different model may be used. llvm-svn: 159077
* Micro-optimisation in getAliasedGlobal.Jay Foad2011-08-011-1/+1
| | | | llvm-svn: 136610
* land David Blaikie's patch to de-constify Type, with a few tweaks.Chris Lattner2011-07-181-3/+3
| | | | llvm-svn: 135375
* Fix GlobalValue::isDeclaration() to always consider aliases to be definitions.Chris Lattner2011-07-141-3/+2
| | | | llvm-svn: 135182
* add comments.Chris Lattner2011-07-141-1/+3
| | | | llvm-svn: 135164
* consolidate GlobalValue::isDeclaration into one Chris Lattner2011-07-141-8/+13
| | | | | | non-virtual function. llvm-svn: 135163
* code cleanupChris Lattner2011-07-141-20/+15
| | | | llvm-svn: 135157
* Land the long talked about "type system rewrite" patch. ThisChris Lattner2011-07-091-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | patch brings numerous advantages to LLVM. One way to look at it is through diffstat: 109 files changed, 3005 insertions(+), 5906 deletions(-) Removing almost 3K lines of code is a good thing. Other advantages include: 1. Value::getType() is a simple load that can be CSE'd, not a mutating union-find operation. 2. Types a uniqued and never move once created, defining away PATypeHolder. 3. Structs can be "named" now, and their name is part of the identity that uniques them. This means that the compiler doesn't merge them structurally which makes the IR much less confusing. 4. Now that there is no way to get a cycle in a type graph without a named struct type, "upreferences" go away. 5. Type refinement is completely gone, which should make LTO much MUCH faster in some common cases with C++ code. 6. Types are now generally immutable, so we can use "Type *" instead "const Type *" everywhere. Downsides of this patch are that it removes some functions from the C API, so people using those will have to upgrade to (not yet added) new API. "LLVM 3.0" is the right time to do this. There are still some cleanups pending after this, this patch is large enough as-is. llvm-svn: 134829
* hoist GlobalValue::removeDeadConstantUsers up to being a method on Constant.Chris Lattner2011-02-181-49/+0
| | | | llvm-svn: 125828
* Make GlobalValue alignment consistent with load, store, and allocaDan Gohman2010-07-281-1/+8
| | | | | | alignment, fixing silent truncation of alignment values. llvm-svn: 109653
* rename use_const_iterator to const_use_iterator for consistency's sakeGabor Greif2010-03-251-2/+2
| | | | llvm-svn: 99564
* A function with no Module owner isn't materializable. This fixes F->dump() forNick Lewycky2010-02-151-2/+2
| | | | | | functions not embedded within modules. llvm-svn: 96272
* Kill ModuleProvider and ghost linkage by inverting the relationship betweenJeffrey Yasskin2010-01-271-0/+13
| | | | | | | | | | | | | | | | | | | | | Modules and ModuleProviders. Because the "ModuleProvider" simply materializes GlobalValues now, and doesn't provide modules, it's renamed to "GVMaterializer". Code that used to need a ModuleProvider to materialize Functions can now materialize the Functions directly. Functions no longer use a magic linkage to record that they're materializable; they simply ask the GVMaterializer. Because the C ABI must never change, we can't remove LLVMModuleProviderRef or the functions that refer to it. Instead, because Module now exposes the same functionality ModuleProvider used to, we store a Module* in any LLVMModuleProviderRef and translate in the wrapper methods. The bindings to other languages still use the ModuleProvider concept. It would probably be worth some time to update them to follow the C++ more closely, but I don't intend to do it. Fixes http://llvm.org/PR5737 and http://llvm.org/PR5735. llvm-svn: 94686
* In GlobalVariable::setInitializer, assert that the initializer has theJeffrey Yasskin2009-11-171-0/+15
| | | | | | right type. llvm-svn: 89014
* remove a bunch of extraneous LLVMContext argumentsChris Lattner2009-11-061-3/+1
| | | | | | from various APIs, addressing PR5325. llvm-svn: 86231
* the verifier shouldn't modify the IR.Chris Lattner2009-11-011-7/+0
| | | | llvm-svn: 85722
* fix an issue where the verifier would reject a function whose entryChris Lattner2009-11-011-0/+8
| | | | | | block had its address taken even if the blockaddress was dead. llvm-svn: 85706
* Move types back to the 2.5 API.Owen Anderson2009-07-291-2/+2
| | | | llvm-svn: 77516
* Finish migrating VMCore to StringRef/Twine based APIs.Daniel Dunbar2009-07-251-1/+1
| | | | llvm-svn: 77051
* Initial update to VMCore to use Twines for string arguments.Daniel Dunbar2009-07-251-2/+2
| | | | | | | - The only meat here is in Value.{h,cpp} the rest is essential 'const std::string &' -> 'const Twine &'. llvm-svn: 77048
* Convert a few more things to use raw_ostream.Dan Gohman2009-07-251-1/+0
| | | | llvm-svn: 77039
* llvm_unreachable->llvm_unreachable(0), LLVM_UNREACHABLE->llvm_unreachable.Torok Edwin2009-07-141-2/+2
| | | | | | | | | 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
* LLVMContext-ification.Owen Anderson2009-07-081-1/+2
| | | | llvm-svn: 75072
* Implement changes from Chris's feedback.Torok Edwin2009-07-081-0/+1
| | | | | | Finish converting lib/Target. llvm-svn: 75043
* Switch GlobalVariable ctors to a sane API, where *either* a context or a ↵Owen Anderson2009-07-081-10/+7
| | | | | | module is required. llvm-svn: 75025
* Start converting to new error handling API.Torok Edwin2009-07-081-3/+3
| | | | | | | cerr+abort -> llvm_report_error assert(0)+abort -> LLVM_UNREACHABLE (assert(0)+llvm_unreachable-> abort() included) llvm-svn: 75018
* Push LLVMContext through GlobalVariables and IRBuilder.Owen Anderson2009-07-081-4/+9
| | | | llvm-svn: 74985
* Revert r73790, and replace it with a significantly less ugly solution. ↵Owen Anderson2009-06-201-1/+1
| | | | | | | | | 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
* Fix a serious bug that would cause deadlock during abstract type refinement. ↵Owen Anderson2009-06-191-1/+1
| | | | | | | | | | 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
* make GlobalValue::removeDeadConstantUsers() const.Chris Lattner2009-03-091-7/+7
| | | | llvm-svn: 66403
* Use mayBeOverridden here, in anticipation of theDuncan Sands2009-01-081-2/+2
| | | | | | day when more linkage types will be handled. llvm-svn: 61944
* Make safer variant of alias resolution routine to be defaultAnton Korobeynikov2008-09-091-3/+3
| | | | llvm-svn: 56005
* Fix typoAnton Korobeynikov2008-09-091-1/+1
| | | | llvm-svn: 55998
* Fix incorrect linker behaviour: we shouldn't resolve weak aliases.Anton Korobeynikov2008-09-091-1/+9
| | | | llvm-svn: 55997
* eliminate calls to deprecated Use::init() interfaceGabor Greif2008-05-261-3/+3
| | | | llvm-svn: 51570
* Factor code to copy global value attributes likeDuncan Sands2008-05-261-1/+20
| | | | | | | | | | | | | | | 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
* merge of use-diet branch to trunkGabor Greif2008-05-101-10/+8
| | | | llvm-svn: 50943
* Slightly increase default set size. It's cheap and won't hurt.Anton Korobeynikov2008-03-221-1/+1
| | | | llvm-svn: 48682
* Add helper for ultimate aliasee resoltionAnton Korobeynikov2008-03-111-0/+16
| | | | llvm-svn: 48255
* Remove attribution from file headers, per discussion on llvmdev.Chris Lattner2007-12-291-2/+2
| | | | llvm-svn: 45418
* Implement address space attribute for LLVM pointer types. Address spaces are Christopher Lamb2007-12-111-4/+6
| | | | | | | | | | | | | | | | | 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
* handle gep aliaseeChris Lattner2007-05-051-3/+4
| | | | llvm-svn: 36815
* Unbreak VC++ build.Jeff Cohen2007-05-031-2/+2
| | | | llvm-svn: 36700
* Fix typo. Interesting, but old variant worked too :)Anton Korobeynikov2007-04-301-1/+1
| | | | llvm-svn: 36588
* Implement review feedbackAnton Korobeynikov2007-04-291-6/+27
| | | | llvm-svn: 36564
* Implement review feedback. Aliasees can be either GlobalValue's orAnton Korobeynikov2007-04-281-7/+14
| | | | | | bitcasts of them. llvm-svn: 36537
* Implement aliases. This fixes PR1017 and it's dependent bugs. CFE partAnton Korobeynikov2007-04-251-1/+44
| | | | | | will follow. llvm-svn: 36435
OpenPOWER on IntegriCloud