aboutsummaryrefslogtreecommitdiff
path: root/AST/Type.cpp
diff options
context:
space:
mode:
authorSteve Naroff <snaroff@apple.com>2007-08-01 23:45:51 +0000
committerSteve Naroff <snaroff@apple.com>2007-08-01 23:45:51 +0000
commit363bcff47df2fda3cfcfcd994b7888157df58c43 (patch)
tree292eb4d90e27aa308cc84f0b34eb72a2e7454c0e /AST/Type.cpp
parentd34e915f33224c508ad55fbf975bd10b7876e197 (diff)
- Finish hooking up support for __builtin_types_compatible_p().
- Fix type printing code for recently added TypeOfExpr/TypeOfType. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40700 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'AST/Type.cpp')
-rw-r--r--AST/Type.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/AST/Type.cpp b/AST/Type.cpp
index 63a681a52c..2ef457e453 100644
--- a/AST/Type.cpp
+++ b/AST/Type.cpp
@@ -654,15 +654,19 @@ void OCUVectorType::getAsStringInternal(std::string &S) const {
}
void TypeOfExpr::getAsStringInternal(std::string &InnerString) const {
+ if (!InnerString.empty()) // Prefix the basic type, e.g. 'typeof(e) X'.
+ InnerString = ' ' + InnerString;
std::ostringstream s;
getUnderlyingExpr()->print(s);
InnerString = "typeof(" + s.str() + ") " + InnerString;
}
-void TypeOfType::getAsStringInternal(std::string &S) const {
+void TypeOfType::getAsStringInternal(std::string &InnerString) const {
+ if (!InnerString.empty()) // Prefix the basic type, e.g. 'typeof(t) X'.
+ InnerString = ' ' + InnerString;
std::string Tmp;
getUnderlyingType().getAsStringInternal(Tmp);
- S += "typeof(" + Tmp + ")";
+ InnerString = "typeof(" + Tmp + ")" + InnerString;
}
void FunctionTypeNoProto::getAsStringInternal(std::string &S) const {