[llvm-commits] [llvm] r136771 - /llvm/trunk/include/llvm/Transforms/Utils/ValueMapper.h
Jay Foad
jay.foad at gmail.com
Wed Aug 3 03:05:04 PDT 2011
Author: foad
Date: Wed Aug 3 05:05:04 2011
New Revision: 136771
URL: http://llvm.org/viewvc/llvm-project?rev=136771&view=rev
Log:
Use cast<> instead of a C-style cast to get some free assertions.
Modified:
llvm/trunk/include/llvm/Transforms/Utils/ValueMapper.h
Modified: llvm/trunk/include/llvm/Transforms/Utils/ValueMapper.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Transforms/Utils/ValueMapper.h?rev=136771&r1=136770&r2=136771&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Transforms/Utils/ValueMapper.h (original)
+++ llvm/trunk/include/llvm/Transforms/Utils/ValueMapper.h Wed Aug 3 05:05:04 2011
@@ -66,12 +66,12 @@
inline MDNode *MapValue(const MDNode *V, ValueToValueMapTy &VM,
RemapFlags Flags = RF_None,
ValueMapTypeRemapper *TypeMapper = 0) {
- return (MDNode*)MapValue((const Value*)V, VM, Flags, TypeMapper);
+ return cast<MDNode>(MapValue((const Value*)V, VM, Flags, TypeMapper));
}
inline Constant *MapValue(const Constant *V, ValueToValueMapTy &VM,
RemapFlags Flags = RF_None,
ValueMapTypeRemapper *TypeMapper = 0) {
- return (Constant*)MapValue((const Value*)V, VM, Flags, TypeMapper);
+ return cast<Constant>(MapValue((const Value*)V, VM, Flags, TypeMapper));
}
More information about the llvm-commits
mailing list