From 67fe87fc5e57e7d93a3d1891adf81a3e18bfd86c Mon Sep 17 00:00:00 2001 From: Diego Novillo Date: Fri, 6 Dec 2013 17:58:19 +0000 Subject: [PATCH] Add flag -fauto-profile as alias to -fprofile-sample-use. Summary: GCC uses -fauto-profile to enable sample-based PGO. This patch adds it to Clang as an alias for -fprofile-sample-use. Differential Revision: http://llvm-reviews.chandlerc.com/D2353 llvm-svn: 196589 --- clang/include/clang/Driver/Options.td | 2 ++ clang/test/Driver/clang_f_opts.c | 3 +++ 2 files changed, 5 insertions(+) diff --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td index 9e7dc78d63cf..f80069591a3d 100644 --- a/clang/include/clang/Driver/Options.td +++ b/clang/include/clang/Driver/Options.td @@ -369,6 +369,8 @@ def fno_autolink : Flag <["-"], "fno-autolink">, Group, def fprofile_sample_use_EQ : Joined<["-"], "fprofile-sample-use=">, Group, Flags<[DriverOption, CC1Option]>, HelpText<"Enable sample-based profile guided optimizations">; +def fauto_profile_EQ : Joined<["-"], "fauto-profile=">, + Alias; def fblocks : Flag<["-"], "fblocks">, Group, Flags<[CC1Option]>, HelpText<"Enable the 'blocks' language feature">; diff --git a/clang/test/Driver/clang_f_opts.c b/clang/test/Driver/clang_f_opts.c index 8bf53e5e6dc3..70826d7299f3 100644 --- a/clang/test/Driver/clang_f_opts.c +++ b/clang/test/Driver/clang_f_opts.c @@ -54,6 +54,9 @@ // RUN: %clang -### -S -fprofile-sample-use=%S/Inputs/file.prof %s 2>&1 | FileCheck -check-prefix=CHECK-SAMPLE-PROFILE %s // CHECK-SAMPLE-PROFILE: "-fprofile-sample-use={{.*}}/file.prof" +// RUN: %clang -### -S -fauto-profile=%S/Inputs/file.prof %s 2>&1 | FileCheck -check-prefix=CHECK-AUTO-PROFILE %s +// CHECK-AUTO-PROFILE: "-fprofile-sample-use={{.*}}/file.prof" + // RUN: %clang -### -S -fvectorize %s 2>&1 | FileCheck -check-prefix=CHECK-VECTORIZE %s // RUN: %clang -### -S -fno-vectorize -fvectorize %s 2>&1 | FileCheck -check-prefix=CHECK-VECTORIZE %s // RUN: %clang -### -S -fno-vectorize %s 2>&1 | FileCheck -check-prefix=CHECK-NO-VECTORIZE %s