forked from OSchip/llvm-project
[flang] Added preprocessor directives to limit the use of non-inline ExpressionBase<A>::derived to GCC on Mac (inlined on all other platforms)
Original-commit: flang-compiler/f18@b38b31909a Reviewed-on: https://github.com/flang-compiler/f18/pull/248
This commit is contained in:
parent
b61b31dfcd
commit
778e615158
|
@ -189,6 +189,7 @@ template<typename T> DynamicType ArrayConstructor<T>::GetType() const {
|
||||||
return result.GetType();
|
return result.GetType();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(__APPLE__) && defined(__GNUC__)
|
||||||
template<typename A>
|
template<typename A>
|
||||||
typename ExpressionBase<A>::Derived &ExpressionBase<A>::derived() {
|
typename ExpressionBase<A>::Derived &ExpressionBase<A>::derived() {
|
||||||
return *static_cast<Derived *>(this);
|
return *static_cast<Derived *>(this);
|
||||||
|
@ -198,6 +199,7 @@ template<typename A>
|
||||||
const typename ExpressionBase<A>::Derived &ExpressionBase<A>::derived() const {
|
const typename ExpressionBase<A>::Derived &ExpressionBase<A>::derived() const {
|
||||||
return *static_cast<const Derived *>(this);
|
return *static_cast<const Derived *>(this);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
template<typename A>
|
template<typename A>
|
||||||
std::optional<DynamicType> ExpressionBase<A>::GetType() const {
|
std::optional<DynamicType> ExpressionBase<A>::GetType() const {
|
||||||
|
|
|
@ -68,8 +68,13 @@ public:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
using Derived = Expr<Result>;
|
using Derived = Expr<Result>;
|
||||||
|
#if defined(__APPLE__) && defined(__GNUC__)
|
||||||
Derived &derived();
|
Derived &derived();
|
||||||
const Derived &derived() const;
|
const Derived &derived() const;
|
||||||
|
#else
|
||||||
|
Derived &derived() { return *static_cast<Derived *>(this); }
|
||||||
|
const Derived &derived() const { return *static_cast<const Derived *>(this); }
|
||||||
|
#endif
|
||||||
|
|
||||||
public:
|
public:
|
||||||
template<typename A> Derived &operator=(const A &x) {
|
template<typename A> Derived &operator=(const A &x) {
|
||||||
|
|
Loading…
Reference in New Issue