aboutsummaryrefslogtreecommitdiff
path: root/AST/Type.cpp
diff options
context:
space:
mode:
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 {