diff options
author | Fangrui Song <i@maskray.me> | 2022-04-08 18:37:26 -0700 |
---|---|---|
committer | Fangrui Song <i@maskray.me> | 2022-04-08 18:37:26 -0700 |
commit | a58d0af058038595c93de961b725f86997cf8d4a (patch) | |
tree | 586c66b5b1e2f09bf1626dd97c52d198c954f0e8 /clang/lib/Frontend/CompilerInvocation.cpp | |
parent | 62c8b185ff377376f1a4ad1f8ea03289cd42ac52 (diff) | |
download | llvm-a58d0af058038595c93de961b725f86997cf8d4a.zip llvm-a58d0af058038595c93de961b725f86997cf8d4a.tar.gz llvm-a58d0af058038595c93de961b725f86997cf8d4a.tar.bz2 |
Revert D121556 "[randstruct] Add randomize structure layout support"
This reverts commit 3f0587d0c668202bb89d29a25432aa290e551a31.
Not all tests pass after a few rounds of fixes.
I spot one failure that std::shuffle (potentially different results with
different STL implementations) was misused and replaced it with llvm::shuffle,
but there appears to be another failure in a Windows build.
The latest failure is reported on https://reviews.llvm.org/D121556#3440383
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r-- | clang/lib/Frontend/CompilerInvocation.cpp | 17 |
1 files changed, 0 insertions, 17 deletions
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index 5181999..83de27b 100644 --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -94,7 +94,6 @@ #include <cassert> #include <cstddef> #include <cstring> -#include <fstream> #include <memory> #include <string> #include <tuple> @@ -3686,9 +3685,6 @@ void CompilerInvocation::GenerateLangArgs(const LangOptions &Opts, for (const auto &MP : Opts.MacroPrefixMap) GenerateArg(Args, OPT_fmacro_prefix_map_EQ, MP.first + "=" + MP.second, SA); - - if (!Opts.RandstructSeed.empty()) - GenerateArg(Args, OPT_frandomize_layout_seed_EQ, Opts.RandstructSeed, SA); } bool CompilerInvocation::ParseLangArgs(LangOptions &Opts, ArgList &Args, @@ -4241,19 +4237,6 @@ bool CompilerInvocation::ParseLangArgs(LangOptions &Opts, ArgList &Args, Diags.Report(diag::err_cc1_unbounded_vscale_min); } - if (const Arg *A = Args.getLastArg(OPT_frandomize_layout_seed_file_EQ)) { - std::ifstream SeedFile(A->getValue(0)); - - if (!SeedFile.is_open()) - Diags.Report(diag::err_drv_cannot_open_randomize_layout_seed_file) - << A->getValue(0); - - std::getline(SeedFile, Opts.RandstructSeed); - } - - if (const Arg *A = Args.getLastArg(OPT_frandomize_layout_seed_EQ)) - Opts.RandstructSeed = A->getValue(0); - return Diags.getNumErrors() == NumErrorsBefore; } |