Googler | fae1a55 | 2022-03-04 13:02:38 +0000 | [diff] [blame] | 1 | // Part of the Crubit project, under the Apache License v2.0 with LLVM |
| 2 | // Exceptions. See /LICENSE for license information. |
| 3 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 4 | |
| 5 | #include "lifetime_annotations/pointee_type.h" |
| 6 | |
Martin Brænne | 1a207c5 | 2022-04-19 00:05:38 -0700 | [diff] [blame] | 7 | namespace clang { |
| 8 | namespace tidy { |
| 9 | namespace lifetimes { |
Googler | fae1a55 | 2022-03-04 13:02:38 +0000 | [diff] [blame] | 10 | |
Googler | fae1a55 | 2022-03-04 13:02:38 +0000 | [diff] [blame] | 11 | clang::QualType PointeeType(clang::QualType type) { |
Googler | fae1a55 | 2022-03-04 13:02:38 +0000 | [diff] [blame] | 12 | if (auto ptr_type = type->getAs<clang::PointerType>()) { |
| 13 | return ptr_type->getPointeeType(); |
| 14 | } else if (auto ref_type = type->getAs<clang::ReferenceType>()) { |
| 15 | return ref_type->getPointeeType(); |
| 16 | } |
| 17 | |
Googler | fae1a55 | 2022-03-04 13:02:38 +0000 | [diff] [blame] | 18 | return clang::QualType(); |
| 19 | } |
| 20 | |
Martin Brænne | 1a207c5 | 2022-04-19 00:05:38 -0700 | [diff] [blame] | 21 | } // namespace lifetimes |
| 22 | } // namespace tidy |
| 23 | } // namespace clang |