Skip to content
This repository was archived by the owner on Nov 1, 2021. It is now read-only.

Commit a3d9460

Browse files
author
Ivan A. Kosarev
committed
[Driver] Add a cc1 flag for the new TBAA metadata format
This patch starts a series of changes to add support for the new TBAA metadata format proposed in this llvm-dev thread: http://lists.llvm.org/pipermail/llvm-dev/2017-November/118748.html Differential Revision: https://reviews.llvm.org/D39955 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@318644 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent d802466 commit a3d9460

File tree

3 files changed

+5
-0
lines changed

3 files changed

+5
-0
lines changed

include/clang/Driver/CC1Options.td

+2
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,8 @@ def relaxed_aliasing : Flag<["-"], "relaxed-aliasing">,
244244
HelpText<"Turn off Type Based Alias Analysis">;
245245
def no_struct_path_tbaa : Flag<["-"], "no-struct-path-tbaa">,
246246
HelpText<"Turn off struct-path aware Type Based Alias Analysis">;
247+
def new_struct_path_tbaa : Flag<["-"], "new-struct-path-tbaa">,
248+
HelpText<"Enable enhanced struct-path aware Type Based Alias Analysis">;
247249
def masm_verbose : Flag<["-"], "masm-verbose">,
248250
HelpText<"Generate verbose assembly output">;
249251
def mcode_model : Separate<["-"], "mcode-model">,

include/clang/Frontend/CodeGenOptions.def

+1
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ ENUM_CODEGENOPT(StructReturnConvention, StructReturnConventionKind, 2, SRCK_Defa
144144
CODEGENOPT(RelaxAll , 1, 0) ///< Relax all machine code instructions.
145145
CODEGENOPT(RelaxedAliasing , 1, 0) ///< Set when -fno-strict-aliasing is enabled.
146146
CODEGENOPT(StructPathTBAA , 1, 0) ///< Whether or not to use struct-path TBAA.
147+
CODEGENOPT(NewStructPathTBAA , 1, 0) ///< Whether or not to use enhanced struct-path TBAA.
147148
CODEGENOPT(SaveTempLabels , 1, 0) ///< Save temporary labels.
148149
CODEGENOPT(SanitizeAddressUseAfterScope , 1, 0) ///< Enable use-after-scope detection
149150
///< in AddressSanitizer

lib/Frontend/CompilerInvocation.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -546,6 +546,8 @@ static bool ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args, InputKind IK,
546546
OPT_fuse_register_sized_bitfield_access);
547547
Opts.RelaxedAliasing = Args.hasArg(OPT_relaxed_aliasing);
548548
Opts.StructPathTBAA = !Args.hasArg(OPT_no_struct_path_tbaa);
549+
Opts.NewStructPathTBAA = !Args.hasArg(OPT_no_struct_path_tbaa) &&
550+
Args.hasArg(OPT_new_struct_path_tbaa);
549551
Opts.FineGrainedBitfieldAccesses =
550552
Args.hasFlag(OPT_ffine_grained_bitfield_accesses,
551553
OPT_fno_fine_grained_bitfield_accesses, false);

0 commit comments

Comments
 (0)