summaryrefslogtreecommitdiffstats
path: root/llvm/lib/VMCore/Module.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Remove the last improper use of getGlobalContext() from LLVM.Nick Lewycky2011-08-131-18/+1
| | | | | | | | | | | | 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. llvm-svn: 137546
* move tier out of an anonymous namespace, it doesn't make senseChris Lattner2011-07-211-6/+9
| | | | | | | | to for it to be an an anon namespace and be in a header. Eliminate some extraenous uses of tie. llvm-svn: 135669
* land David Blaikie's patch to de-constify Type, with a few tweaks.Chris Lattner2011-07-181-7/+7
| | | | llvm-svn: 135375
* DebugLoc's don't hide any interesting types for TypeFinder to find.Chris Lattner2011-07-141-1/+1
| | | | llvm-svn: 135174
* Second attempt at de-constifying LLVM Types in FunctionType::get(),Jay Foad2011-07-121-4/+4
| | | | | | StructType::get() and TargetData::getIntPtrType(). llvm-svn: 134982
* Revert r134893 and r134888 (and related patches in other trees). It was causingBill Wendling2011-07-121-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | an assert on Darwin llvm-gcc builds. Assertion failed: (castIsValid(op, S, Ty) && "Invalid cast!"), function Create, file /Users/buildslave/zorg/buildbot/smooshlab/slave-0.8/build.llvm-gcc-i386-darwin9-RA/llvm.src/lib/VMCore/Instructions.cpp, li\ ne 2067. etc. http://smooshlab.apple.com:8013/builders/llvm-gcc-i386-darwin9-RA/builds/2354 --- Reverse-merging r134893 into '.': U include/llvm/Target/TargetData.h U include/llvm/DerivedTypes.h U tools/bugpoint/ExtractFunction.cpp U unittests/Support/TypeBuilderTest.cpp U lib/Target/ARM/ARMGlobalMerge.cpp U lib/Target/TargetData.cpp U lib/VMCore/Constants.cpp U lib/VMCore/Type.cpp U lib/VMCore/Core.cpp U lib/Transforms/Utils/CodeExtractor.cpp U lib/Transforms/Instrumentation/ProfilingUtils.cpp U lib/Transforms/IPO/DeadArgumentElimination.cpp U lib/CodeGen/SjLjEHPrepare.cpp --- Reverse-merging r134888 into '.': G include/llvm/DerivedTypes.h U include/llvm/Support/TypeBuilder.h U include/llvm/Intrinsics.h U unittests/Analysis/ScalarEvolutionTest.cpp U unittests/ExecutionEngine/JIT/JITTest.cpp U unittests/ExecutionEngine/JIT/JITMemoryManagerTest.cpp U unittests/VMCore/PassManagerTest.cpp G unittests/Support/TypeBuilderTest.cpp U lib/Target/MBlaze/MBlazeIntrinsicInfo.cpp U lib/Target/Blackfin/BlackfinIntrinsicInfo.cpp U lib/VMCore/IRBuilder.cpp G lib/VMCore/Type.cpp U lib/VMCore/Function.cpp G lib/VMCore/Core.cpp U lib/VMCore/Module.cpp U lib/AsmParser/LLParser.cpp U lib/Transforms/Utils/CloneFunction.cpp G lib/Transforms/Utils/CodeExtractor.cpp U lib/Transforms/Utils/InlineFunction.cpp U lib/Transforms/Instrumentation/GCOVProfiling.cpp U lib/Transforms/Scalar/ObjCARC.cpp U lib/Transforms/Scalar/SimplifyLibCalls.cpp U lib/Transforms/Scalar/MemCpyOptimizer.cpp G lib/Transforms/IPO/DeadArgumentElimination.cpp U lib/Transforms/IPO/ArgumentPromotion.cpp U lib/Transforms/InstCombine/InstCombineCompares.cpp U lib/Transforms/InstCombine/InstCombineAndOrXor.cpp U lib/Transforms/InstCombine/InstCombineCalls.cpp U lib/CodeGen/DwarfEHPrepare.cpp U lib/CodeGen/IntrinsicLowering.cpp U lib/Bitcode/Reader/BitcodeReader.cpp llvm-svn: 134949
* De-constify Types in FunctionType::get().Jay Foad2011-07-111-4/+4
| | | | llvm-svn: 134888
* Land the long talked about "type system rewrite" patch. ThisChris Lattner2011-07-091-49/+129
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Clarify the ownership model of LLVMContext and Module. Namely, contexts ownOwen Anderson2010-09-081-0/+2
| | | | | | | modules are instantiated in them. If the context is deleted, all of its owned modules are also deleted. llvm-svn: 113374
* Eliminate unnecessary empty string literals.Dan Gohman2010-08-041-1/+1
| | | | llvm-svn: 110183
* Make NamedMDNode not be a subclass of Value, and simplify the interfaceDan Gohman2010-07-211-6/+15
| | | | | | for creating and populating NamedMDNodes. llvm-svn: 109061
* Use single interface, using twine, to get named metadata.Devang Patel2010-06-221-5/+1
| | | | | | getNamedMetadata(). llvm-svn: 106518
* Tidy.Bob Wilson2010-06-191-2/+2
| | | | llvm-svn: 106383
* Use separate named MDNode to hold each function's local variable info.Devang Patel2010-06-161-0/+7
| | | | | | This speeds up local variable handling in DwarfDebug. llvm-svn: 106075
* fix an infinite loop in Module::getEndianness, PR6684Chris Lattner2010-03-231-1/+1
| | | | | | patch by Alex Mac! llvm-svn: 99330
* Kill ModuleProvider and ghost linkage by inverting the relationship betweenJeffrey Yasskin2010-01-271-1/+48
| | | | | | | | | | | | | | | | | | | | | 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
* Use ilist_tratis to autoinsert and remove NamedMDNode from MDSymbolTable.Devang Patel2010-01-121-6/+0
| | | | llvm-svn: 93247
* Reimplement getToken and SplitString as "StringRef helper functions"Benjamin Kramer2010-01-111-7/+10
| | | | | | | | | - getToken is modeled after StringRef::split but it can split on multiple separator chars and skips leading seperators. - SplitString is a StringRef::split variant for more than 2 elements with the same behaviour as getToken. llvm-svn: 93161
* Delete NamedMDSymTable while destrucing Module.Devang Patel2010-01-091-0/+1
| | | | | | Disable copy ctor and operator= for NamedMDSymTable. Hide typedef that should be public. llvm-svn: 93041
* Use separate namespace for named metadata.Devang Patel2010-01-071-3/+9
| | | | llvm-svn: 92931
* Final step in the metadata API restructuring: move the Chris Lattner2009-12-291-0/+14
| | | | | | | | getMDKindID/getMDKindNames methods to LLVMContext (and add convenience methods to Module), eliminating MetadataContext. Move the state that it maintains out to LLVMContext. llvm-svn: 92259
* Qualify a bunch of explicit template instantiations to satisfy clang++.John McCall2009-12-191-3/+3
| | | | llvm-svn: 91736
* Pass StringRef by value.Daniel Dunbar2009-11-061-17/+17
| | | | llvm-svn: 86251
* remove a bunch of extraneous LLVMContext argumentsChris Lattner2009-11-061-2/+1
| | | | | | from various APIs, addressing PR5325. llvm-svn: 86231
* Push LLVMContexts through the IntegerType APIs.Owen Anderson2009-08-131-3/+4
| | | | llvm-svn: 78948
* Add getOrInsertNamedMetadata().Devang Patel2009-07-301-3/+14
| | | | llvm-svn: 77646
* Do not use getNamedValue() to lookup NamedMDNode. NamedMDNode is not a ↵Devang Patel2009-07-301-1/+1
| | | | | | | | GlobalValue. Thanks Benjamin Kramer! llvm-svn: 77619
* Move types back to the 2.5 API.Owen Anderson2009-07-291-6/+6
| | | | llvm-svn: 77516
* Move ConstantExpr to 2.5 API.Owen Anderson2009-07-291-2/+2
| | | | llvm-svn: 77494
* Keep track of named mdnodes in a Module using an ilist.Devang Patel2009-07-291-0/+8
| | | | llvm-svn: 77476
* Finish migrating VMCore to StringRef/Twine based APIs.Daniel Dunbar2009-07-251-25/+16
| | | | llvm-svn: 77051
* Switch ValueSymbolTable to StringRef based API.Daniel Dunbar2009-07-231-1/+1
| | | | llvm-svn: 76894
* LLVMContext-ification.Owen Anderson2009-07-081-6/+8
| | | | llvm-svn: 75072
* Switch GlobalVariable ctors to a sane API, where *either* a context or a ↵Owen Anderson2009-07-081-10/+6
| | | | | | module is required. llvm-svn: 75025
* Push LLVMContext through GlobalVariables and IRBuilder.Owen Anderson2009-07-081-3/+7
| | | | llvm-svn: 74985
* Make the use of const with respect to LLVMContext sane. Hopefully this is ↵Owen Anderson2009-07-011-1/+1
| | | | | | | | the last time, for the moment, that I will need to make far-reaching changes. llvm-svn: 74655
* Hold the LLVMContext by reference rather than by pointer.Owen Anderson2009-07-011-1/+1
| | | | llvm-svn: 74640
* Add a pointer to the owning LLVMContext to Module. This requires threading ↵Owen Anderson2009-07-011-2/+3
| | | | | | | | | | 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. llvm-svn: 74614
* "ghostify" the ilist<Function> sentinelGabor Greif2009-03-271-8/+0
| | | | llvm-svn: 67872
* further simplifications arising from peruse of the more declarative interfaceGabor Greif2009-03-071-10/+0
| | | | llvm-svn: 66333
* Add Module::getNamedValue; use to normalize access to Module symbolDaniel Dunbar2009-03-061-19/+21
| | | | | | | table. - No functionality change. llvm-svn: 66289
* Reapply 63765. Patches for clang and llvm-gcc to follow.Dale Johannesen2009-02-051-0/+19
| | | | llvm-svn: 63812
* Reverting 63765. This broke the build of both clangDale Johannesen2009-02-041-19/+0
| | | | | | and llvm-gcc. llvm-svn: 63786
* New feature: add support for target intrinsics being defined in theNate Begeman2009-02-041-0/+19
| | | | | | | | | 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. llvm-svn: 63765
* Add the private linkage.Rafael Espindola2009-01-151-6/+5
| | | | llvm-svn: 62279
* Add a mechanism to specify attributes in getOrInsertFunction.Nick Lewycky2009-01-041-2/+29
| | | | llvm-svn: 61645
* Add comments to function.Bill Wendling2008-11-051-0/+6
| | | | llvm-svn: 58781
* - Add a "getOrInsertGlobal" method to the Module class. This acts similarly toBill Wendling2008-11-041-0/+22
| | | | | | | | | | "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
* Switch the asmprinter (.ll) and all the stuff it requires over toChris Lattner2008-08-231-5/+0
| | | | | | | | | | | | | | | | | | | | | | | | 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
* simplify some code to avoid string thrashing.Chris Lattner2008-06-271-3/+5
| | | | llvm-svn: 52837
OpenPOWER on IntegriCloud