mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-16 14:31:59 +00:00
Parenthesis are now added to casts of type array.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3892 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
c017d9132a
commit
c14ded4858
@ -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);
|
||||
|
@ -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…
x
Reference in New Issue
Block a user