summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJay Foad <jay.foad@gmail.com>2011-08-03 10:05:04 +0000
committerJay Foad <jay.foad@gmail.com>2011-08-03 10:05:04 +0000
commite3fbe6c0fbf354c05800aabd8b0efc4a9366dc08 (patch)
treefcb56989cbeb5d6110de4af215f8c6ae96d52415
parentfb5179a2fa3372813ea9568ad0073223c8e0393c (diff)
downloadllvm-e3fbe6c0fbf354c05800aabd8b0efc4a9366dc08.tar.gz
llvm-e3fbe6c0fbf354c05800aabd8b0efc4a9366dc08.tar.bz2
llvm-e3fbe6c0fbf354c05800aabd8b0efc4a9366dc08.tar.xz
Use cast<> instead of a C-style cast to get some free assertions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136771 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/llvm/Transforms/Utils/ValueMapper.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/llvm/Transforms/Utils/ValueMapper.h b/include/llvm/Transforms/Utils/ValueMapper.h
index 2194373c45..03846567db 100644
--- a/include/llvm/Transforms/Utils/ValueMapper.h
+++ b/include/llvm/Transforms/Utils/ValueMapper.h
@@ -66,12 +66,12 @@ namespace llvm {
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));
}