[llvm-commits] [llvm] r150572 -	/llvm/trunk/lib/Target/ARM/ARMAsmPrinter.cpp
    Bill Wendling 
    isanbard at gmail.com
       
    Wed Feb 15 01:14:09 PST 2012
    
    
  
Author: void
Date: Wed Feb 15 03:14:08 2012
New Revision: 150572
URL: http://llvm.org/viewvc/llvm-project?rev=150572&view=rev
Log:
Strip the pointer casts from the constants here.
The c'tor list is stored as a list of 'void ()*'s, so all of the functions are
bitcast to that. However, the dyn_cast doesn't automagically look through
bitcasts. Do that for it.
<rdar://problem/10813350>
Modified:
    llvm/trunk/lib/Target/ARM/ARMAsmPrinter.cpp
Modified: llvm/trunk/lib/Target/ARM/ARMAsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMAsmPrinter.cpp?rev=150572&r1=150571&r2=150572&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMAsmPrinter.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMAsmPrinter.cpp Wed Feb 15 03:14:08 2012
@@ -302,7 +302,7 @@
   uint64_t Size = TM.getTargetData()->getTypeAllocSize(CV->getType());
   assert(Size && "C++ constructor pointer had zero size!");
 
-  const GlobalValue *GV = dyn_cast<GlobalValue>(CV);
+  const GlobalValue *GV = dyn_cast<GlobalValue>(CV->stripPointerCasts());
   assert(GV && "C++ constructor pointer was not a GlobalValue!");
 
   const MCExpr *E = MCSymbolRefExpr::Create(Mang->getSymbol(GV),
    
    
More information about the llvm-commits
mailing list