[PATCH] D94101: [clang][cli] Specify correct integer width for -fbuild-session-timestamp
Jan Svoboda via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Jan 5 11:11:06 PST 2021
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGf111cf992df4: [clang][cli] Specify correct integer width for -fbuild-session-timestamp (authored by jansvoboda11).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D94101/new/
https://reviews.llvm.org/D94101
Files:
clang/include/clang/Driver/Options.td
clang/unittests/Frontend/CompilerInvocationTest.cpp
Index: clang/unittests/Frontend/CompilerInvocationTest.cpp
===================================================================
--- clang/unittests/Frontend/CompilerInvocationTest.cpp
+++ clang/unittests/Frontend/CompilerInvocationTest.cpp
@@ -368,6 +368,18 @@
ASSERT_THAT(GeneratedArgs, Not(Contains(StrEq("pic"))));
}
+// Wide integer option.
+
+TEST_F(CommandLineTest, WideIntegerHighValue) {
+ const char *Args[] = {"-fbuild-session-timestamp=1609827494445723662"};
+
+ CompilerInvocation::CreateFromArgs(Invocation, Args, *Diags);
+
+ ASSERT_FALSE(Diags->hasErrorOccurred());
+ ASSERT_EQ(Invocation.getHeaderSearchOpts().BuildSessionTimestamp,
+ 1609827494445723662ull);
+}
+
// Tree of boolean options that can be (directly or transitively) implied by
// their parent:
//
Index: clang/include/clang/Driver/Options.td
===================================================================
--- clang/include/clang/Driver/Options.td
+++ clang/include/clang/Driver/Options.td
@@ -1767,7 +1767,7 @@
def fbuild_session_timestamp : Joined<["-"], "fbuild-session-timestamp=">,
Group<i_Group>, Flags<[CC1Option]>, MetaVarName<"<time since Epoch in seconds>">,
HelpText<"Time when the current build session started">,
- MarshallingInfoStringInt<"HeaderSearchOpts->BuildSessionTimestamp">;
+ MarshallingInfoStringInt<"HeaderSearchOpts->BuildSessionTimestamp", "0", "uint64_t">;
def fbuild_session_file : Joined<["-"], "fbuild-session-file=">,
Group<i_Group>, MetaVarName<"<file>">,
HelpText<"Use the last modification time of <file> as the build session timestamp">;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D94101.314667.patch
Type: text/x-patch
Size: 1598 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210105/e00c586d/attachment.bin>
More information about the cfe-commits
mailing list