summaryrefslogtreecommitdiff
path: root/lib/Driver/ToolChain.cpp
diff options
context:
space:
mode:
authorSunil Srivastava <sunil_srivastava@playstation.sony.com>2018-05-18 23:32:01 +0000
committerSunil Srivastava <sunil_srivastava@playstation.sony.com>2018-05-18 23:32:01 +0000
commit5b04748157cbb00ccb3e91f6633a1561b3250e25 (patch)
treee18f10ecc5d6cf59493de1402adab785f7f5ba5c /lib/Driver/ToolChain.cpp
parent6588d85cab7883d4f8e73015e1de6a8531fca433 (diff)
downloadclang-5b04748157cbb00ccb3e91f6633a1561b3250e25.tar.gz
Do not enable RTTI with -fexceptions, for PS4
NFC for targets other than PS4. This patch is a change in behavior for PS4, in that PS4 will no longer enable RTTI when -fexceptions is specified (RTTI and Exceptions are disabled by default on PS4). RTTI will remain disabled except for types being thrown or caught. Also, '-fexceptions -fno-rtti' (previously prohibited on PS4) is now accepted, as it is for other targets. This patch removes some PS4 specific code, making the code cleaner. Also, in the test file rtti-options.cpp, PS4 tests where the behavior is the same as the generic x86_64-linux are removed, making the test cleaner. Differential Revision: https://reviews.llvm.org/D46982 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@332784 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Driver/ToolChain.cpp')
-rw-r--r--lib/Driver/ToolChain.cpp19
1 files changed, 3 insertions, 16 deletions
diff --git a/lib/Driver/ToolChain.cpp b/lib/Driver/ToolChain.cpp
index b64a5d585d..c12943c6c9 100644
--- a/lib/Driver/ToolChain.cpp
+++ b/lib/Driver/ToolChain.cpp
@@ -61,26 +61,13 @@ static ToolChain::RTTIMode CalculateRTTIMode(const ArgList &Args,
// Explicit rtti/no-rtti args
if (CachedRTTIArg) {
if (CachedRTTIArg->getOption().matches(options::OPT_frtti))
- return ToolChain::RM_EnabledExplicitly;
+ return ToolChain::RM_Enabled;
else
- return ToolChain::RM_DisabledExplicitly;
+ return ToolChain::RM_Disabled;
}
// -frtti is default, except for the PS4 CPU.
- if (!Triple.isPS4CPU())
- return ToolChain::RM_EnabledImplicitly;
-
- // On the PS4, turning on c++ exceptions turns on rtti.
- // We're assuming that, if we see -fexceptions, rtti gets turned on.
- Arg *Exceptions = Args.getLastArgNoClaim(
- options::OPT_fcxx_exceptions, options::OPT_fno_cxx_exceptions,
- options::OPT_fexceptions, options::OPT_fno_exceptions);
- if (Exceptions &&
- (Exceptions->getOption().matches(options::OPT_fexceptions) ||
- Exceptions->getOption().matches(options::OPT_fcxx_exceptions)))
- return ToolChain::RM_EnabledImplicitly;
-
- return ToolChain::RM_DisabledImplicitly;
+ return (Triple.isPS4CPU()) ? ToolChain::RM_Disabled : ToolChain::RM_Enabled;
}
ToolChain::ToolChain(const Driver &D, const llvm::Triple &T,