mirror of
				https://github.com/c64scene-ar/llvm-6502.git
				synced 2025-11-03 14:21:30 +00:00 
			
		
		
		
	don't send null pointers through the constantexpr codepath unneededly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94010 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
		@@ -1247,6 +1247,12 @@ void AsmPrinter::EmitGlobalConstant(const Constant *CV, unsigned AddrSpace) {
 | 
				
			|||||||
  if (const ConstantVector *V = dyn_cast<ConstantVector>(CV))
 | 
					  if (const ConstantVector *V = dyn_cast<ConstantVector>(CV))
 | 
				
			||||||
    return EmitGlobalConstantVector(V, AddrSpace, *this);
 | 
					    return EmitGlobalConstantVector(V, AddrSpace, *this);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  if (isa<ConstantPointerNull>(CV)) {
 | 
				
			||||||
 | 
					    unsigned Size = TM.getTargetData()->getTypeAllocSize(CV->getType());
 | 
				
			||||||
 | 
					    OutStreamer.EmitIntValue(0, Size, AddrSpace);
 | 
				
			||||||
 | 
					    return;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					  
 | 
				
			||||||
  // Otherwise, it must be a ConstantExpr.  Emit the data directive, then emit
 | 
					  // Otherwise, it must be a ConstantExpr.  Emit the data directive, then emit
 | 
				
			||||||
  // the expression value.
 | 
					  // the expression value.
 | 
				
			||||||
  switch (TM.getTargetData()->getTypeAllocSize(CV->getType())) {
 | 
					  switch (TM.getTargetData()->getTypeAllocSize(CV->getType())) {
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user