aboutsummaryrefslogtreecommitdiff
path: root/lib/Target/CBackend/CBackend.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Target/CBackend/CBackend.cpp')
-rw-r--r--lib/Target/CBackend/CBackend.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Target/CBackend/CBackend.cpp b/lib/Target/CBackend/CBackend.cpp
index f0f5507897..3b8c67d45b 100644
--- a/lib/Target/CBackend/CBackend.cpp
+++ b/lib/Target/CBackend/CBackend.cpp
@@ -244,7 +244,8 @@ ostream &CWriter::printType(const Type *Ty, const string &NameSoFar,
// Do not need parens around "* NameSoFar" if NameSoFar consists only
// of zero or more '*' chars *and* this is not an unnamed pointer type
// such as the result type in a cast statement. Otherwise, enclose in ( ).
- if (ptrTypeNameNeedsParens(NameSoFar) || !namedContext)
+ if (ptrTypeNameNeedsParens(NameSoFar) || !namedContext ||
+ PTy->getElementType()->getPrimitiveID() == Type::ArrayTyID)
ptrName = "(" + ptrName + ")"; //
return printType(PTy->getElementType(), ptrName);