[PATCH] D77728: [Driver][X86] Add an alias for -mpad-max-prefix-size
Kan Shengchen via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Apr 8 07:02:34 PDT 2020
skan created this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.
skan added a parent revision: D77628: [Driver][X86] Add -mpad-max-prefix-size.
Make -malign-branch-prefix-size an alias for -mpad-max-prefix-size (For
GCC compatibility)
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D77728
Files:
clang/include/clang/Driver/Options.td
clang/test/Driver/x86-malign-branch.c
clang/test/Driver/x86-malign-branch.s
Index: clang/test/Driver/x86-malign-branch.s
===================================================================
--- clang/test/Driver/x86-malign-branch.s
+++ clang/test/Driver/x86-malign-branch.s
@@ -9,5 +9,7 @@
// RUN: %clang -target x86_64 -mpad-max-prefix-size=5 %s -c -### 2>&1 | FileCheck %s --check-prefix=PREFIX
// PREFIX: "-mllvm" "-x86-pad-max-prefix-size=5"
+// RUN: %clang -target x86_64 -malign-branch-prefix-size=5 %s -c -### 2>&1 | FileCheck %s --check-prefix=PREFIX
+
// RUN: %clang -target x86_64 -mbranches-within-32B-boundaries %s -c -### 2>&1 | FileCheck %s --check-prefix=32B
// 32B: "-mllvm" "-x86-branches-within-32B-boundaries"
Index: clang/test/Driver/x86-malign-branch.c
===================================================================
--- clang/test/Driver/x86-malign-branch.c
+++ clang/test/Driver/x86-malign-branch.c
@@ -27,6 +27,9 @@
// RUN: %clang -target x86_64 -mpad-max-prefix-size=6 %s -c -### 2>&1 | FileCheck %s --check-prefix=PREFIX-6
// PREFIX-6: invalid argument
+/// Test -malign-branch-prefix-size= for GCC compatibilty
+// RUN: %clang -target x86_64 -malign-branch-prefix-size=5 %s -c -### 2>&1 | FileCheck %s --check-prefix=PREFIX-5
+
/// Test -mbranches-within-32B-boundaries
// RUN: %clang -target x86_64 -mbranches-within-32B-boundaries %s -c -### 2>&1 | FileCheck %s --check-prefix=32B
// 32B: "-mllvm" "-x86-branches-within-32B-boundaries"
Index: clang/include/clang/Driver/Options.td
===================================================================
--- clang/include/clang/Driver/Options.td
+++ clang/include/clang/Driver/Options.td
@@ -2189,6 +2189,8 @@
HelpText<"Specify the boundary's size to align branches">;
def mpad_max_prefix_size_EQ : Joined<["-"], "mpad-max-prefix-size=">, Group<m_Group>, Flags<[DriverOption]>,
HelpText<"Specify maximum number of prefixes to use for padding">;
+def malign_branch_prefix_size_EQ : Joined<["-"], "malign-branch-prefix-size=">, Group<m_Group>, Flags<[DriverOption]>,Alias<mpad_max_prefix_size_EQ>,
+ HelpText<"Alias for -mpad-max-prefix-size">;// Alias for GCC compatibility
def mbranches_within_32B_boundaries : Flag<["-"], "mbranches-within-32B-boundaries">, Flags<[DriverOption]>, Group<m_Group>,
HelpText<"Align selected branches (fused, jcc, jmp) within 32-byte boundary">;
def mfancy_math_387 : Flag<["-"], "mfancy-math-387">, Group<clang_ignored_m_Group>;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D77728.256010.patch
Type: text/x-patch
Size: 2388 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200408/5ef2c228/attachment.bin>
More information about the cfe-commits
mailing list