From 7ee085fb969e76e182e129b149003499c294cb7c Mon Sep 17 00:00:00 2001
From: Vassil Vassilev <vasil.georgiev.vasilev@cern.ch>
Date: Thu, 25 Apr 2013 12:59:36 +0000
Subject: [PATCH] Reuse not reimplement util function.

git-svn-id: http://root.cern.ch/svn/root/trunk@49348 27541ba8-7e3a-0410-8455-c3a389f83636
---
 interpreter/cling/lib/Interpreter/DynamicLookup.cpp | 12 ++++--------
 interpreter/cling/lib/Interpreter/DynamicLookup.h   |  5 -----
 2 files changed, 4 insertions(+), 13 deletions(-)

diff --git a/interpreter/cling/lib/Interpreter/DynamicLookup.cpp b/interpreter/cling/lib/Interpreter/DynamicLookup.cpp
index 6917a4b1078..a6d03f7bafc 100644
--- a/interpreter/cling/lib/Interpreter/DynamicLookup.cpp
+++ b/interpreter/cling/lib/Interpreter/DynamicLookup.cpp
@@ -388,8 +388,8 @@ namespace cling {
         Inits.push_back(BuildDynamicExprInfo(E));
         // Build Arg1 DeclContext* DC
         QualType DCTy = m_Context->getTypeDeclType(m_DeclContextDecl);
-        Inits.push_back(ConstructCStyleCasePtrExpr(DCTy,
-                                                   (uint64_t)m_CurDeclContext)
+        Inits.push_back(utils::Synthesize::CStyleCastPtrExpr(m_Sema, DCTy,
+                                                     (uint64_t)m_CurDeclContext)
                         );
         // Build Arg2 llvm::StringRef
         // Get the type of the type without specifiers
@@ -570,7 +570,8 @@ namespace cling {
 
     // Build Arg1
     QualType DCTy = m_Context->getTypeDeclType(m_DeclContextDecl);
-    Expr* Arg1 = ConstructCStyleCasePtrExpr(DCTy, (uint64_t)m_CurDeclContext);
+    Expr* Arg1 = utils::Synthesize::CStyleCastPtrExpr(m_Sema, DCTy, 
+                                                    (uint64_t)m_CurDeclContext);
     CallArgs.push_back(Arg1);
 
     // Build the call
@@ -679,11 +680,6 @@ namespace cling {
     return Result;
   }
 
-  Expr* EvaluateTSynthesizer::ConstructCStyleCasePtrExpr(QualType Ty,
-                                                         uint64_t Ptr) {
-    return utils::Synthesize::CStyleCastPtrExpr(m_Sema, Ty, Ptr);
-  }
-
   Expr* EvaluateTSynthesizer::ConstructConstCharPtrExpr(const char* Val) {
     const QualType CChar = m_Context->CharTy.withConst();
     llvm::StringRef Value(Val);
diff --git a/interpreter/cling/lib/Interpreter/DynamicLookup.h b/interpreter/cling/lib/Interpreter/DynamicLookup.h
index 510f5e83381..8a2c4a806b2 100644
--- a/interpreter/cling/lib/Interpreter/DynamicLookup.h
+++ b/interpreter/cling/lib/Interpreter/DynamicLookup.h
@@ -244,11 +244,6 @@ namespace cling {
     clang::Expr* BuildDynamicExprInfo(clang::Expr* SubTree,
                                       bool ValuePrinterReq = false);
 
-    ///\brief Creates cstyle casts a pointer expression to a given qualified
-    /// type.
-    ///
-    clang::Expr* ConstructCStyleCasePtrExpr(clang::QualType Ty, uint64_t Ptr);
-
     ///\brief Creates const char* expression from given value.
     clang::Expr* ConstructConstCharPtrExpr(const char* Val);
 
-- 
GitLab