diff options
Diffstat (limited to 'lib/AST/TypeLoc.cpp')
| -rw-r--r-- | lib/AST/TypeLoc.cpp | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/lib/AST/TypeLoc.cpp b/lib/AST/TypeLoc.cpp index 78947d18f953d..7242858f21e64 100644 --- a/lib/AST/TypeLoc.cpp +++ b/lib/AST/TypeLoc.cpp @@ -16,10 +16,9 @@ #include "clang/AST/Expr.h" #include "clang/AST/TypeLocVisitor.h" #include "llvm/Support/ErrorHandling.h" -#include "llvm/Support/raw_ostream.h" using namespace clang; -static const unsigned TypeLocMaxDataAlign = llvm::alignOf<void *>(); +static const unsigned TypeLocMaxDataAlign = alignof(void *); //===----------------------------------------------------------------------===// // TypeLoc Implementation @@ -211,7 +210,7 @@ SourceLocation TypeLoc::getEndLoc() const { switch (Cur.getTypeLocClass()) { default: if (!Last) - Last = Cur; + Last = Cur; return Last.getLocalSourceRange().getEnd(); case Paren: case ConstantArray: @@ -389,6 +388,17 @@ TypeLoc TypeLoc::findExplicitQualifierLoc() const { return TypeLoc(); } +void ObjCTypeParamTypeLoc::initializeLocal(ASTContext &Context, + SourceLocation Loc) { + setNameLoc(Loc); + if (!getNumProtocols()) return; + + setProtocolLAngleLoc(Loc); + setProtocolRAngleLoc(Loc); + for (unsigned i = 0, e = getNumProtocols(); i != e; ++i) + setProtocolLoc(i, Loc); +} + void ObjCObjectTypeLoc::initializeLocal(ASTContext &Context, SourceLocation Loc) { setHasBaseTypeAsWritten(true); |
