[llvm-branch-commits] [llvm-branch] r201958 - employ a similar inline to template specialization redirection for getImpliedUser

Gabor Greif ggreif at gmail.com
Sat Feb 22 15:32:10 PST 2014


Author: ggreif
Date: Sat Feb 22 17:32:10 2014
New Revision: 201958

URL: http://llvm.org/viewvc/llvm-project?rev=201958&view=rev
Log:
employ a similar inline to template specialization redirection for getImpliedUser

Modified:
    llvm/branches/ggreif/waymark-64-new/include/llvm/IR/Use.h
    llvm/branches/ggreif/waymark-64-new/lib/IR/Use.cpp

Modified: llvm/branches/ggreif/waymark-64-new/include/llvm/IR/Use.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/waymark-64-new/include/llvm/IR/Use.h?rev=201958&r1=201957&r2=201958&view=diff
==============================================================================
--- llvm/branches/ggreif/waymark-64-new/include/llvm/IR/Use.h (original)
+++ llvm/branches/ggreif/waymark-64-new/include/llvm/IR/Use.h Sat Feb 22 17:32:10 2014
@@ -123,7 +123,9 @@ public:
   static void zap(Use *Start, const Use *Stop, bool del = false);
 
 private:
-  const Use* getImpliedUser() const;
+  inline const Use *getImpliedUser() const;
+  template <size_t>
+  const Use *getImpliedUser() const;
   template <size_t>
   static Use *newInitTags(Use * const Start, Use *Stop);
 
@@ -152,12 +154,19 @@ private:
 
 // Out-of-class specializations/definitions.
 template<>
-Use * Use::newInitTags<8>(Use * const Start, Use *Stop);
+Use *Use::newInitTags<8>(Use * const Start, Use *Stop);
 
 inline Use * Use::initTags(Use *Start, Use *Stop) {
   return newInitTags<sizeof(Use*)>(Start, Stop);
 }
 
+template<>
+const Use *Use::getImpliedUser<8>() const;
+
+inline const Use *Use::getImpliedUser() const {
+  return getImpliedUser<sizeof(Use*)>();
+}
+
 
 // simplify_type - Allow clients to treat uses just like values when using
 // casting operators.

Modified: llvm/branches/ggreif/waymark-64-new/lib/IR/Use.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/waymark-64-new/lib/IR/Use.cpp?rev=201958&r1=201957&r2=201958&view=diff
==============================================================================
--- llvm/branches/ggreif/waymark-64-new/lib/IR/Use.cpp (original)
+++ llvm/branches/ggreif/waymark-64-new/lib/IR/Use.cpp Sat Feb 22 17:32:10 2014
@@ -49,7 +49,8 @@ void Use::swap(Use &RHS) {
 //                         Use getImpliedUser Implementation
 //===----------------------------------------------------------------------===//
 
-const Use *Use::getImpliedUser() const {
+template<>
+const Use *Use::getImpliedUser<8>() const {
   const Use *Current = this;
 
   while (true) {
@@ -86,8 +87,8 @@ const Use *Use::getImpliedUser() const {
 //                         Use initTags Implementation
 //===----------------------------------------------------------------------===//
 
-template <>
-Use * Use::newInitTags<8>(Use * const Start, Use *Stop) {
+template<>
+Use *Use::newInitTags<8>(Use * const Start, Use *Stop) {
   ptrdiff_t Done = 0;
   while (Done < 32) {
     if (Start == Stop--)





More information about the llvm-branch-commits mailing list