TargetInfo.cpp (261991) | TargetInfo.cpp (262613) |
---|---|
1//===---- TargetInfo.cpp - Encapsulate target details -----------*- C++ -*-===// 2// 3// The LLVM Compiler Infrastructure 4// 5// This file is distributed under the University of Illinois Open Source 6// License. See LICENSE.TXT for details. 7// 8//===----------------------------------------------------------------------===// --- 5335 unchanged lines hidden (view full) --- 5344 // Integer types smaller than a register are extended. 5345 if (Size < 64 && Ty->isIntegerType()) 5346 return ABIArgInfo::getExtend(); 5347 5348 // Other non-aggregates go in registers. 5349 if (!isAggregateTypeForABI(Ty)) 5350 return ABIArgInfo::getDirect(); 5351 | 1//===---- TargetInfo.cpp - Encapsulate target details -----------*- C++ -*-===// 2// 3// The LLVM Compiler Infrastructure 4// 5// This file is distributed under the University of Illinois Open Source 6// License. See LICENSE.TXT for details. 7// 8//===----------------------------------------------------------------------===// --- 5335 unchanged lines hidden (view full) --- 5344 // Integer types smaller than a register are extended. 5345 if (Size < 64 && Ty->isIntegerType()) 5346 return ABIArgInfo::getExtend(); 5347 5348 // Other non-aggregates go in registers. 5349 if (!isAggregateTypeForABI(Ty)) 5350 return ABIArgInfo::getDirect(); 5351 |
5352 // If a C++ object has either a non-trivial copy constructor or a non-trivial 5353 // destructor, it is passed with an explicit indirect pointer / sret pointer. 5354 if (CGCXXABI::RecordArgABI RAA = getRecordArgABI(Ty, getCXXABI())) 5355 return ABIArgInfo::getIndirect(0, RAA == CGCXXABI::RAA_DirectInMemory); 5356 |
|
5352 // This is a small aggregate type that should be passed in registers. 5353 // Build a coercion type from the LLVM struct type. 5354 llvm::StructType *StrTy = dyn_cast<llvm::StructType>(CGT.ConvertType(Ty)); 5355 if (!StrTy) 5356 return ABIArgInfo::getDirect(); 5357 5358 CoerceBuilder CB(getVMContext(), getDataLayout()); 5359 CB.addStruct(0, StrTy); --- 65 unchanged lines hidden (view full) --- 5425 it->info = classifyType(it->type, 16 * 8); 5426} 5427 5428namespace { 5429class SparcV9TargetCodeGenInfo : public TargetCodeGenInfo { 5430public: 5431 SparcV9TargetCodeGenInfo(CodeGenTypes &CGT) 5432 : TargetCodeGenInfo(new SparcV9ABIInfo(CGT)) {} | 5357 // This is a small aggregate type that should be passed in registers. 5358 // Build a coercion type from the LLVM struct type. 5359 llvm::StructType *StrTy = dyn_cast<llvm::StructType>(CGT.ConvertType(Ty)); 5360 if (!StrTy) 5361 return ABIArgInfo::getDirect(); 5362 5363 CoerceBuilder CB(getVMContext(), getDataLayout()); 5364 CB.addStruct(0, StrTy); --- 65 unchanged lines hidden (view full) --- 5430 it->info = classifyType(it->type, 16 * 8); 5431} 5432 5433namespace { 5434class SparcV9TargetCodeGenInfo : public TargetCodeGenInfo { 5435public: 5436 SparcV9TargetCodeGenInfo(CodeGenTypes &CGT) 5437 : TargetCodeGenInfo(new SparcV9ABIInfo(CGT)) {} |
5438 5439 int getDwarfEHStackPointer(CodeGen::CodeGenModule &M) const { 5440 return 14; 5441 } 5442 5443 bool initDwarfEHRegSizeTable(CodeGen::CodeGenFunction &CGF, 5444 llvm::Value *Address) const; |
|
5433}; 5434} // end anonymous namespace 5435 | 5445}; 5446} // end anonymous namespace 5447 |
5448bool 5449SparcV9TargetCodeGenInfo::initDwarfEHRegSizeTable(CodeGen::CodeGenFunction &CGF, 5450 llvm::Value *Address) const { 5451 // This is calculated from the LLVM and GCC tables and verified 5452 // against gcc output. AFAIK all ABIs use the same encoding. |
|
5436 | 5453 |
5454 CodeGen::CGBuilderTy &Builder = CGF.Builder; 5455 5456 llvm::IntegerType *i8 = CGF.Int8Ty; 5457 llvm::Value *Four8 = llvm::ConstantInt::get(i8, 4); 5458 llvm::Value *Eight8 = llvm::ConstantInt::get(i8, 8); 5459 5460 // 0-31: the 8-byte general-purpose registers 5461 AssignToArrayRange(Builder, Address, Eight8, 0, 31); 5462 5463 // 32-63: f0-31, the 4-byte floating-point registers 5464 AssignToArrayRange(Builder, Address, Four8, 32, 63); 5465 5466 // Y = 64 5467 // PSR = 65 5468 // WIM = 66 5469 // TBR = 67 5470 // PC = 68 5471 // NPC = 69 5472 // FSR = 70 5473 // CSR = 71 5474 AssignToArrayRange(Builder, Address, Eight8, 64, 71); 5475 5476 // 72-87: d0-15, the 8-byte floating-point registers 5477 AssignToArrayRange(Builder, Address, Eight8, 72, 87); 5478 5479 return false; 5480} 5481 5482 |
|
5437//===----------------------------------------------------------------------===// 5438// Xcore ABI Implementation 5439//===----------------------------------------------------------------------===// 5440namespace { 5441class XCoreABIInfo : public DefaultABIInfo { 5442public: 5443 XCoreABIInfo(CodeGen::CodeGenTypes &CGT) : DefaultABIInfo(CGT) {} 5444 virtual llvm::Value *EmitVAArg(llvm::Value *VAListAddr, QualType Ty, --- 175 unchanged lines hidden --- | 5483//===----------------------------------------------------------------------===// 5484// Xcore ABI Implementation 5485//===----------------------------------------------------------------------===// 5486namespace { 5487class XCoreABIInfo : public DefaultABIInfo { 5488public: 5489 XCoreABIInfo(CodeGen::CodeGenTypes &CGT) : DefaultABIInfo(CGT) {} 5490 virtual llvm::Value *EmitVAArg(llvm::Value *VAListAddr, QualType Ty, --- 175 unchanged lines hidden --- |