On Mon, Dec 7, 2015 at 3:20 PM, David Blaikie <dblai...@gmail.com> wrote:
> Index: lib/AST/RecordLayoutBuilder.cpp >> =================================================================== >> --- lib/AST/RecordLayoutBuilder.cpp >> +++ lib/AST/RecordLayoutBuilder.cpp >> @@ -1996,6 +1996,16 @@ >> bool allowInlineFunctions = >> Context.getTargetInfo().getCXXABI().canKeyFunctionBeInline(); >> >> + if (Context.getLangOpts().CUDA) { >> + const bool IsDevice = Context.getLangOpts().CUDAIsDevice; >> > > Guess you intended to use this local variable, but didn't? ^ > > Yup. Leftover from reshuffling the code. Nuked. > + for (const CXXMethodDecl *MD : RD->methods()) >> + if (Context.getLangOpts().CUDAIsDevice && >> !MD->hasAttr<CUDADeviceAttr>()) >> + return nullptr; >> + else if (!Context.getLangOpts().CUDAIsDevice && >> > > Drop the else after return (just "if/return/if/return") > (and/or you could roll both conditions into one if test - potentially even > using "std::any_of" (or llvm::any_of)) > > Nice. It might be just the function to do the job. --Artem
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits