aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaType.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Sema/SemaType.cpp')
-rw-r--r--lib/Sema/SemaType.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/Sema/SemaType.cpp b/lib/Sema/SemaType.cpp
index e898782f31..7049a301f7 100644
--- a/lib/Sema/SemaType.cpp
+++ b/lib/Sema/SemaType.cpp
@@ -835,3 +835,17 @@ bool Sema::DiagnoseIncompleteType(SourceLocation Loc, QualType T, unsigned diag,
return true;
}
+
+/// \brief Determine whether the given types are equivalent.
+bool Sema::hasSameType(QualType T1, QualType T2) {
+ return Context.getCanonicalType(T1) == Context.getCanonicalType(T2);
+}
+
+/// \brief Determine whether the given types are equivalent after
+/// cvr-qualifiers have been removed.
+bool Sema::hasSameUnqualifiedType(QualType T1, QualType T2) {
+ T1 = Context.getCanonicalType(T1);
+ T2 = Context.getCanonicalType(T2);
+ return T1.getUnqualifiedType() == T2.getUnqualifiedType();
+}
+