r257739 - Driver: Remove SanitizerArgs::clear() function and SanitizerSet ctor,
Peter Collingbourne via cfe-commits
cfe-commits at lists.llvm.org
Wed Jan 13 18:49:51 PST 2016
Author: pcc
Date: Wed Jan 13 20:49:51 2016
New Revision: 257739
URL: http://llvm.org/viewvc/llvm-project?rev=257739&view=rev
Log:
Driver: Remove SanitizerArgs::clear() function and SanitizerSet ctor,
replace with in-class initializers.
Modified:
cfe/trunk/include/clang/Basic/Sanitizers.h
cfe/trunk/include/clang/Driver/SanitizerArgs.h
cfe/trunk/lib/Driver/SanitizerArgs.cpp
Modified: cfe/trunk/include/clang/Basic/Sanitizers.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/Sanitizers.h?rev=257739&r1=257738&r2=257739&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/Sanitizers.h (original)
+++ cfe/trunk/include/clang/Basic/Sanitizers.h Wed Jan 13 20:49:51 2016
@@ -46,8 +46,6 @@ enum SanitizerOrdinal : uint64_t {
}
struct SanitizerSet {
- SanitizerSet() : Mask(0) {}
-
/// \brief Check if a certain (single) sanitizer is enabled.
bool has(SanitizerMask K) const {
assert(llvm::isPowerOf2_64(K));
@@ -70,7 +68,7 @@ struct SanitizerSet {
bool empty() const { return Mask == 0; }
/// \brief Bitmask of enabled sanitizers.
- SanitizerMask Mask;
+ SanitizerMask Mask = 0;
};
/// Parse a single value from a -fsanitize= or -fno-sanitize= value list.
Modified: cfe/trunk/include/clang/Driver/SanitizerArgs.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/SanitizerArgs.h?rev=257739&r1=257738&r2=257739&view=diff
==============================================================================
--- cfe/trunk/include/clang/Driver/SanitizerArgs.h (original)
+++ cfe/trunk/include/clang/Driver/SanitizerArgs.h Wed Jan 13 20:49:51 2016
@@ -28,14 +28,14 @@ class SanitizerArgs {
std::vector<std::string> BlacklistFiles;
std::vector<std::string> ExtraDeps;
- int CoverageFeatures;
- int MsanTrackOrigins;
- bool MsanUseAfterDtor;
- bool CfiCrossDso;
- int AsanFieldPadding;
- bool AsanSharedRuntime;
- bool LinkCXXRuntimes;
- bool NeedPIE;
+ int CoverageFeatures = 0;
+ int MsanTrackOrigins = 0;
+ bool MsanUseAfterDtor = false;
+ bool CfiCrossDso = false;
+ int AsanFieldPadding = 0;
+ bool AsanSharedRuntime = false;
+ bool LinkCXXRuntimes = false;
+ bool NeedPIE = false;
public:
/// Parses the sanitizer arguments from an argument list.
@@ -62,9 +62,6 @@ class SanitizerArgs {
bool linkCXXRuntimes() const { return LinkCXXRuntimes; }
void addArgs(const ToolChain &TC, const llvm::opt::ArgList &Args,
llvm::opt::ArgStringList &CmdArgs, types::ID InputType) const;
-
- private:
- void clear();
};
} // namespace driver
Modified: cfe/trunk/lib/Driver/SanitizerArgs.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/SanitizerArgs.cpp?rev=257739&r1=257738&r2=257739&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/SanitizerArgs.cpp (original)
+++ cfe/trunk/lib/Driver/SanitizerArgs.cpp Wed Jan 13 20:49:51 2016
@@ -180,25 +180,8 @@ bool SanitizerArgs::needsUnwindTables()
return Sanitizers.Mask & NeedsUnwindTables;
}
-void SanitizerArgs::clear() {
- Sanitizers.clear();
- RecoverableSanitizers.clear();
- TrapSanitizers.clear();
- BlacklistFiles.clear();
- ExtraDeps.clear();
- CoverageFeatures = 0;
- MsanTrackOrigins = 0;
- MsanUseAfterDtor = false;
- NeedPIE = false;
- AsanFieldPadding = 0;
- AsanSharedRuntime = false;
- LinkCXXRuntimes = false;
- CfiCrossDso = false;
-}
-
SanitizerArgs::SanitizerArgs(const ToolChain &TC,
const llvm::opt::ArgList &Args) {
- clear();
SanitizerMask AllRemove = 0; // During the loop below, the accumulated set of
// sanitizers disabled by the current sanitizer
// argument or any argument after it.
More information about the cfe-commits
mailing list