From c72c57c9e9b69944e3e009cd5e209634839581d3 Mon Sep 17 00:00:00 2001 From: dim Date: Mon, 8 Apr 2013 18:45:10 +0000 Subject: Vendor import of clang trunk r178860: http://llvm.org/svn/llvm-project/cfe/trunk@178860 --- lib/AST/Comment.cpp | 40 +++++++++++++--------------------------- 1 file changed, 13 insertions(+), 27 deletions(-) (limited to 'lib/AST/Comment.cpp') diff --git a/lib/AST/Comment.cpp b/lib/AST/Comment.cpp index 361f8ac..db55c04 100644 --- a/lib/AST/Comment.cpp +++ b/lib/AST/Comment.cpp @@ -32,20 +32,6 @@ const char *Comment::getCommentKindName() const { llvm_unreachable("Unknown comment kind!"); } -void Comment::dump() const { - // It is important that Comment::dump() is defined in a different TU than - // Comment::dump(raw_ostream, SourceManager). If both functions were defined - // in CommentDumper.cpp, that object file would be removed by linker because - // none of its functions are referenced by other object files, despite the - // LLVM_ATTRIBUTE_USED. - dump(llvm::errs(), NULL, NULL); -} - -void Comment::dump(const ASTContext &Context) const { - dump(llvm::errs(), &Context.getCommentCommandTraits(), - &Context.getSourceManager()); -} - namespace { struct good {}; struct bad {}; @@ -255,32 +241,32 @@ void DeclInfo::fill() { while (true) { TL = TL.IgnoreParens(); // Look through qualified types. - if (QualifiedTypeLoc *QualifiedTL = dyn_cast(&TL)) { - TL = QualifiedTL->getUnqualifiedLoc(); + if (QualifiedTypeLoc QualifiedTL = TL.getAs()) { + TL = QualifiedTL.getUnqualifiedLoc(); continue; } // Look through pointer types. - if (PointerTypeLoc *PointerTL = dyn_cast(&TL)) { - TL = PointerTL->getPointeeLoc().getUnqualifiedLoc(); + if (PointerTypeLoc PointerTL = TL.getAs()) { + TL = PointerTL.getPointeeLoc().getUnqualifiedLoc(); continue; } - if (BlockPointerTypeLoc *BlockPointerTL = - dyn_cast(&TL)) { - TL = BlockPointerTL->getPointeeLoc().getUnqualifiedLoc(); + if (BlockPointerTypeLoc BlockPointerTL = + TL.getAs()) { + TL = BlockPointerTL.getPointeeLoc().getUnqualifiedLoc(); continue; } - if (MemberPointerTypeLoc *MemberPointerTL = - dyn_cast(&TL)) { - TL = MemberPointerTL->getPointeeLoc().getUnqualifiedLoc(); + if (MemberPointerTypeLoc MemberPointerTL = + TL.getAs()) { + TL = MemberPointerTL.getPointeeLoc().getUnqualifiedLoc(); continue; } // Is this a typedef for a function type? - if (FunctionTypeLoc *FTL = dyn_cast(&TL)) { + if (FunctionTypeLoc FTL = TL.getAs()) { Kind = FunctionKind; - ArrayRef Params = FTL->getParams(); + ArrayRef Params = FTL.getParams(); ParamVars = ArrayRef(Params.data(), Params.size()); - ResultType = FTL->getResultLoc().getType(); + ResultType = FTL.getResultLoc().getType(); break; } break; -- cgit v1.1