From 5d8ce41be57127428c067113b6deb9a967f842b7 Mon Sep 17 00:00:00 2001 From: hgpatil Date: Sat, 16 May 2015 10:32:34 -0400 Subject: [PATCH] =?UTF-8?q?Fix=20for=20"error:=20=E2=80=98dynamic=5Fcast?= =?UTF-8?q?=E2=80=99=20not=20permitted=20with=20-fno-rtti"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Changed 5 instances of 'dynamic_cast' to 'reinterpret_cast'. Unfortunately, one regression test 'idiom.predictor.libc_lock' fails after this change. Will need to look a the source to fix this. --- src/core/wrapper.hpp | 3 ++- src/systematic/controller.cpp | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/core/wrapper.hpp b/src/core/wrapper.hpp index 059de901..a3fca40b 100644 --- a/src/core/wrapper.hpp +++ b/src/core/wrapper.hpp @@ -19,6 +19,7 @@ #ifndef CORE_WRAPPER_HPP_ #define CORE_WRAPPER_HPP_ + #include "pin.H" #include @@ -366,7 +367,7 @@ class WrapperFactory { WrapperMap::iterator it = wrappers_.find(name); if (it == wrappers_.end()) return NULL; - return dynamic_cast(it->second); + return reinterpret_cast(it->second); } static WrapperFactory *GetInstance() { diff --git a/src/systematic/controller.cpp b/src/systematic/controller.cpp index 94dfb984..8fbf88d0 100644 --- a/src/systematic/controller.cpp +++ b/src/systematic/controller.cpp @@ -959,13 +959,13 @@ Controller::BarrierInfo *Controller::GetBarrierInfo(address_t iaddr) { Object *Controller::GetObject(address_t iaddr) { Region *region = FindRegion(iaddr); DEBUG_ASSERT(region); - SRegion *sregion = dynamic_cast(region); + SRegion *sregion = reinterpret_cast(region); if (sregion) { Image *image = sregion->image; address_t offset = iaddr - sregion->addr; return program_->GetSObject(image, offset); } - DRegion *dregion = dynamic_cast(region); + DRegion *dregion = reinterpret_cast(region); if (dregion) { Thread *creator = dregion->creator; Inst *creator_inst = dregion->creator_inst; @@ -1033,7 +1033,7 @@ void Controller::FreeSRegion(address_t addr) { // delete a static region Region::Map::iterator it = region_table_.find(addr); if (it != region_table_.end()) { - SRegion *region = dynamic_cast(it->second); + SRegion *region = reinterpret_cast(it->second); DEBUG_ASSERT(region); region_table_.erase(it); FreeMutexInfo(region); @@ -1046,7 +1046,7 @@ void Controller::FreeDRegion(address_t addr) { // delete a dynamic region Region::Map::iterator it = region_table_.find(addr); if (it != region_table_.end()) { - DRegion *region = dynamic_cast(it->second); + DRegion *region = reinterpret_cast(it->second); DEBUG_ASSERT(region); region_table_.erase(it); FreeMutexInfo(region);