diff options
author | Alexander Kornienko <alexfh@google.com> | 2012-12-11 15:36:31 +0000 |
---|---|---|
committer | Alexander Kornienko <alexfh@google.com> | 2012-12-11 15:36:31 +0000 |
commit | b50a126556a69df0fb68a190afdaf9850410fd4a (patch) | |
tree | 57e2fdf1caf960d8d878e0289f32af6759832b49 /lib/VMCore/Module.cpp | |
parent | ccaf20cc53a3dc353f4786b1ebf4ebb3f81d4746 (diff) | |
parent | 1ad9253c9d34ccbce3e7e4ea5d87c266cbf93410 (diff) |
Updating branches/google/testing to r169803
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/google/testing@169870 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/Module.cpp')
-rw-r--r-- | lib/VMCore/Module.cpp | 40 |
1 files changed, 11 insertions, 29 deletions
diff --git a/lib/VMCore/Module.cpp b/lib/VMCore/Module.cpp index 5b5176b3c7..78f4eb82dc 100644 --- a/lib/VMCore/Module.cpp +++ b/lib/VMCore/Module.cpp @@ -12,17 +12,17 @@ //===----------------------------------------------------------------------===// #include "llvm/Module.h" -#include "llvm/InstrTypes.h" +#include "SymbolTableListTraitsImpl.h" +#include "llvm/ADT/DenseSet.h" +#include "llvm/ADT/STLExtras.h" +#include "llvm/ADT/SmallString.h" +#include "llvm/ADT/StringExtras.h" #include "llvm/Constants.h" #include "llvm/DerivedTypes.h" #include "llvm/GVMaterializer.h" +#include "llvm/InstrTypes.h" #include "llvm/LLVMContext.h" -#include "llvm/ADT/DenseSet.h" -#include "llvm/ADT/SmallString.h" -#include "llvm/ADT/STLExtras.h" -#include "llvm/ADT/StringExtras.h" #include "llvm/Support/LeakDetector.h" -#include "SymbolTableListTraitsImpl.h" #include <algorithm> #include <cstdarg> #include <cstdlib> @@ -55,7 +55,6 @@ Module::~Module() { GlobalList.clear(); FunctionList.clear(); AliasList.clear(); - LibraryList.clear(); NamedMDList.clear(); delete ValSymTab; delete static_cast<StringMap<NamedMDNode *> *>(NamedMDSymTab); @@ -138,7 +137,7 @@ void Module::getMDKindNames(SmallVectorImpl<StringRef> &Result) const { // Constant *Module::getOrInsertFunction(StringRef Name, FunctionType *Ty, - AttrListPtr AttributeList) { + AttributeSet AttributeList) { // See if we have a definition for the specified function already. GlobalValue *F = getNamedValue(Name); if (F == 0) { @@ -171,7 +170,7 @@ Constant *Module::getOrInsertFunction(StringRef Name, Constant *Module::getOrInsertTargetIntrinsic(StringRef Name, FunctionType *Ty, - AttrListPtr AttributeList) { + AttributeSet AttributeList) { // See if we have a definition for the specified function already. GlobalValue *F = getNamedValue(Name); if (F == 0) { @@ -188,7 +187,7 @@ Constant *Module::getOrInsertTargetIntrinsic(StringRef Name, Constant *Module::getOrInsertFunction(StringRef Name, FunctionType *Ty) { - return getOrInsertFunction(Name, Ty, AttrListPtr()); + return getOrInsertFunction(Name, Ty, AttributeSet()); } // getOrInsertFunction - Look up the specified function in the module symbol @@ -197,7 +196,7 @@ Constant *Module::getOrInsertFunction(StringRef Name, // arguments, which makes it easier for clients to use. // Constant *Module::getOrInsertFunction(StringRef Name, - AttrListPtr AttributeList, + AttributeSet AttributeList, Type *RetTy, ...) { va_list Args; va_start(Args, RetTy); @@ -230,7 +229,7 @@ Constant *Module::getOrInsertFunction(StringRef Name, // Build the function type and chain to the other getOrInsertFunction... return getOrInsertFunction(Name, FunctionType::get(RetTy, ArgTys, false), - AttrListPtr()); + AttributeSet()); } // getFunction - Look up the specified function in the module symbol table. @@ -450,20 +449,3 @@ void Module::dropAllReferences() { for(Module::alias_iterator I = alias_begin(), E = alias_end(); I != E; ++I) I->dropAllReferences(); } - -void Module::addLibrary(StringRef Lib) { - for (Module::lib_iterator I = lib_begin(), E = lib_end(); I != E; ++I) - if (*I == Lib) - return; - LibraryList.push_back(Lib); -} - -void Module::removeLibrary(StringRef Lib) { - LibraryListType::iterator I = LibraryList.begin(); - LibraryListType::iterator E = LibraryList.end(); - for (;I != E; ++I) - if (*I == Lib) { - LibraryList.erase(I); - return; - } -} |