diff options
author | Aaron Ballman <aaron@aaronballman.com> | 2017-02-11 18:00:32 +0000 |
---|---|---|
committer | Aaron Ballman <aaron@aaronballman.com> | 2017-02-11 18:00:32 +0000 |
commit | 5c092a34385d67892538524f10268078e1eb12ed (patch) | |
tree | 468dfb0f15277ae6a8e39949886b0bed1faf8ccb | |
parent | 3dcb85b01f2d4ecbd1616579e9f96391e509aa38 (diff) | |
download | bcm5719-llvm-5c092a34385d67892538524f10268078e1eb12ed.tar.gz bcm5719-llvm-5c092a34385d67892538524f10268078e1eb12ed.zip |
Hopefully fixes a compile error introduced by r294861.
llvm-svn: 294862
-rw-r--r-- | clang/include/clang/AST/TypeLoc.h | 35 |
1 files changed, 19 insertions, 16 deletions
diff --git a/clang/include/clang/AST/TypeLoc.h b/clang/include/clang/AST/TypeLoc.h index 946e555a506..525f848a9fa 100644 --- a/clang/include/clang/AST/TypeLoc.h +++ b/clang/include/clang/AST/TypeLoc.h @@ -75,22 +75,7 @@ public: /// adjustments from a type that wad written as a T to another type that is /// still canonically a T (ignores parens, attributes, elaborated types, etc). template <typename T> - T getAsAdjusted() const { - TypeLoc Cur = *this; - while (!T::isKind(Cur)) { - if (auto PTL = Cur.getAs<ParenTypeLoc>()) - Cur = PTL.getInnerLoc(); - else if (auto ATL = Cur.getAs<AttributedTypeLoc>()) - Cur = ATL.getModifiedLoc(); - else if (auto ETL = Cur.getAs<ElaboratedTypeLoc>()) - Cur = ETL.getNamedTypeLoc(); - else if (auto ATL = Cur.getAs<AdjustedTypeLoc>()) - Cur = ATL.getOriginalLoc(); - else - break; - } - return Cur.getAs<T>(); - } + T getAsAdjusted() const; /// The kinds of TypeLocs. Equivalent to the Type::TypeClass enum, /// except it also defines a Qualified enum that corresponds to the @@ -2210,6 +2195,24 @@ public: QualType getInnerType() const { return this->getTypePtr()->getElementType(); } }; + +template <typename T> +inline T TypeLoc::getAsAdjusted() const { + TypeLoc Cur = *this; + while (!T::isKind(Cur)) { + if (auto PTL = Cur.getAs<ParenTypeLoc>()) + Cur = PTL.getInnerLoc(); + else if (auto ATL = Cur.getAs<AttributedTypeLoc>()) + Cur = ATL.getModifiedLoc(); + else if (auto ETL = Cur.getAs<ElaboratedTypeLoc>()) + Cur = ETL.getNamedTypeLoc(); + else if (auto ATL = Cur.getAs<AdjustedTypeLoc>()) + Cur = ATL.getOriginalLoc(); + else + break; + } + return Cur.getAs<T>(); +} } #endif |