[llvm] r351155 - gn build: Split no-RTTI flag into a config.
Peter Collingbourne via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 14 18:43:34 PST 2019
Author: pcc
Date: Mon Jan 14 18:43:33 2019
New Revision: 351155
URL: http://llvm.org/viewvc/llvm-project?rev=351155&view=rev
Log:
gn build: Split no-RTTI flag into a config.
Some of the sanitizer runtime code needs to be built with RTTI;
this allows that code to opt in to RTTI.
Differential Revision: https://reviews.llvm.org/D56627
Modified:
llvm/trunk/utils/gn/build/BUILD.gn
llvm/trunk/utils/gn/build/BUILDCONFIG.gn
Modified: llvm/trunk/utils/gn/build/BUILD.gn
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/gn/build/BUILD.gn?rev=351155&r1=351154&r2=351155&view=diff
==============================================================================
--- llvm/trunk/utils/gn/build/BUILD.gn (original)
+++ llvm/trunk/utils/gn/build/BUILD.gn Mon Jan 14 18:43:33 2019
@@ -28,7 +28,6 @@ config("compiler_defaults") {
cflags_cc = [
"-std=c++11",
"-fno-exceptions",
- "-fno-rtti",
"-fvisibility-inlines-hidden",
]
} else {
@@ -52,10 +51,7 @@ config("compiler_defaults") {
"_UNICODE",
"UNICODE",
]
- cflags += [
- "/EHs-c-",
- "/GR-",
- ]
+ cflags += [ "/EHs-c-" ]
# The MSVC default value (1 MB) is not enough for parsing recursive C++
# templates in Clang.
@@ -110,6 +106,14 @@ config("compiler_defaults") {
}
}
+config("no_rtti") {
+ if (current_os == "win") {
+ cflags_cc = [ "/GR-" ]
+ } else {
+ cflags_cc = [ "-fno-rtti" ]
+ }
+}
+
config("llvm_code") {
include_dirs = [
"//llvm/include",
Modified: llvm/trunk/utils/gn/build/BUILDCONFIG.gn
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/gn/build/BUILDCONFIG.gn?rev=351155&r1=351154&r2=351155&view=diff
==============================================================================
--- llvm/trunk/utils/gn/build/BUILDCONFIG.gn (original)
+++ llvm/trunk/utils/gn/build/BUILDCONFIG.gn Mon Jan 14 18:43:33 2019
@@ -5,6 +5,7 @@
shared_binary_target_configs = [
"//llvm/utils/gn/build:compiler_defaults",
"//llvm/utils/gn/build:llvm_code",
+ "//llvm/utils/gn/build:no_rtti",
"//llvm/utils/gn/build:warn_covered_switch_default",
]
More information about the llvm-commits
mailing list