зеркало из https://github.com/microsoft/clang-1.git
Move the decision about the kind of CGCXXABI to make inside
the family-specific files. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173530 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
188bdcd1aa
Коммит
96fcde0b8e
|
@ -296,9 +296,12 @@ public:
|
|||
llvm::Constant *addr);
|
||||
};
|
||||
|
||||
/// Creates an instance of a C++ ABI class.
|
||||
CGCXXABI *CreateARMCXXABI(CodeGenModule &CGM);
|
||||
// Create an instance of a C++ ABI class:
|
||||
|
||||
/// Creates an Itanium-family ABI.
|
||||
CGCXXABI *CreateItaniumCXXABI(CodeGenModule &CGM);
|
||||
|
||||
/// Creates a Microsoft-family ABI.
|
||||
CGCXXABI *CreateMicrosoftCXXABI(CodeGenModule &CGM);
|
||||
|
||||
}
|
||||
|
|
|
@ -53,12 +53,12 @@ static const char AnnotationSection[] = "llvm.metadata";
|
|||
|
||||
static CGCXXABI &createCXXABI(CodeGenModule &CGM) {
|
||||
switch (CGM.getContext().getTargetInfo().getCXXABI().getKind()) {
|
||||
// For IR-generation purposes, there's no significant difference
|
||||
// between the ARM and iOS ABIs.
|
||||
case TargetCXXABI::GenericARM: return *CreateARMCXXABI(CGM);
|
||||
case TargetCXXABI::iOS: return *CreateARMCXXABI(CGM);
|
||||
case TargetCXXABI::GenericItanium: return *CreateItaniumCXXABI(CGM);
|
||||
case TargetCXXABI::Microsoft: return *CreateMicrosoftCXXABI(CGM);
|
||||
case TargetCXXABI::GenericARM:
|
||||
case TargetCXXABI::iOS:
|
||||
case TargetCXXABI::GenericItanium:
|
||||
return *CreateItaniumCXXABI(CGM);
|
||||
case TargetCXXABI::Microsoft:
|
||||
return *CreateMicrosoftCXXABI(CGM);
|
||||
}
|
||||
|
||||
llvm_unreachable("invalid C++ ABI kind");
|
||||
|
|
|
@ -174,11 +174,20 @@ private:
|
|||
}
|
||||
|
||||
CodeGen::CGCXXABI *CodeGen::CreateItaniumCXXABI(CodeGenModule &CGM) {
|
||||
return new ItaniumCXXABI(CGM);
|
||||
}
|
||||
switch (CGM.getContext().getTargetInfo().getCXXABI().getKind()) {
|
||||
// For IR-generation purposes, there's no significant difference
|
||||
// between the ARM and iOS ABIs.
|
||||
case TargetCXXABI::GenericARM:
|
||||
case TargetCXXABI::iOS:
|
||||
return new ARMCXXABI(CGM);
|
||||
|
||||
CodeGen::CGCXXABI *CodeGen::CreateARMCXXABI(CodeGenModule &CGM) {
|
||||
return new ARMCXXABI(CGM);
|
||||
case TargetCXXABI::GenericItanium:
|
||||
return new ItaniumCXXABI(CGM);
|
||||
|
||||
case TargetCXXABI::Microsoft:
|
||||
llvm_unreachable("Microsoft ABI is not Itanium-based");
|
||||
}
|
||||
llvm_unreachable("bad ABI kind");
|
||||
}
|
||||
|
||||
llvm::Type *
|
||||
|
|
Загрузка…
Ссылка в новой задаче