[clang] 36f480f - Revert "[CUDA][HIP][OpenMP] Add lib/Sema/UsedDeclVisitor.h after D70172"
Yaxun Liu via cfe-commits
cfe-commits at lists.llvm.org
Tue Feb 18 11:46:23 PST 2020
Author: Yaxun (Sam) Liu
Date: 2020-02-18T14:45:34-05:00
New Revision: 36f480f22c25d5bb253db77f46cf089d16318e6b
URL: https://github.com/llvm/llvm-project/commit/36f480f22c25d5bb253db77f46cf089d16318e6b
DIFF: https://github.com/llvm/llvm-project/commit/36f480f22c25d5bb253db77f46cf089d16318e6b.diff
LOG: Revert "[CUDA][HIP][OpenMP] Add lib/Sema/UsedDeclVisitor.h after D70172"
This reverts commit c7fa409bcadaf4ddba1862b2e52349e0ab03d1b4.
Added:
Modified:
Removed:
clang/lib/Sema/UsedDeclVisitor.h
################################################################################
diff --git a/clang/lib/Sema/UsedDeclVisitor.h b/clang/lib/Sema/UsedDeclVisitor.h
deleted file mode 100644
index 440029a1d567..000000000000
--- a/clang/lib/Sema/UsedDeclVisitor.h
+++ /dev/null
@@ -1,70 +0,0 @@
-//===- UsedDeclVisitor.h - ODR-used declarations visitor --------*- C++ -*-===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//===----------------------------------------------------------------------===//
-//
-// This file defines UsedDeclVisitor, a CRTP class which visits all the
-// declarations that are ODR-used by an expression or statement.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_CLANG_LIB_SEMA_USEDDECLVISITOR_H
-#define LLVM_CLANG_LIB_SEMA_USEDDECLVISITOR_H
-
-#include "clang/AST/EvaluatedExprVisitor.h"
-#include "clang/Sema/SemaInternal.h"
-
-namespace clang {
-template <class Derived>
-class UsedDeclVisitor : public EvaluatedExprVisitor<Derived> {
-protected:
- Sema &S;
-
-public:
- typedef EvaluatedExprVisitor<Derived> Inherited;
-
- UsedDeclVisitor(Sema &S) : Inherited(S.Context), S(S) {}
-
- Derived &asImpl() { return *static_cast<Derived *>(this); }
-
- void VisitCXXBindTemporaryExpr(CXXBindTemporaryExpr *E) {
- asImpl().visitUsedDecl(
- E->getBeginLoc(),
- const_cast<CXXDestructorDecl *>(E->getTemporary()->getDestructor()));
- asImpl().Visit(E->getSubExpr());
- }
-
- void VisitCXXNewExpr(CXXNewExpr *E) {
- if (E->getOperatorNew())
- asImpl().visitUsedDecl(E->getBeginLoc(), E->getOperatorNew());
- if (E->getOperatorDelete())
- asImpl().visitUsedDecl(E->getBeginLoc(), E->getOperatorDelete());
- Inherited::VisitCXXNewExpr(E);
- }
-
- void VisitCXXDeleteExpr(CXXDeleteExpr *E) {
- if (E->getOperatorDelete())
- asImpl().visitUsedDecl(E->getBeginLoc(), E->getOperatorDelete());
- QualType Destroyed = S.Context.getBaseElementType(E->getDestroyedType());
- if (const RecordType *DestroyedRec = Destroyed->getAs<RecordType>()) {
- CXXRecordDecl *Record = cast<CXXRecordDecl>(DestroyedRec->getDecl());
- asImpl().visitUsedDecl(E->getBeginLoc(), S.LookupDestructor(Record));
- }
-
- Inherited::VisitCXXDeleteExpr(E);
- }
-
- void VisitCXXConstructExpr(CXXConstructExpr *E) {
- asImpl().visitUsedDecl(E->getBeginLoc(), E->getConstructor());
- Inherited::VisitCXXConstructExpr(E);
- }
-
- void VisitCXXDefaultArgExpr(CXXDefaultArgExpr *E) {
- asImpl().Visit(E->getExpr());
- }
-};
-} // end namespace clang
-
-#endif // LLVM_CLANG_LIB_SEMA_USEDDECLVISITOR_H
More information about the cfe-commits
mailing list