On Thu, Sep 19, 2013 at 8:31 AM, Adrian Prantl <[email protected]> wrote: > > On Sep 18, 2013, at 11:29 PM, Tobias Grosser <[email protected]> wrote: > >> On 09/19/2013 12:18 AM, Adrian Prantl wrote: >>> Author: adrian >>> Date: Wed Sep 18 17:18:17 2013 >>> New Revision: 190962 >>> >>> URL: http://llvm.org/viewvc/llvm-project?rev=190962&view=rev >>> Log: >>> get rid of extra parentheses. >> >> Hi Adrian, >> >> I have the feeling this change is contrary to what people normally do in >> LLVM. Specifically, either people have parenthesis on all branches or >> we use none at all. > > You might want to discuss this with Eric :-) >
Normally I'd point you at the coding style doc which should have this, however, it apparently doesn't. In general for single line statements after a conditional we don't have braces - except where we would need to quiet a dangling else warning. I'm curious where you've seen contrary (except apparently some bad cases in the coding style doc). -eric > adrian > > On Sep 18, 2013, at 3:18 PM, Eric Christopher <[email protected]> wrote: > >> On Wed, Sep 18, 2013 at 3:08 PM, Adrian Prantl <[email protected]> wrote: >>> Author: adrian >>> Date: Wed Sep 18 17:08:57 2013 >>> New Revision: 190960 >>> >>> URL: http://llvm.org/viewvc/llvm-project?rev=190960&view=rev >>> Log: >>> Debug info: Explicitly set the DIVariable::isIndirect() flag for VLAs. >>> This allows us to get rid of an ugly hack in the backend. >>> Paired commit with LLVM. >>> >>> Modified: >>> cfe/trunk/lib/CodeGen/CGDebugInfo.cpp >>> cfe/trunk/test/CodeGen/debug-info-vla.c >>> >>> Modified: cfe/trunk/lib/CodeGen/CGDebugInfo.cpp >>> URL: >>> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.cpp?rev=190960&r1=190959&r2=190960&view=diff >>> ============================================================================== >>> --- cfe/trunk/lib/CodeGen/CGDebugInfo.cpp (original) >>> +++ cfe/trunk/lib/CodeGen/CGDebugInfo.cpp Wed Sep 18 17:08:57 2013 >>> @@ -2747,6 +2747,8 @@ void CGDebugInfo::EmitDeclare(const VarD >>> DBuilder.insertDeclare(Storage, D, Builder.GetInsertBlock()); >>> Call->setDebugLoc(llvm::DebugLoc::get(Line, Column, Scope)); >>> return; >>> + } else if (isa<VariableArrayType>(VD->getType())) { >>> + Flags |= llvm::DIDescriptor::FlagIndirectVariable; >>> } >> >> Extra parens. >> >> -eric >> >>> } else if (const RecordType *RT = dyn_cast<RecordType>(VD->getType())) { >>> // If VD is an anonymous union then Storage represents value for >>> >>> Modified: cfe/trunk/test/CodeGen/debug-info-vla.c >>> URL: >>> http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/debug-info-vla.c?rev=190960&r1=190959&r2=190960&view=diff >>> ============================================================================== >>> --- cfe/trunk/test/CodeGen/debug-info-vla.c (original) >>> +++ cfe/trunk/test/CodeGen/debug-info-vla.c Wed Sep 18 17:08:57 2013 >>> @@ -2,7 +2,7 @@ >>> >>> void testVLAwithSize(int s) >>> { >>> -// CHECK: metadata !{i32 {{.*}}, metadata {{.*}}, metadata !"vla", >>> metadata {{.*}}, i32 [[@LINE+1]], metadata {{.*}}, i32 0, i32 0} ; [ >>> DW_TAG_auto_variable ] [vla] [line [[@LINE+1]]] >>> +// CHECK: metadata !{i32 {{.*}}, metadata {{.*}}, metadata !"vla", >>> metadata {{.*}}, i32 [[@LINE+1]], metadata {{.*}}, i32 8192, i32 0} ; [ >>> DW_TAG_auto_variable ] [vla] [line [[@LINE+1]]] >>> int vla[s]; >>> int i; >>> for (i = 0; i < s; i++) { >>> >>> >>> _______________________________________________ >>> cfe-commits mailing list >>> [email protected] >>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits > _______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
