summaryrefslogtreecommitdiffstats
path: root/include/clang/Basic/CodeGenOptions.h
diff options
context:
space:
mode:
authorScott Linder <scott@scottlinder.com>2018-12-14 15:38:15 +0000
committerScott Linder <scott@scottlinder.com>2018-12-14 15:38:15 +0000
commit817269769019f72d14e284f3b040be697c2c30d5 (patch)
treed38f2fa5c02914ce747314c17c9992cc7cdae919 /include/clang/Basic/CodeGenOptions.h
parentc18971ee2305995d7b953dac2e6a65304ba95408 (diff)
Implement -frecord-command-line (-frecord-gcc-switches)
Implement options in clang to enable recording the driver command-line in an ELF section. Implement a new special named metadata, llvm.commandline, to support frontends embedding their command-line options in IR/ASM/ELF. This differs from the GCC implementation in some key ways: * In GCC there is only one command-line possible per compilation-unit, in LLVM it mirrors llvm.ident and multiple are allowed. * In GCC individual options are separated by NULL bytes, in LLVM entire command-lines are separated by NULL bytes. The advantage of the GCC approach is to clearly delineate options in the face of embedded spaces. The advantage of the LLVM approach is to support merging multiple command-lines unambiguously, while handling embedded spaces with escaping. Differential Revision: https://reviews.llvm.org/D54487 Clang Differential Revision: https://reviews.llvm.org/D54489 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@349155 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Basic/CodeGenOptions.h')
-rw-r--r--include/clang/Basic/CodeGenOptions.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/clang/Basic/CodeGenOptions.h b/include/clang/Basic/CodeGenOptions.h
index 5f83915225..a12744ee3d 100644
--- a/include/clang/Basic/CodeGenOptions.h
+++ b/include/clang/Basic/CodeGenOptions.h
@@ -148,6 +148,10 @@ public:
/// non-empty.
std::string DwarfDebugFlags;
+ /// The string containing the commandline for the llvm.commandline metadata,
+ /// if non-empty.
+ std::string RecordCommandLine;
+
std::map<std::string, std::string> DebugPrefixMap;
/// The ABI to use for passing floating point arguments.