[llvm-branch-commits] [llvm-branch] r133582 - in /llvm/branches/type-system-rewrite: include/llvm/Module.h lib/VMCore/Module.cpp lib/VMCore/Type.cpp
Chris Lattner
sabre at nondot.org
Tue Jun 21 16:53:24 PDT 2011
Author: lattner
Date: Tue Jun 21 18:53:24 2011
New Revision: 133582
URL: http://llvm.org/viewvc/llvm-project?rev=133582&view=rev
Log:
implement Module::getTypeByName and fix its type, allowing llc to link.
Modified:
llvm/branches/type-system-rewrite/include/llvm/Module.h
llvm/branches/type-system-rewrite/lib/VMCore/Module.cpp
llvm/branches/type-system-rewrite/lib/VMCore/Type.cpp
Modified: llvm/branches/type-system-rewrite/include/llvm/Module.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/type-system-rewrite/include/llvm/Module.h?rev=133582&r1=133581&r2=133582&view=diff
==============================================================================
--- llvm/branches/type-system-rewrite/include/llvm/Module.h (original)
+++ llvm/branches/type-system-rewrite/include/llvm/Module.h Tue Jun 21 18:53:24 2011
@@ -257,7 +257,7 @@
/// getTypeByName - Return the type with the specified name, or null if there
/// is none by that name.
- const Type *getTypeByName(StringRef Name) const;
+ StructType *getTypeByName(StringRef Name) const;
/// @}
/// @name Function Accessors
Modified: llvm/branches/type-system-rewrite/lib/VMCore/Module.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/type-system-rewrite/lib/VMCore/Module.cpp?rev=133582&r1=133581&r2=133582&view=diff
==============================================================================
--- llvm/branches/type-system-rewrite/lib/VMCore/Module.cpp (original)
+++ llvm/branches/type-system-rewrite/lib/VMCore/Module.cpp Tue Jun 21 18:53:24 2011
@@ -519,3 +519,5 @@
void Module::findUsedStructTypes(std::vector<StructType*> &StructTypes) const {
TypeFinder(StructTypes).run(*this);
}
+
+
Modified: llvm/branches/type-system-rewrite/lib/VMCore/Type.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/type-system-rewrite/lib/VMCore/Type.cpp?rev=133582&r1=133581&r2=133582&view=diff
==============================================================================
--- llvm/branches/type-system-rewrite/lib/VMCore/Type.cpp (original)
+++ llvm/branches/type-system-rewrite/lib/VMCore/Type.cpp Tue Jun 21 18:53:24 2011
@@ -12,6 +12,7 @@
//===----------------------------------------------------------------------===//
#include "LLVMContextImpl.h"
+#include "llvm/Module.h"
#include <algorithm>
#include <cstdarg>
#include "llvm/ADT/SmallString.h"
@@ -517,6 +518,17 @@
}
+/// getTypeByName - Return the type with the specified name, or null if there
+/// is none by that name.
+StructType *Module::getTypeByName(StringRef Name) const {
+ StringMap<StructType*>::iterator I =
+ getContext().pImpl->NamedStructTypes.find(Name);
+ if (I != getContext().pImpl->NamedStructTypes.end())
+ return I->second;
+ return 0;
+}
+
+
//===----------------------------------------------------------------------===//
// CompositeType Implementation
//===----------------------------------------------------------------------===//
More information about the llvm-branch-commits
mailing list