[RFC 06/12] Add globals to store command line arguments in

Connor Kuehl via cfe-commits cfe-commits at lists.llvm.org
Fri Mar 8 14:36:45 PST 2019


Co-authored-by: Cole Nixon <nixontcole at gmail.com>
Co-authored-by: Connor Kuehl <cipkuehl at gmail.com>
Co-authored-by: James Foster <jafosterja at gmail.com>
Co-authored-by: Jeff Takahashi <jeffrey.takahashi at gmail.com>
Co-authored-by: Jordan Cantrell <jordan.cantrell at mail.com>
Co-authored-by: Nikk Forbus <nicholas.forbus at gmail.com>
Co-authored-by: Tim Pugh <nwtpugh at gmail.com>
---
 clang/include/clang/AST/RandstructSeed.h |  8 ++++++++
 clang/lib/AST/CMakeLists.txt             |  1 +
 clang/lib/AST/RecordFieldReorganizer.cpp | 19 +++++++++++++++++++
 3 files changed, 28 insertions(+)
 create mode 100644 clang/include/clang/AST/RandstructSeed.h
 create mode 100644 clang/lib/AST/RecordFieldReorganizer.cpp

diff --git a/clang/include/clang/AST/RandstructSeed.h b/clang/include/clang/AST/RandstructSeed.h
new file mode 100644
index 00000000000..eefdd8916f4
--- /dev/null
+++ b/clang/include/clang/AST/RandstructSeed.h
@@ -0,0 +1,8 @@
+#ifndef RANDSTRUCTSEED_H
+#define RANDSTRUCTSEED_H
+#include <string>
+namespace clang {
+extern std::string RandstructSeed;
+extern bool RandstructAutoSelect;
+}
+#endif
diff --git a/clang/lib/AST/CMakeLists.txt b/clang/lib/AST/CMakeLists.txt
index 570ca718acf..08acf687971 100644
--- a/clang/lib/AST/CMakeLists.txt
+++ b/clang/lib/AST/CMakeLists.txt
@@ -44,6 +44,7 @@ add_clang_library(clangAST
   InheritViz.cpp
   ItaniumCXXABI.cpp
   ItaniumMangle.cpp
+  RecordFieldReorganizer.cpp
   Mangle.cpp
   MicrosoftCXXABI.cpp
   MicrosoftMangle.cpp
diff --git a/clang/lib/AST/RecordFieldReorganizer.cpp b/clang/lib/AST/RecordFieldReorganizer.cpp
new file mode 100644
index 00000000000..c7ab9cd16d4
--- /dev/null
+++ b/clang/lib/AST/RecordFieldReorganizer.cpp
@@ -0,0 +1,19 @@
+//===----- RecordFieldReorganizer.cpp - Implementation for field reorder -*- C++
+//-*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+//
+// Contains the implementation for RecordDecl field reordering.
+//
+//===----------------------------------------------------------------------===//
+
+#include "clang/AST/RandstructSeed.h"
+
+namespace clang {
+std::string RandstructSeed = "";
+bool RandstructAutoSelect = false;
+} // namespace clang
-- 
2.17.1



More information about the cfe-commits mailing list