diff options
author | Francois Pichet <pichet2000@gmail.com> | 2010-09-08 12:20:18 +0000 |
---|---|---|
committer | Francois Pichet <pichet2000@gmail.com> | 2010-09-08 12:20:18 +0000 |
commit | 01b7c3028da5bbcb9f8e52ba67e4613070de0e60 (patch) | |
tree | 5f6b37f01f1f28b36b43f6ba76a4a50f69cd14d5 /lib/AST/ExprCXX.cpp | |
parent | 538e0d0292cab16198a4fce5c388ff06adc74d0c (diff) |
Microsoft's __uuidof operator implementation part 1.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113356 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/ExprCXX.cpp')
-rw-r--r-- | lib/AST/ExprCXX.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/AST/ExprCXX.cpp b/lib/AST/ExprCXX.cpp index 8caf70b3e1..f72ab98eb8 100644 --- a/lib/AST/ExprCXX.cpp +++ b/lib/AST/ExprCXX.cpp @@ -39,6 +39,22 @@ Stmt::child_iterator CXXTypeidExpr::child_end() { : reinterpret_cast<Stmt **>(&Operand) + 1; } +QualType CXXUuidofExpr::getTypeOperand() const { + assert(isTypeOperand() && "Cannot call getTypeOperand for __uuidof(expr)"); + return Operand.get<TypeSourceInfo *>()->getType().getNonReferenceType() + .getUnqualifiedType(); +} + +// CXXUuidofExpr - has child iterators if the operand is an expression +Stmt::child_iterator CXXUuidofExpr::child_begin() { + return isTypeOperand() ? child_iterator() + : reinterpret_cast<Stmt **>(&Operand); +} +Stmt::child_iterator CXXUuidofExpr::child_end() { + return isTypeOperand() ? child_iterator() + : reinterpret_cast<Stmt **>(&Operand) + 1; +} + // CXXBoolLiteralExpr Stmt::child_iterator CXXBoolLiteralExpr::child_begin() { return child_iterator(); |