summaryrefslogtreecommitdiff
path: root/include/llvm/Module.h
Commit message (Collapse)AuthorAge
* Remove the last improper use of getGlobalContext() from LLVM.Nick Lewycky2011-08-13
| | | | | | | | | | | | | This caused a race condition where a thread calls ~LLVMContextImpl which calls Module::dropAllReferences which calls begin() on an empty ilist that would create the sentinel, which racily accesses the global context. This can not be fixed by locking inside createSentinel because the lock would need to be shared with all users of the global context, including those that reside outside LLVM's own code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137546 91177308-0d34-0410-b5e6-96231b3b80d8
* land David Blaikie's patch to de-constify Type, with a few tweaks.Chris Lattner2011-07-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135375 91177308-0d34-0410-b5e6-96231b3b80d8
* Land the long talked about "type system rewrite" patch. ThisChris Lattner2011-07-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134829 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix typo in doxy-comment.Nick Lewycky2011-04-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129028 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a special streamer to libLTO that just records symbols definitions andRafael Espindola2011-03-02
| | | | | | | | | | | uses. The result produced by the streamer is used to give the linker more accurate information and to add to llvm.compiler.used. The second improvement removes the need for the user to add __attribute__((used)) to functions only used in inline asm. The first one lets us build firefox with LTO on Darwin :-) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126830 91177308-0d34-0410-b5e6-96231b3b80d8
* Merge System into Support.Michael J. Spencer2010-11-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120298 91177308-0d34-0410-b5e6-96231b3b80d8
* Warnings patrol.Eric Christopher2010-07-22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109174 91177308-0d34-0410-b5e6-96231b3b80d8
* Make NamedMDNode not be a subclass of Value, and simplify the interfaceDan Gohman2010-07-21
| | | | | | | for creating and populating NamedMDNodes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109061 91177308-0d34-0410-b5e6-96231b3b80d8
* Delete an obsolete comment.Dan Gohman2010-07-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109017 91177308-0d34-0410-b5e6-96231b3b80d8
* 80-column and trailing whitespace cleanupJim Grosbach2010-06-25
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106885 91177308-0d34-0410-b5e6-96231b3b80d8
* Use single interface, using twine, to get named metadata.Devang Patel2010-06-22
| | | | | | | getNamedMetadata(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106518 91177308-0d34-0410-b5e6-96231b3b80d8
* Use separate named MDNode to hold each function's local variable info.Devang Patel2010-06-16
| | | | | | | This speeds up local variable handling in DwarfDebug. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106075 91177308-0d34-0410-b5e6-96231b3b80d8
* Kill ModuleProvider and ghost linkage by inverting the relationship betweenJeffrey Yasskin2010-01-27
| | | | | | | | | | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94686 91177308-0d34-0410-b5e6-96231b3b80d8
* Tweak the way appendModuleInlineAsm works, so you aren't obligedDuncan Sands2010-01-26
| | | | | | | | | | to append a newline when using setModuleInlineAsm in case later someone calls appendModuleInlineAsm - make newline handling fully automatic. In case anyone is wondering there is only one user of appendModuleInlineAsm: the dragonegg plugin. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94539 91177308-0d34-0410-b5e6-96231b3b80d8
* Use ilist_tratis to autoinsert and remove NamedMDNode from MDSymbolTable.Devang Patel2010-01-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93247 91177308-0d34-0410-b5e6-96231b3b80d8
* Use separate namespace for named metadata.Devang Patel2010-01-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92931 91177308-0d34-0410-b5e6-96231b3b80d8
* Final step in the metadata API restructuring: move the Chris Lattner2009-12-29
| | | | | | | | | | getMDKindID/getMDKindNames methods to LLVMContext (and add convenience methods to Module), eliminating MetadataContext. Move the state that it maintains out to LLVMContext. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92259 91177308-0d34-0410-b5e6-96231b3b80d8
* just cleanup.Chris Lattner2009-12-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92258 91177308-0d34-0410-b5e6-96231b3b80d8
* Pass StringRef by value.Daniel Dunbar2009-11-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86251 91177308-0d34-0410-b5e6-96231b3b80d8
* Added a comment to a function that had noneKenneth Uildriks2009-11-03
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85899 91177308-0d34-0410-b5e6-96231b3b80d8
* Move DataTypes.h to include/llvm/System, update all users. This breaks the lastChandler Carruth2009-10-26
| | | | | | | direct inclusion edge from System to Support. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85086 91177308-0d34-0410-b5e6-96231b3b80d8
* remove the std::ostream version of module and type printing.Chris Lattner2009-08-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79823 91177308-0d34-0410-b5e6-96231b3b80d8
* Make LLVMContext and LLVMContextImpl classes instead of structs.Benjamin Kramer2009-08-11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78690 91177308-0d34-0410-b5e6-96231b3b80d8
* Align comments.Devang Patel2009-08-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78605 91177308-0d34-0410-b5e6-96231b3b80d8
* Factor some of the constants+context related code out into a separate ↵Owen Anderson2009-08-04
| | | | | | | | | header, to make LLVMContextImpl.h not hideous. Also, fix some MSVC compile errors. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78115 91177308-0d34-0410-b5e6-96231b3b80d8
* Add getOrInsertNamedMetadata().Devang Patel2009-07-30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77646 91177308-0d34-0410-b5e6-96231b3b80d8
* Keep track of named mdnodes in a Module using an ilist.Devang Patel2009-07-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77476 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix comment.Devang Patel2009-07-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77457 91177308-0d34-0410-b5e6-96231b3b80d8
* Finish migrating VMCore to StringRef/Twine based APIs.Daniel Dunbar2009-07-25
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77051 91177308-0d34-0410-b5e6-96231b3b80d8
* Make the use of const with respect to LLVMContext sane. Hopefully this is ↵Owen Anderson2009-07-01
| | | | | | | | | the last time, for the moment, that I will need to make far-reaching changes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74655 91177308-0d34-0410-b5e6-96231b3b80d8
* Hold the LLVMContext by reference rather than by pointer.Owen Anderson2009-07-01
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74640 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a pointer to the owning LLVMContext to Module. This requires threading ↵Owen Anderson2009-07-01
| | | | | | | | | | | LLVMContext through a lot of the bitcode reader and ASM parser APIs, as well as supporting it in all of the tools. Patches for Clang and LLVM-GCC to follow. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74614 91177308-0d34-0410-b5e6-96231b3b80d8
* "ghostify" the ilist<Function> sentinelGabor Greif2009-03-27
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67872 91177308-0d34-0410-b5e6-96231b3b80d8
* simplify the way how traits get hold of the symbol tableGabor Greif2009-03-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66336 91177308-0d34-0410-b5e6-96231b3b80d8
* further simplifications arising from peruse of the more declarative interfaceGabor Greif2009-03-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66333 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove the burden of dealing with list offsetsGabor Greif2009-03-07
| | | | | | | | | from SymbolTableListTraits' clients, and intead request a nice declarative interface. Cleans up an IMHO ugly wart. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66331 91177308-0d34-0410-b5e6-96231b3b80d8
* Add Module::getNamedValue; use to normalize access to Module symbolDaniel Dunbar2009-03-06
| | | | | | | | table. - No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66289 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a bunch of Doxygen syntax issues. Escape special characters,Dan Gohman2009-03-03
| | | | | | | and put @file directives on their own comment line. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65920 91177308-0d34-0410-b5e6-96231b3b80d8
* Reapply 63765. Patches for clang and llvm-gcc to follow.Dale Johannesen2009-02-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63812 91177308-0d34-0410-b5e6-96231b3b80d8
* Reverting 63765. This broke the build of both clangDale Johannesen2009-02-04
| | | | | | | | and llvm-gcc. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63786 91177308-0d34-0410-b5e6-96231b3b80d8
* New feature: add support for target intrinsics being defined in theNate Begeman2009-02-04
| | | | | | | | | | target directories themselves. This also means that VMCore no longer needs to know about every target's list of intrinsics. Future work will include converting the PowerPC target to this interface as an example implementation. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63765 91177308-0d34-0410-b5e6-96231b3b80d8
* Add the private linkage.Rafael Espindola2009-01-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62279 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a mechanism to specify attributes in getOrInsertFunction.Nick Lewycky2009-01-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61645 91177308-0d34-0410-b5e6-96231b3b80d8
* - Add a "getOrInsertGlobal" method to the Module class. This acts similarly toBill Wendling2008-11-04
| | | | | | | | | | | | "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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58727 91177308-0d34-0410-b5e6-96231b3b80d8
* Switch the asmprinter (.ll) and all the stuff it requires over toChris Lattner2008-08-23
| | | | | | | | | | | | | | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55263 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a new version of Module::getFunction that takes a const char* insteadChris Lattner2008-06-27
| | | | | | | | of a std::string. This avoids copying the string to the heap in common cases. Patch by Pratik Solanki! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52834 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix comment.Eric Christopher2008-04-16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49813 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't attribute in file headers anymore. See llvmdev for theChris Lattner2007-12-29
| | | | | | | | discussion of this change. Boy are my fingers tired. ;-) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45411 91177308-0d34-0410-b5e6-96231b3b80d8
* Fixing an comment in Module.h that refers to a nonexistent parameter.Gordon Henriksen2007-09-18
| | | | | | Also adding some missing svn:ignores that've been bothering me. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42076 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a convenince member function for appending strings to a module'sDan Gohman2007-06-26
| | | | | | | module-level asm string data. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37726 91177308-0d34-0410-b5e6-96231b3b80d8