Add parens around constant calls to getelemptr to properly associate the reference
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4032 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Target/CBackend/CBackend.cpp b/lib/Target/CBackend/CBackend.cpp
index 645832c..bc2106d 100644
--- a/lib/Target/CBackend/CBackend.cpp
+++ b/lib/Target/CBackend/CBackend.cpp
@@ -337,10 +337,10 @@
return;
case Instruction::GetElementPtr:
- Out << "&(";
+ Out << "(&(";
printIndexingExpression(CPV->getOperand(0),
CPV->op_begin()+1, CPV->op_end());
- Out << ")";
+ Out << "))";
return;
case Instruction::Add:
Out << "(";