[clang] Teach -fembed-bitcode option not to embed W_value Group
Summary: -fembed-bitcode options doesn't embed warning options since they are useless to code generation. Make sure it handles the W_value group and not embed those options in the output. Reviewers: zixuw, arphaman Reviewed By: zixuw Subscribers: jkorous, dexonsmith, ributzka, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D83813
This commit is contained in:
parent
226866e115
commit
2b42080b51
|
@ -1086,8 +1086,7 @@ static bool ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args, InputKind IK,
|
||||||
A->getOption().getID() == options::OPT_INPUT ||
|
A->getOption().getID() == options::OPT_INPUT ||
|
||||||
A->getOption().getID() == options::OPT_x ||
|
A->getOption().getID() == options::OPT_x ||
|
||||||
A->getOption().getID() == options::OPT_fembed_bitcode ||
|
A->getOption().getID() == options::OPT_fembed_bitcode ||
|
||||||
(A->getOption().getGroup().isValid() &&
|
A->getOption().matches(options::OPT_W_Group))
|
||||||
A->getOption().getGroup().getID() == options::OPT_W_Group))
|
|
||||||
continue;
|
continue;
|
||||||
ArgStringList ASL;
|
ArgStringList ASL;
|
||||||
A->render(Args, ASL);
|
A->render(Args, ASL);
|
||||||
|
|
|
@ -37,6 +37,11 @@
|
||||||
; CHECK: @llvm.cmdline = private constant
|
; CHECK: @llvm.cmdline = private constant
|
||||||
; CHECK: section "__LLVM,__cmdline"
|
; CHECK: section "__LLVM,__cmdline"
|
||||||
|
|
||||||
|
; check warning options are not embedded
|
||||||
|
; RUN: %clang_cc1 -triple thumbv7-apple-ios8.0.0 -emit-llvm \
|
||||||
|
; RUN: -fembed-bitcode=all -x ir %s -o - -Wall -Wundef-prefix=TEST \
|
||||||
|
; RUN: | FileCheck %s -check-prefix=CHECK-WARNING
|
||||||
|
|
||||||
; CHECK-ELF: @llvm.embedded.module
|
; CHECK-ELF: @llvm.embedded.module
|
||||||
; CHECK-ELF: section ".llvmbc"
|
; CHECK-ELF: section ".llvmbc"
|
||||||
; CHECK-ELF: @llvm.cmdline
|
; CHECK-ELF: @llvm.cmdline
|
||||||
|
@ -54,6 +59,9 @@
|
||||||
; CHECK-MARKER: @llvm.cmdline
|
; CHECK-MARKER: @llvm.cmdline
|
||||||
; CHECK-MARKER: section "__LLVM,__cmdline"
|
; CHECK-MARKER: section "__LLVM,__cmdline"
|
||||||
|
|
||||||
|
; CHECK-WARNING-NOT: Wall
|
||||||
|
; CHECK-WARNING-NOT: Wundef-prefix
|
||||||
|
|
||||||
define i32 @f0() {
|
define i32 @f0() {
|
||||||
ret i32 0
|
ret i32 0
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue