fix some casts that I improperly refactored, patch by Artur Pietrek!
authorChris Lattner <sabre@nondot.org>
Thu, 16 Jul 2009 04:34:33 +0000 (04:34 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 16 Jul 2009 04:34:33 +0000 (04:34 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75894 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/MSIL/MSILWriter.cpp

index 8bd3c7bc22df918b98f0ff6700707b1211350602..dbfcdb7207bff90d17718b08587ff905a81a88fb 100644 (file)
@@ -235,7 +235,7 @@ bool MSILWriter::isZeroValue(const Value* V) {
 
 std::string MSILWriter::getValueName(const Value* V) {
   std::string Name;
-  if (const GlobalValue *GV = cast<GlobalValue>(V))
+  if (const GlobalValue *GV = dyn_cast<GlobalValue>(V))
     Name = Mang->getMangledName(GV);
   else {
     unsigned &No = AnonValueNumbers[V];
@@ -262,7 +262,7 @@ std::string MSILWriter::getLabelName(const std::string& Name) {
 
 std::string MSILWriter::getLabelName(const Value* V) {
   std::string Name;
-  if (const GlobalValue *GV = cast<GlobalValue>(V))
+  if (const GlobalValue *GV = dyn_cast<GlobalValue>(V))
     Name = Mang->getMangledName(GV);
   else {
     unsigned &No = AnonValueNumbers[V];