forked from OSchip/llvm-project
				
			Make the generated code for ConstantInt nicer.
llvm-svn: 35902
This commit is contained in:
		
							parent
							
								
									c49f2ef236
								
							
						
					
					
						commit
						5899dd1dc3
					
				| 
						 | 
				
			
			@ -694,8 +694,8 @@ void CppWriter::printConstant(const Constant *CV) {
 | 
			
		|||
    return;
 | 
			
		||||
  }
 | 
			
		||||
  if (const ConstantInt *CI = dyn_cast<ConstantInt>(CV)) {
 | 
			
		||||
    Out << "ConstantInt* " << constName << " = ConstantInt::get(" 
 | 
			
		||||
        << "APInt(cast<IntegerType>(" << typeName << ")->getBitWidth()," 
 | 
			
		||||
    Out << "ConstantInt* " << constName << " = ConstantInt::get(APInt(" 
 | 
			
		||||
        << cast<IntegerType>(CI->getType())->getBitWidth() << ", "
 | 
			
		||||
        << " \"" << CI->getValue().toStringSigned(10)  << "\", 10));";
 | 
			
		||||
  } else if (isa<ConstantAggregateZero>(CV)) {
 | 
			
		||||
    Out << "ConstantAggregateZero* " << constName 
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue