Added small section asm emition logic for mips.
Fixed small bug.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53908 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Target/Mips/MipsISelLowering.cpp b/lib/Target/Mips/MipsISelLowering.cpp
index 668e57d..d991658 100644
--- a/lib/Target/Mips/MipsISelLowering.cpp
+++ b/lib/Target/Mips/MipsISelLowering.cpp
@@ -241,10 +241,11 @@
 bool MipsTargetLowering::IsGlobalInSmallSection(GlobalValue *GV)
 {
   const TargetData *TD = getTargetData();
-  const Value *V = dyn_cast<Value>(GV);
-  const GlobalVariable *GVA = dyn_cast<GlobalVariable>(V);
+  const GlobalVariable *GVA = dyn_cast<GlobalVariable>(GV);
+
+  if (!GVA)
+    return false;
   
-  //const PointerType *PTy = GV->getType();
   const Type *Ty = GV->getType()->getElementType();
   unsigned Size = TD->getABITypeSize(Ty);