Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752253AbcKZRR1 (ORCPT ); Sat, 26 Nov 2016 12:17:27 -0500 Received: from mail-pf0-f193.google.com ([209.85.192.193]:35403 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751721AbcKZRRV (ORCPT ); Sat, 26 Nov 2016 12:17:21 -0500 Date: Sat, 26 Nov 2016 09:17:16 -0800 From: Alexei Starovoitov To: Wang Nan Cc: acme@redhat.com, ast@fb.com, lizefan@huawei.com, hekuang@huawei.com, linux-kernel@vger.kernel.org, pi3orama@163.com, joe@ovn.org, Jiri Olsa Subject: Re: [PATCH v3 10/30] perf clang: Add builtin clang support ant test case Message-ID: <20161126171715.GE83987@ast-mbp.thefacebook.com> References: <20161126070354.141764-1-wangnan0@huawei.com> <20161126070354.141764-11-wangnan0@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161126070354.141764-11-wangnan0@huawei.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1286 Lines: 45 On Sat, Nov 26, 2016 at 07:03:34AM +0000, Wang Nan wrote: > Add basic clang support in clang.cpp and test__clang() testcase. The > first testcase checks if builtin clang is able to generate LLVM IR. > > tests/clang.c is a proxy. Real testcase resides in > utils/c++/clang-test.cpp in c++ and exports C interface to perf test > subsystem. > > Test result: > > $ perf test -v clang > 51: Test builtin clang support : > 51.1: Test builtin clang compile C source to IR : > --- start --- > test child forked, pid 13215 > test child finished with 0 > ---- end ---- > Test builtin clang support subtest 0: Ok > > Signed-off-by: Wang Nan ... > +static CompilerInvocation * > +createCompilerInvocation(StringRef& Path, DiagnosticsEngine& Diags) > +{ > + llvm::opt::ArgStringList CCArgs { > + "-cc1", > + "-triple", "bpf-pc-linux", > + "-fsyntax-only", > + "-ferror-limit", "19", > + "-fmessage-length", "127", why such limits? > + "-O2", > + "-nostdsysteminc", > + "-nobuiltininc", > + "-vectorize-loops", > + "-vectorize-slp", why above two flags are needed? > + "-Wno-unused-value", > + "-Wno-pointer-sign", these two -Wno makes sense. please add the comment to explain the reasons.