[llvm-commits] [llvm] r55022 - /llvm/trunk/lib/ExecutionEngine/JIT/JITEmitter.cpp
Evan Cheng
evan.cheng at apple.com
Tue Aug 19 17:28:12 PDT 2008
Author: evancheng
Date: Tue Aug 19 19:28:12 2008
New Revision: 55022
URL: http://llvm.org/viewvc/llvm-project?rev=55022&view=rev
Log:
Get rid of a couple of dynamic_cast.
Modified:
llvm/trunk/lib/ExecutionEngine/JIT/JITEmitter.cpp
Modified: llvm/trunk/lib/ExecutionEngine/JIT/JITEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/JIT/JITEmitter.cpp?rev=55022&r1=55021&r2=55022&view=diff
==============================================================================
--- llvm/trunk/lib/ExecutionEngine/JIT/JITEmitter.cpp (original)
+++ llvm/trunk/lib/ExecutionEngine/JIT/JITEmitter.cpp Tue Aug 19 19:28:12 2008
@@ -486,6 +486,12 @@
delete MemMgr;
if (ExceptionHandling) delete DE;
}
+
+ /// classof - Methods for support type inquiry through isa, cast, and
+ /// dyn_cast:
+ ///
+ static inline bool classof(const JITEmitter*) { return true; }
+ static inline bool classof(const MachineCodeEmitter*) { return true; }
JITResolver &getJITResolver() { return Resolver; }
@@ -1129,8 +1135,8 @@
return Addr;
// Get a stub if the target supports it.
- assert(dynamic_cast<JITEmitter*>(MCE) && "Unexpected MCE?");
- JITEmitter *JE = static_cast<JITEmitter*>(getCodeEmitter());
+ assert(isa<JITEmitter>(MCE) && "Unexpected MCE?");
+ JITEmitter *JE = cast<JITEmitter>(getCodeEmitter());
return JE->getJITResolver().getFunctionStub(F);
}
@@ -1146,7 +1152,7 @@
RemoveFunctionFromSymbolTable(OldPtr);
// Free the actual memory for the function body and related stuff.
- assert(dynamic_cast<JITEmitter*>(MCE) && "Unexpected MCE?");
- static_cast<JITEmitter*>(MCE)->deallocateMemForFunction(F);
+ assert(isa<JITEmitter>(MCE) && "Unexpected MCE?");
+ cast<JITEmitter>(MCE)->deallocateMemForFunction(F);
}
More information about the llvm-commits
mailing list