aboutsummaryrefslogtreecommitdiff
path: root/AST/ASTContext.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'AST/ASTContext.cpp')
-rw-r--r--AST/ASTContext.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/AST/ASTContext.cpp b/AST/ASTContext.cpp
index a9fb81faad..6f7165101e 100644
--- a/AST/ASTContext.cpp
+++ b/AST/ASTContext.cpp
@@ -584,6 +584,18 @@ QualType ASTContext::getTypedefType(TypedefDecl *Decl) {
return QualType(Decl->TypeForDecl, 0);
}
+QualType ASTContext::getTypeOfType(Expr *tofExpr) {
+ QualType Canonical = tofExpr->getType().getCanonicalType();
+ // Note: TypeOfExpr's aren't uniqued.
+ return QualType(new TypeOfExpr(tofExpr, Canonical), 0);
+}
+
+QualType ASTContext::getTypeOfType(QualType tofType) {
+ QualType Canonical = tofType.getCanonicalType();
+ // Note: TypeOfType's aren't uniqued.
+ return QualType(new TypeOfType(tofType, Canonical), 0);
+}
+
/// getTagDeclType - Return the unique reference to the type for the
/// specified TagDecl (struct/union/class/enum) decl.
QualType ASTContext::getTagDeclType(TagDecl *Decl) {