mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-24 19:52:54 +01:00
Parenthesis are now added to casts of type array.
llvm-svn: 3892
This commit is contained in:
parent
2a53929c5d
commit
cb0b25c6c1
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user