From: Fangrui Song Date: Wed, 17 Jun 2020 19:59:02 +0000 (-0700) Subject: [Driver] Delete CC1 -fxray-function-index and clean up some tests X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f39000b4505bcfe3d2fcf23487096fb4703082bd;p=platform%2Fupstream%2Fllvm.git [Driver] Delete CC1 -fxray-function-index and clean up some tests --- diff --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td index 9ea0016..86d8936 100644 --- a/clang/include/clang/Driver/Options.td +++ b/clang/include/clang/Driver/Options.td @@ -1280,12 +1280,8 @@ defm xray_always_emit_typedevents : OptInFFlag<"xray-always-emit-typedevents", defm xray_ignore_loops : OptInFFlag<"xray-ignore-loops", "Don't instrument functions with loops unless they also meet the minimum function size">; - -def fxray_function_index : Flag<["-"], "fxray-function-index">, - Group, Flags<[CC1Option]>; -def fno_xray_function_index : Flag<["-"], "fno-xray-function-index">, - Group, Flags<[CC1Option]>, - HelpText<"Omit the xray index section to reduce binary size at the expense of single-function patching performance">; +defm xray_function_index : OptOutFFlag<"xray-function-index", "", + "Omit function index section at the expense of single-function patching performance">; def fxray_link_deps : Flag<["-"], "fxray-link-deps">, Group, Flags<[CC1Option]>, diff --git a/clang/include/clang/Driver/XRayArgs.h b/clang/include/clang/Driver/XRayArgs.h index 22ab5fd..2f055e5 100644 --- a/clang/include/clang/Driver/XRayArgs.h +++ b/clang/include/clang/Driver/XRayArgs.h @@ -31,7 +31,7 @@ class XRayArgs { bool XRayAlwaysEmitTypedEvents = false; bool XRayRT = true; bool XRayIgnoreLoops = false; - bool XRayOmitFunctionIndex = false; + bool XRayFunctionIndex; public: /// Parses the XRay arguments from an argument list. diff --git a/clang/lib/Driver/XRayArgs.cpp b/clang/lib/Driver/XRayArgs.cpp index 44a5d0d..f00c390 100644 --- a/clang/lib/Driver/XRayArgs.cpp +++ b/clang/lib/Driver/XRayArgs.cpp @@ -105,9 +105,8 @@ XRayArgs::XRayArgs(const ToolChain &TC, const ArgList &Args) { options::OPT_fno_xray_ignore_loops, false)) XRayIgnoreLoops = true; - if (!Args.hasFlag(options::OPT_fxray_function_index, - options::OPT_fno_xray_function_index, true)) - XRayOmitFunctionIndex = true; + XRayFunctionIndex = Args.hasFlag(options::OPT_fxray_function_index, + options::OPT_fno_xray_function_index, true); auto Bundles = Args.getAllArgValues(options::OPT_fxray_instrumentation_bundle); @@ -208,7 +207,7 @@ void XRayArgs::addArgs(const ToolChain &TC, const ArgList &Args, if (XRayIgnoreLoops) CmdArgs.push_back("-fxray-ignore-loops"); - if (XRayOmitFunctionIndex) + if (!XRayFunctionIndex) CmdArgs.push_back("-fno-xray-function-index"); CmdArgs.push_back(Args.MakeArgString(Twine(XRayInstructionThresholdOption) + diff --git a/clang/test/Driver/XRay/xray-function-index-flags.cpp b/clang/test/Driver/XRay/xray-function-index-flags.cpp index 8bb05ce..f0d1a8a 100644 --- a/clang/test/Driver/XRay/xray-function-index-flags.cpp +++ b/clang/test/Driver/XRay/xray-function-index-flags.cpp @@ -2,19 +2,11 @@ // options respect the -fno-xray-function-index flag we provide in the // invocation. The default should be to *include* the function index. // -// RUN: %clang -fxray-instrument -fxray-function-index -target x86_64-linux- -### \ -// RUN: -x c++ -std=c++11 -emit-llvm -c -o - %s 2>&1 \ -// RUN: | FileCheck %s +// RUN: %clang -### -fxray-instrument -target x86_64 -c %s 2>&1 | FileCheck %s +// RUN: %clang -### -fxray-instrument -target x86_64 -fxray-function-index -c %s 2>&1 | FileCheck %s + // CHECK-NOT: -fno-xray-function-index -// -// RUN: %clang -fxray-instrument -target x86_64-linux- -### \ -// RUN: -x c++ -std=c++11 -emit-llvm -c -o - %s 2>&1 \ -// RUN: | FileCheck %s -check-prefix CHECK-DEFAULT -// CHECK-DEFAULT-NOT: -fno-xray-function-index -// -// RUN: %clang -fxray-instrument -fno-xray-function-index -target x86_64-linux- -### \ -// RUN: -x c++ -std=c++11 -emit-llvm -c -o - %s 2>&1 \ -// RUN: | FileCheck %s -check-prefix CHECK-DISABLED + +// RUN: %clang -### -fxray-instrument -target x86_64 -fno-xray-function-index -c %s 2>&1 | FileCheck %s --check-prefix=CHECK-DISABLED + // CHECK-DISABLED: -fno-xray-function-index -// -// REQUIRES: x86_64 || x86_64h diff --git a/clang/test/Driver/XRay/xray-ignore-loops-flags.cpp b/clang/test/Driver/XRay/xray-ignore-loops-flags.cpp index 476786f..2c6ddb8 100644 --- a/clang/test/Driver/XRay/xray-ignore-loops-flags.cpp +++ b/clang/test/Driver/XRay/xray-ignore-loops-flags.cpp @@ -3,8 +3,7 @@ // invocation. // // RUN: %clang -fxray-instrument -fxray-ignore-loops -target x86_64-linux- -### \ -// RUN: -x c++ -std=c++11 -emit-llvm -c -o - %s 2>&1 \ -// RUN: | FileCheck %s +// RUN: -x c++ -emit-llvm -c -o - %s 2>&1 | FileCheck %s // CHECK: -fxray-ignore-loops // // REQUIRES: x86_64 || x86_64h diff --git a/clang/test/Driver/XRay/xray-instrumentation-bundles-flags.cpp b/clang/test/Driver/XRay/xray-instrumentation-bundles-flags.cpp index b68dca2..4d311cc 100644 --- a/clang/test/Driver/XRay/xray-instrumentation-bundles-flags.cpp +++ b/clang/test/Driver/XRay/xray-instrumentation-bundles-flags.cpp @@ -3,8 +3,7 @@ // invocation. // // RUN: %clang -fxray-instrument -fxray-instrumentation-bundle=function -### \ -// RUN: -x c++ -std=c++11 -emit-llvm -c -o - %s 2>&1 \ -// RUN: | FileCheck %s +// RUN: -c -o - %s 2>&1 | FileCheck %s // CHECK: -fxray-instrumentation-bundle=function // // REQUIRES: linux || freebsd