summaryrefslogtreecommitdiffstats
path: root/llvm/lib/VMCore/Module.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Rename VMCore directory to IR.Chandler Carruth2013-01-021-451/+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
* s/AttrListPtr/AttributeSet/g to better label what this class is going to be ↵Bill Wendling2012-12-071-5/+5
| | | | | | in the near future. llvm-svn: 169651
* Use the new script to sort the includes of every file under lib.Chandler Carruth2012-12-031-6/+6
| | | | | | | | | | | | | | | | | 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
* Remove the dependent libraries feature.Bill Wendling2012-11-271-18/+0
| | | | | | The dependent libraries feature was never used and has bit-rotted. Remove it. llvm-svn: 168694
* Move the "findUsedStructTypes" functionality outside of the Module class.Bill Wendling2012-08-031-140/+0
| | | | | | | | | The "findUsedStructTypes" method is very expensive to run. It needs to be optimized so that LTO can run faster. Splitting this method out of the Module class will help this occur. For instance, it can keep a list of seen objects so that it doesn't process them over and over again. llvm-svn: 161228
* simplify code.Chris Lattner2012-05-281-3/+2
| | | | llvm-svn: 157555
* Cleanup whitespace.Bill Wendling2012-04-231-32/+32
| | | | llvm-svn: 155328
* Limit the number of times we recurse through this algorithm. All of theBill Wendling2012-04-231-5/+17
| | | | | | | intructions are processed. So there's no need to look at them if they're used as operands of other instructions. llvm-svn: 155327
* Add a flag to the struct type finder to collect only those types which haveBill Wendling2012-04-211-5/+8
| | | | | | names. This saves collecting types we normally don't care about. llvm-svn: 155300
* Revert r155241, which is causing some breakage.Bill Wendling2012-04-201-65/+20
| | | | llvm-svn: 155253
* If we discover all of the named structs in a module, then don't bother toBill Wendling2012-04-201-20/+65
| | | | | | process any more Values. llvm-svn: 155241
* Typo.Eric Christopher2012-04-161-1/+1
| | | | llvm-svn: 154879
* s/ModAttrBehavior/ModFlagBehavior/g to be consistent with how module flags ↵Bill Wendling2012-02-161-3/+3
| | | | | | are named elsewhere. llvm-svn: 150679
* Use the enum instead of 'unsigned'.Bill Wendling2012-02-151-1/+2
| | | | llvm-svn: 150632
* Add a module flags accessor method which returns the flags in a vector.Bill Wendling2012-02-151-0/+15
| | | | llvm-svn: 150623
* [WIP] Initial code for module flags.Bill Wendling2012-02-111-0/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Module flags are key-value pairs associated with the module. They include a 'behavior' value, indicating how module flags react when mergine two files. Normally, it's just the union of the two module flags. But if two module flags have the same key, then the resulting flags are dictated by the behaviors. Allowable behaviors are: Error Emits an error if two values disagree. Warning Emits a warning if two values disagree. Require Emits an error when the specified value is not present or doesn't have the specified value. It is an error for two (or more) llvm.module.flags with the same ID to have the Require behavior but different values. There may be multiple Require flags per ID. Override Uses the specified value if the two values disagree. It is an error for two (or more) llvm.module.flags with the same ID to have the Override behavior but different values. llvm-svn: 150300
* 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
OpenPOWER on IntegriCloud