| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 | #include "clang/CodeGen/CodeGenABITypes.h" |
| 19 | #include "CGRecordLayout.h" |
| 20 | #include "CodeGenModule.h" |
| 21 | #include "clang/CodeGen/CGFunctionInfo.h" |
| 22 | #include "clang/Lex/HeaderSearchOptions.h" |
| 23 | #include "clang/Lex/PreprocessorOptions.h" |
| 24 | |
| 25 | using namespace clang; |
| 26 | using namespace CodeGen; |
| 27 | |
| 28 | const CGFunctionInfo & |
| 29 | CodeGen::arrangeObjCMessageSendSignature(CodeGenModule &CGM, |
| 30 | const ObjCMethodDecl *MD, |
| 31 | QualType receiverType) { |
| 32 | return CGM.getTypes().arrangeObjCMessageSendSignature(MD, receiverType); |
| 33 | } |
| 34 | |
| 35 | const CGFunctionInfo & |
| 36 | CodeGen::arrangeFreeFunctionType(CodeGenModule &CGM, |
| 37 | CanQual<FunctionProtoType> Ty) { |
| 38 | return CGM.getTypes().arrangeFreeFunctionType(Ty); |
| 39 | } |
| 40 | |
| 41 | const CGFunctionInfo & |
| 42 | CodeGen::arrangeFreeFunctionType(CodeGenModule &CGM, |
| 43 | CanQual<FunctionNoProtoType> Ty) { |
| 44 | return CGM.getTypes().arrangeFreeFunctionType(Ty); |
| 45 | } |
| 46 | |
| 47 | const CGFunctionInfo & |
| 48 | CodeGen::arrangeCXXMethodType(CodeGenModule &CGM, |
| 49 | const CXXRecordDecl *RD, |
| 50 | const FunctionProtoType *FTP, |
| 51 | const CXXMethodDecl *MD) { |
| 52 | return CGM.getTypes().arrangeCXXMethodType(RD, FTP, MD); |
| 53 | } |
| 54 | |
| 55 | const CGFunctionInfo & |
| 56 | CodeGen::arrangeFreeFunctionCall(CodeGenModule &CGM, |
| 57 | CanQualType returnType, |
| 58 | ArrayRef<CanQualType> argTypes, |
| 59 | FunctionType::ExtInfo info, |
| 60 | RequiredArgs args) { |
| 61 | return CGM.getTypes().arrangeLLVMFunctionInfo( |
| 62 | returnType, , , argTypes, |
| 63 | info, {}, args); |
| 64 | } |
| 65 | |
| 66 | llvm::FunctionType * |
| 67 | CodeGen::convertFreeFunctionType(CodeGenModule &CGM, const FunctionDecl *FD) { |
| 68 | (0) . __assert_fail ("FD != nullptr && \"Expected a non-null function declaration!\"", "/home/seafit/code_projects/clang_source/clang/lib/CodeGen/CodeGenABITypes.cpp", 68, __PRETTY_FUNCTION__))" file_link="../../../include/assert.h.html#88" macro="true">assert(FD != nullptr && "Expected a non-null function declaration!"); |
| 69 | llvm::Type *T = CGM.getTypes().ConvertType(FD->getType()); |
| 70 | |
| 71 | if (auto FT = dyn_cast<llvm::FunctionType>(T)) |
| 72 | return FT; |
| 73 | |
| 74 | return nullptr; |
| 75 | } |
| 76 | |
| 77 | llvm::Type * |
| 78 | CodeGen::convertTypeForMemory(CodeGenModule &CGM, QualType T) { |
| 79 | return CGM.getTypes().ConvertTypeForMem(T); |
| 80 | } |
| 81 | |
| 82 | unsigned CodeGen::getLLVMFieldNumber(CodeGenModule &CGM, |
| 83 | const RecordDecl *RD, |
| 84 | const FieldDecl *FD) { |
| 85 | return CGM.getTypes().getCGRecordLayout(RD).getLLVMFieldNo(FD); |
| 86 | } |
| 87 | |