[llvm] r175739 - Code review cleanup for r175697
Hal Finkel
hfinkel at anl.gov
Thu Feb 21 09:08:52 PST 2013
----- Original Message -----
> From: "Bill Schmidt" <wschmidt at linux.vnet.ibm.com>
> To: "David Blaikie" <dblaikie at gmail.com>
> Cc: llvm-commits at cs.uiuc.edu
> Sent: Thursday, February 21, 2013 10:59:33 AM
> Subject: Re: [llvm] r175739 - Code review cleanup for r175697
>
> On Thu, 2013-02-21 at 08:35 -0800, David Blaikie wrote:
> >
> >
> >
> > On Thu, Feb 21, 2013 at 6:35 AM, Bill Schmidt
> > <wschmidt at linux.vnet.ibm.com> wrote:
> > Author: wschmidt
> > Date: Thu Feb 21 08:35:42 2013
> > New Revision: 175739
> >
> > URL:
> > http://llvm.org/viewvc/llvm-project?rev=175739&view=rev
> > Log:
> > Code review cleanup for r175697
> >
> > Modified:
> > llvm/trunk/lib/Target/PowerPC/PPCISelDAGToDAG.cpp
> >
> > Modified: llvm/trunk/lib/Target/PowerPC/PPCISelDAGToDAG.cpp
> > URL:
> > http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCISelDAGToDAG.cpp?rev=175739&r1=175738&r2=175739&view=diff
> > ==============================================================================
> > --- llvm/trunk/lib/Target/PowerPC/PPCISelDAGToDAG.cpp
> > (original)
> > +++ llvm/trunk/lib/Target/PowerPC/PPCISelDAGToDAG.cpp Thu
> > Feb
> > 21 08:35:42 2013
> > @@ -1524,20 +1524,16 @@ void
> > PPCDAGToDAGISel::PostprocessISelDAG
> > // If the relocation information isn't already present
> > on
> > the
> > // immediate operand, add it now.
> > if (ReplaceFlags) {
> > - GlobalAddressSDNode *GA =
> > dyn_cast<GlobalAddressSDNode>(ImmOpnd);
> > -
> > - if (GA) {
> > + if (GlobalAddressSDNode *GA =
> > dyn_cast<GlobalAddressSDNode>(ImmOpnd)) {
> > DebugLoc dl = GA->getDebugLoc();
> > const GlobalValue *GV = GA->getGlobal();
> > ImmOpnd = CurDAG->getTargetGlobalAddress(GV, dl,
> > MVT::i64, 0, Flags);
> > - } else {
> > - ConstantPoolSDNode *CP =
> > dyn_cast<ConstantPoolSDNode>(ImmOpnd);
> > - if (CP) {
> > - const Constant *C = CP->getConstVal();
> > - ImmOpnd = CurDAG->getTargetConstantPool(C,
> > MVT::i64,
> > -
> > CP->getAlignment(),
> > - 0,
> > Flags);
> > - }
> > + }
> > + else if (ConstantPoolSDNode *CP =
> > dyn_cast<ConstantPoolSDNode>(ImmOpnd)) {
> >
> >
> > Still got a }\nelse here that's not usually the way we write it.
> > Might
> > I suggest clang-format as a good place to start? It does wrap a few
> > things strangely (bugs welcome) but should get you in the ballpark
> > pretty quickly.
>
> That was a conscious choice to keep from having to break the line
> containing all the ConstantPoolSDNode nonsense -- it just looked
> cleaner
> to me to do it this way in this one instance. If you prefer, I can
> change it to follow the convention, but break the line up. /shrug
I think the general preference is to keep the else on the same line with the brace, even if that breaks the line.
-Hal
>
> Bill
>
> >
> > + const Constant *C = CP->getConstVal();
> > + ImmOpnd = CurDAG->getTargetConstantPool(C,
> > MVT::i64,
> > +
> > CP->getAlignment(),
> > + 0, Flags);
> > }
> > }
> >
> >
> >
> > _______________________________________________
> > llvm-commits mailing list
> > llvm-commits at cs.uiuc.edu
> > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
> >
> >
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
More information about the llvm-commits
mailing list