Initial implementation of FunctionType::GetDIType
This commit is contained in:
17
type.cpp
17
type.cpp
@@ -2535,9 +2535,22 @@ FunctionType::LLVMType(llvm::LLVMContext *ctx) const {
|
|||||||
|
|
||||||
llvm::DIType
|
llvm::DIType
|
||||||
FunctionType::GetDIType(llvm::DIDescriptor scope) const {
|
FunctionType::GetDIType(llvm::DIDescriptor scope) const {
|
||||||
// @todo need to implement FunctionType::GetDIType()
|
std::vector<llvm::Value *> retArgTypes;
|
||||||
FATAL("need to implement FunctionType::GetDIType()");
|
|
||||||
|
retArgTypes.push_back(returnType->GetDIType(scope));
|
||||||
|
for (int i = 0; i < GetNumParameters(); ++i) {
|
||||||
|
const Type *t = GetParameterType(i);
|
||||||
|
if (t == NULL)
|
||||||
return llvm::DIType();
|
return llvm::DIType();
|
||||||
|
retArgTypes.push_back(t->GetDIType(scope));
|
||||||
|
}
|
||||||
|
|
||||||
|
llvm::DIArray retArgTypesArray =
|
||||||
|
m->diBuilder->getOrCreateArray(llvm::ArrayRef<llvm::Value *>(retArgTypes));
|
||||||
|
llvm::DIType diType =
|
||||||
|
// FIXME: DIFile
|
||||||
|
m->diBuilder->createSubroutineType(llvm::DIFile(), retArgTypesArray);
|
||||||
|
return diType;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user