diff options
author | Steve Naroff <snaroff@apple.com> | 2007-07-31 12:34:36 +0000 |
---|---|---|
committer | Steve Naroff <snaroff@apple.com> | 2007-07-31 12:34:36 +0000 |
commit | d1861fd633d5096a00777c918eb8575ea7162fe7 (patch) | |
tree | cd71c78f1c513b18ab427f6036aa2debdcb7d93a /AST/Type.cpp | |
parent | 8a2bc625e86983e250ed31040695a870a767196b (diff) |
Add parsing and AST support for GNU "typeof".
Many small changes to lot's of files.
Still some FIXME's, however the basic support is in place.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40631 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'AST/Type.cpp')
-rw-r--r-- | AST/Type.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/AST/Type.cpp b/AST/Type.cpp index 214dbea488..ecade56706 100644 --- a/AST/Type.cpp +++ b/AST/Type.cpp @@ -638,6 +638,18 @@ void OCUVectorType::getAsStringInternal(std::string &S) const { ElementType.getAsStringInternal(S); } +void TypeOfExpr::getAsStringInternal(std::string &InnerString) const { + // FIXME: output expression, getUnderlyingExpr()->print(). + // At the moment, Stmt::print(std::ostream) doesn't work for us here. + InnerString = "typeof(<expr>) " + InnerString; +} + +void TypeOfType::getAsStringInternal(std::string &S) const { + std::string Tmp; + getUnderlyingType().getAsStringInternal(Tmp); + S += "typeof(" + Tmp + ")"; +} + void FunctionTypeNoProto::getAsStringInternal(std::string &S) const { // If needed for precedence reasons, wrap the inner part in grouping parens. if (!S.empty()) |