diff options
author | Chris Lattner <sabre@nondot.org> | 2007-06-22 22:02:34 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2007-06-22 22:02:34 +0000 |
commit | 54fb19efaaa18f9417e6881506cdf15292ecccb6 (patch) | |
tree | f159e5fbcd66b2040200738264c4b892afc619ba /clang/CodeGen/CodeGenTypes.cpp | |
parent | e9a6453ded48e319aec7a8be4a0a477915aaa8f8 (diff) | |
download | bcm5719-llvm-54fb19efaaa18f9417e6881506cdf15292ecccb6.tar.gz bcm5719-llvm-54fb19efaaa18f9417e6881506cdf15292ecccb6.zip |
implement support for struct and complex returns.
llvm-svn: 39674
Diffstat (limited to 'clang/CodeGen/CodeGenTypes.cpp')
-rw-r--r-- | clang/CodeGen/CodeGenTypes.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/CodeGen/CodeGenTypes.cpp b/clang/CodeGen/CodeGenTypes.cpp index 4210402bc5d..58664643039 100644 --- a/clang/CodeGen/CodeGenTypes.cpp +++ b/clang/CodeGen/CodeGenTypes.cpp @@ -108,6 +108,13 @@ const llvm::Type *CodeGenTypes::ConvertType(QualType T) { // FIXME: Convert argument types. bool isVarArg; std::vector<const llvm::Type*> ArgTys; + + // Struct return passes the struct byref. + if (!ResultType->isFirstClassType()) { + ArgTys.push_back(llvm::PointerType::get(ResultType)); + ResultType = llvm::Type::VoidTy; + } + if (const FunctionTypeProto *FTP = dyn_cast<FunctionTypeProto>(&FP)) { DecodeArgumentTypes(*FTP, ArgTys); isVarArg = FTP->isVariadic(); |