Skip to content

Commit e3179a0

Browse files
committed
Revert "Merging r311823: (+update ClangCommandLineReference.rst)"
This reverts commit 544c436. Revert all changed related to r310983. This introduces an ABI break that we don't want, but it also introduces build issues that we haven't fixed yet. Revert at least until we figure the build issues out.
1 parent 33f5ede commit e3179a0

File tree

15 files changed

+23
-164
lines changed

15 files changed

+23
-164
lines changed

docs/ClangCommandLineReference.rst

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -656,10 +656,6 @@ Pass <arg> to the assembler
656656

657657
Pass <arg> to the clang compiler
658658

659-
.. option:: -fclang-abi-compat=<version>
660-
661-
Attempt to match the ABI of Clang <version>
662-
663659
.. option:: -fcomment-block-commands=<arg>,<arg2>...
664660

665661
Treat each comma separated argument in <arg> as a documentation comment block command

include/clang/Driver/Options.td

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -716,9 +716,6 @@ def fbuiltin : Flag<["-"], "fbuiltin">, Group<f_Group>;
716716
def fbuiltin_module_map : Flag <["-"], "fbuiltin-module-map">, Group<f_Group>,
717717
Flags<[DriverOption]>, HelpText<"Load the clang builtins module map file.">;
718718
def fcaret_diagnostics : Flag<["-"], "fcaret-diagnostics">, Group<f_Group>;
719-
def fclang_abi_compat_EQ : Joined<["-"], "fclang-abi-compat=">, Group<f_clang_Group>,
720-
Flags<[CC1Option]>, MetaVarName<"<version>">, Values<"<major>.<minor>,latest">,
721-
HelpText<"Attempt to match the ABI of Clang <version>">;
722719
def fclasspath_EQ : Joined<["-"], "fclasspath=">, Group<f_Group>;
723720
def fcolor_diagnostics : Flag<["-"], "fcolor-diagnostics">, Group<f_Group>,
724721
Flags<[CoreOption, CC1Option]>, HelpText<"Use colors in diagnostics">;

include/clang/Frontend/CodeGenOptions.def

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,10 +120,6 @@ CODEGENOPT(NoZeroInitializedInBSS , 1, 0) ///< -fno-zero-initialized-in-bss.
120120
ENUM_CODEGENOPT(ObjCDispatchMethod, ObjCDispatchMethodKind, 2, Legacy)
121121
CODEGENOPT(OmitLeafFramePointer , 1, 0) ///< Set when -momit-leaf-frame-pointer is
122122
///< enabled.
123-
124-
/// A version of Clang that we should attempt to be ABI-compatible with.
125-
ENUM_CODEGENOPT(ClangABICompat, ClangABI, 4, ClangABI::Latest)
126-
127123
VALUE_CODEGENOPT(OptimizationLevel, 2, 0) ///< The -O[0-3] option specified.
128124
VALUE_CODEGENOPT(OptimizeSize, 2, 0) ///< If -Os (==1) or -Oz (==2) is specified.
129125

include/clang/Frontend/CodeGenOptions.h

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -69,23 +69,6 @@ class CodeGenOptions : public CodeGenOptionsBase {
6969
LocalExecTLSModel
7070
};
7171

72-
/// Clang versions with different platform ABI conformance.
73-
enum class ClangABI {
74-
/// Attempt to be ABI-compatible with code generated by Clang 3.8.x
75-
/// (SVN r257626). This causes <1 x long long> to be passed in an
76-
/// integer register instead of an SSE register on x64_64.
77-
Ver3_8,
78-
79-
/// Attempt to be ABI-compatible with code generated by Clang 4.0.x
80-
/// (SVN r291814). This causes move operations to be ignored when
81-
/// determining whether a class type can be passed or returned directly.
82-
Ver4,
83-
84-
/// Conform to the underlying platform's C and C++ ABIs as closely
85-
/// as we can.
86-
Latest
87-
};
88-
8972
enum StructReturnConventionKind {
9073
SRCK_Default, // No special option was passed.
9174
SRCK_OnStack, // Small structs on the stack (-fpcc-struct-return).

lib/CodeGen/ABIInfo.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ namespace llvm {
2424

2525
namespace clang {
2626
class ASTContext;
27-
class CodeGenOptions;
2827
class TargetInfo;
2928

3029
namespace CodeGen {
@@ -69,7 +68,6 @@ namespace swiftcall {
6968
llvm::LLVMContext &getVMContext() const;
7069
const llvm::DataLayout &getDataLayout() const;
7170
const TargetInfo &getTarget() const;
72-
const CodeGenOptions &getCodeGenOpts() const;
7371

7472
/// Return the calling convention to use for system runtime
7573
/// functions.

lib/CodeGen/CodeGenTypes.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,6 @@ CodeGenTypes::~CodeGenTypes() {
4444
delete &*I++;
4545
}
4646

47-
const CodeGenOptions &CodeGenTypes::getCodeGenOpts() const {
48-
return CGM.getCodeGenOpts();
49-
}
50-
5147
void CodeGenTypes::addRecordTypeName(const RecordDecl *RD,
5248
llvm::StructType *Ty,
5349
StringRef suffix) {

lib/CodeGen/CodeGenTypes.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,6 @@ class CodeGenTypes {
178178
const TargetInfo &getTarget() const { return Target; }
179179
CGCXXABI &getCXXABI() const { return TheCXXABI; }
180180
llvm::LLVMContext &getLLVMContext() { return TheModule.getContext(); }
181-
const CodeGenOptions &getCodeGenOpts() const;
182181

183182
/// ConvertType - Convert type T into a llvm::Type.
184183
llvm::Type *ConvertType(QualType T);

lib/CodeGen/ItaniumCXXABI.cpp

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -62,20 +62,9 @@ class ItaniumCXXABI : public CodeGen::CGCXXABI {
6262

6363
bool classifyReturnType(CGFunctionInfo &FI) const override;
6464

65-
bool passClassIndirect(const CXXRecordDecl *RD) const {
66-
// Clang <= 4 used the pre-C++11 rule, which ignores move operations.
67-
// The PS4 platform ABI follows the behavior of Clang 3.2.
68-
if (CGM.getCodeGenOpts().getClangABICompat() <=
69-
CodeGenOptions::ClangABI::Ver4 ||
70-
CGM.getTriple().getOS() == llvm::Triple::PS4)
71-
return RD->hasNonTrivialDestructor() ||
72-
RD->hasNonTrivialCopyConstructor();
73-
return !canCopyArgument(RD);
74-
}
75-
7665
RecordArgABI getRecordArgABI(const CXXRecordDecl *RD) const override {
7766
// If C++ prohibits us from making a copy, pass by address.
78-
if (passClassIndirect(RD))
67+
if (!canCopyArgument(RD))
7968
return RAA_Indirect;
8069
return RAA_Default;
8170
}
@@ -1007,7 +996,7 @@ bool ItaniumCXXABI::classifyReturnType(CGFunctionInfo &FI) const {
1007996
return false;
1008997

1009998
// If C++ prohibits us from making a copy, return by address.
1010-
if (passClassIndirect(RD)) {
999+
if (!canCopyArgument(RD)) {
10111000
auto Align = CGM.getContext().getTypeAlignInChars(FI.getReturnType());
10121001
FI.getReturnInfo() = ABIArgInfo::getIndirect(Align, /*ByVal=*/false);
10131002
return true;

lib/CodeGen/TargetInfo.cpp

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -183,11 +183,7 @@ const TargetInfo &ABIInfo::getTarget() const {
183183
return CGT.getTarget();
184184
}
185185

186-
const CodeGenOptions &ABIInfo::getCodeGenOpts() const {
187-
return CGT.getCodeGenOpts();
188-
}
189-
190-
bool ABIInfo::isAndroid() const { return getTarget().getTriple().isAndroid(); }
186+
bool ABIInfo:: isAndroid() const { return getTarget().getTriple().isAndroid(); }
191187

192188
bool ABIInfo::isHomogeneousAggregateBaseType(QualType Ty) const {
193189
return false;
@@ -2099,14 +2095,9 @@ class X86_64ABIInfo : public SwiftABIInfo {
20992095
return !getTarget().getTriple().isOSDarwin();
21002096
}
21012097

2102-
/// GCC classifies <1 x long long> as SSE but some platform ABIs choose to
2103-
/// classify it as INTEGER (for compatibility with older clang compilers).
2098+
/// GCC classifies <1 x long long> as SSE but compatibility with older clang
2099+
// compilers require us to classify it as INTEGER.
21042100
bool classifyIntegerMMXAsSSE() const {
2105-
// Clang <= 3.8 did not do this.
2106-
if (getCodeGenOpts().getClangABICompat() <=
2107-
CodeGenOptions::ClangABI::Ver3_8)
2108-
return false;
2109-
21102101
const llvm::Triple &Triple = getTarget().getTriple();
21112102
if (Triple.isOSDarwin() || Triple.getOS() == llvm::Triple::PS4)
21122103
return false;

lib/Driver/ToolChains/Clang.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2864,9 +2864,6 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
28642864

28652865
addPGOAndCoverageFlags(C, D, Output, Args, CmdArgs);
28662866

2867-
if (auto *ABICompatArg = Args.getLastArg(options::OPT_fclang_abi_compat_EQ))
2868-
ABICompatArg->render(Args, CmdArgs);
2869-
28702867
// Add runtime flag for PS4 when PGO or Coverage are enabled.
28712868
if (getToolChain().getTriple().isPS4CPU())
28722869
PS4cpu::addProfileRTArgs(getToolChain(), Args, CmdArgs);

0 commit comments

Comments
 (0)