barannikov88 created this revision. Herald added a subscriber: pengfei. Herald added a project: All. barannikov88 added reviewers: rjmccall, aaron.ballman, erichkeane. barannikov88 published this revision for review. Herald added a project: clang. Herald added a subscriber: cfe-commits.
`CCState` is a helper class originally used by the x86 implementation but has since been abused by other implementations. Remove this dependency by implementing customized versions of the class for implementations that need such functionality. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D148089 Files: clang/lib/CodeGen/TargetInfo.cpp Index: clang/lib/CodeGen/TargetInfo.cpp =================================================================== --- clang/lib/CodeGen/TargetInfo.cpp +++ clang/lib/CodeGen/TargetInfo.cpp @@ -9071,13 +9071,17 @@ namespace { class LanaiABIInfo : public DefaultABIInfo { + struct CCState { + unsigned FreeRegs; + }; + public: LanaiABIInfo(CodeGen::CodeGenTypes &CGT) : DefaultABIInfo(CGT) {} bool shouldUseInReg(QualType Ty, CCState &State) const; void computeInfo(CGFunctionInfo &FI) const override { - CCState State(FI); + CCState State; // Lanai uses 4 registers to pass arguments unless the function has the // regparm attribute set. if (FI.getHasRegParm()) { @@ -10092,6 +10096,10 @@ namespace { class ARCABIInfo : public DefaultABIInfo { + struct CCState { + unsigned FreeRegs; + }; + public: using DefaultABIInfo::DefaultABIInfo; @@ -10114,7 +10122,7 @@ } void computeInfo(CGFunctionInfo &FI) const override { - CCState State(FI); + CCState State; // ARC uses 8 registers to pass arguments. State.FreeRegs = 8;
Index: clang/lib/CodeGen/TargetInfo.cpp =================================================================== --- clang/lib/CodeGen/TargetInfo.cpp +++ clang/lib/CodeGen/TargetInfo.cpp @@ -9071,13 +9071,17 @@ namespace { class LanaiABIInfo : public DefaultABIInfo { + struct CCState { + unsigned FreeRegs; + }; + public: LanaiABIInfo(CodeGen::CodeGenTypes &CGT) : DefaultABIInfo(CGT) {} bool shouldUseInReg(QualType Ty, CCState &State) const; void computeInfo(CGFunctionInfo &FI) const override { - CCState State(FI); + CCState State; // Lanai uses 4 registers to pass arguments unless the function has the // regparm attribute set. if (FI.getHasRegParm()) { @@ -10092,6 +10096,10 @@ namespace { class ARCABIInfo : public DefaultABIInfo { + struct CCState { + unsigned FreeRegs; + }; + public: using DefaultABIInfo::DefaultABIInfo; @@ -10114,7 +10122,7 @@ } void computeInfo(CGFunctionInfo &FI) const override { - CCState State(FI); + CCState State; // ARC uses 8 registers to pass arguments. State.FreeRegs = 8;
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits