[PATCH] D139167: [clang][Windows]Ignore Options '/d1nodatetime' and '/d1import_no_registry'

2022-12-09 Thread Hans Wennborg via Phabricator via cfe-commits
hans added a comment.

I see this landed in https://github.com/llvm/llvm-project/commit/4178671b2ed3d 
Thanks!


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D139167/new/

https://reviews.llvm.org/D139167

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D139167: [clang][Windows]Ignore Options '/d1nodatetime' and '/d1import_no_registry'

2022-12-03 Thread Alexandre Ganea via Phabricator via cfe-commits
aganea added a comment.

In D139167#3967123 , @efriedma wrote:

> FYI, there's some discussion of /d1nodatetime floating around, even though it 
> isn't formally documented: it disables the definition of the `__DATE__`, 
> `__TIME__`, and `__TIMESTAMP__` macros.
>
> (No idea about d1import_no_registry, though.)

Those two options were introduced (I believe) along with the cl flag 
`/experimental:deterministic` (they actually alias to that flag, like -cc1 
flags do in Clang). `/d1import_no_registry` simply adds this attribute 
 
to all `#import` directives, to make them deterministic.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D139167/new/

https://reviews.llvm.org/D139167

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D139167: [clang][Windows]Ignore Options '/d1nodatetime' and '/d1import_no_registry'

2022-12-02 Thread Eli Friedman via Phabricator via cfe-commits
efriedma added a subscriber: steplong.
efriedma added a comment.

FYI, there's some discussion of /d1nodatetime floating around, even though it 
isn't formally documented: it disables the definition of the `__DATE__`, 
`__TIME__`, and `__TIMESTAMP__` macros.

(No idea about d1import_no_registry, though.)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D139167/new/

https://reviews.llvm.org/D139167

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D139167: [clang][Windows]Ignore Options '/d1nodatetime' and '/d1import_no_registry'

2022-12-02 Thread Tobias Hieta via Phabricator via cfe-commits
thieta added a comment.

Makes sense they are not documented and we probably can ignore them in that 
case!


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D139167/new/

https://reviews.llvm.org/D139167

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D139167: [clang][Windows]Ignore Options '/d1nodatetime' and '/d1import_no_registry'

2022-12-02 Thread Hans Wennborg via Phabricator via cfe-commits
hans accepted this revision.
hans added a comment.
This revision is now accepted and ready to land.

Looks great, thanks!

Do you have commit access, or would you like someone to commit this for you?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D139167/new/

https://reviews.llvm.org/D139167

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D139167: [clang][Windows]Ignore Options '/d1nodatetime' and '/d1import_no_registry'

2022-12-02 Thread Qfrost via Phabricator via cfe-commits
Qfrost911 updated this revision to Diff 479594.
Qfrost911 added a comment.

Ok, I updated this patch.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D139167/new/

https://reviews.llvm.org/D139167

Files:
  clang/include/clang/Driver/Options.td
  clang/test/Driver/cl-options.c


Index: clang/test/Driver/cl-options.c
===
--- clang/test/Driver/cl-options.c
+++ clang/test/Driver/cl-options.c
@@ -426,6 +426,8 @@
 // RUN: /Bt \
 // RUN: /Bt+ \
 // RUN: /clr:pure \
+// RUN: /d1import_no_registry \
+// RUN: /d1nodatetime \
 // RUN: /d2FH4 \
 // RUN: /docname \
 // RUN: /experimental:external \
Index: clang/include/clang/Driver/Options.td
===
--- clang/include/clang/Driver/Options.td
+++ clang/include/clang/Driver/Options.td
@@ -6925,6 +6925,7 @@
 def _SLASH_Bt : CLFlag<"Bt">;
 def _SLASH_Bt_plus : CLFlag<"Bt+">;
 def _SLASH_clr : CLJoined<"clr">;
+def _SLASH_d1 : CLJoined<"d1">;
 def _SLASH_d2 : CLJoined<"d2">;
 def _SLASH_doc : CLJoined<"doc">;
 def _SLASH_experimental : CLJoined<"experimental:">;


Index: clang/test/Driver/cl-options.c
===
--- clang/test/Driver/cl-options.c
+++ clang/test/Driver/cl-options.c
@@ -426,6 +426,8 @@
 // RUN: /Bt \
 // RUN: /Bt+ \
 // RUN: /clr:pure \
+// RUN: /d1import_no_registry \
+// RUN: /d1nodatetime \
 // RUN: /d2FH4 \
 // RUN: /docname \
 // RUN: /experimental:external \
Index: clang/include/clang/Driver/Options.td
===
--- clang/include/clang/Driver/Options.td
+++ clang/include/clang/Driver/Options.td
@@ -6925,6 +6925,7 @@
 def _SLASH_Bt : CLFlag<"Bt">;
 def _SLASH_Bt_plus : CLFlag<"Bt+">;
 def _SLASH_clr : CLJoined<"clr">;
+def _SLASH_d1 : CLJoined<"d1">;
 def _SLASH_d2 : CLJoined<"d2">;
 def _SLASH_doc : CLJoined<"doc">;
 def _SLASH_experimental : CLJoined<"experimental:">;
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D139167: [clang][Windows]Ignore Options '/d1nodatetime' and '/d1import_no_registry'

2022-12-02 Thread Hans Wennborg via Phabricator via cfe-commits
hans added a comment.

I hadn't seen `/d1` flags before. I suppose they relate to preprocessor stuff 
as opposed to `/d2` flags.

I think the "Unsupported" section below may be better for these. In that case 
clang-cl will parse the option and warn that it's ignoring it. On line 6931 
there's a catch-all for all flags starting with "d2". Perhaps we should add one 
for "d1" too?

Also, please add these to the "Unsupported but parsed options" tests in 
clang/test/Driver/cl-options.c


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D139167/new/

https://reviews.llvm.org/D139167

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D139167: [clang][Windows]Ignore Options '/d1nodatetime' and '/d1import_no_registry'

2022-12-02 Thread Qfrost via Phabricator via cfe-commits
Qfrost911 added a comment.

Yes, these options are not documented, so I think they can be ignored. If they 
are important options for windows driver, why MSVC didn't document them. And, 
the windows driver run perfectly even if I ignore these two options.

Moreover, there are lots of options which do nothing were defined in 
//clang/Options.td //and //lld/COFF/Options.td//, such as "kernel", 
"pdbcompress" etc., in order to be compatible with MSVC and other environment.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D139167/new/

https://reviews.llvm.org/D139167

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D139167: [clang][Windows]Ignore Options '/d1nodatetime' and '/d1import_no_registry'

2022-12-02 Thread Tobias Hieta via Phabricator via cfe-commits
thieta added a comment.

I tried to look up what these options do exactly - but they don't seem to be 
documented.

`/d1nodatetime` seems like an option that should be implemented instead of just 
ignored since it can have real reproducible problems not being there.

Do you know what `/d1import_no_registry` actually does?

I think we can ignore options that are not applicable in clang-cl, but I think 
if there are options that expect to change something, it's probably better to 
fail than to silently accept them.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D139167/new/

https://reviews.llvm.org/D139167

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D139167: [clang][Windows]Ignore Options '/d1nodatetime' and '/d1import_no_registry'

2022-12-01 Thread Qfrost via Phabricator via cfe-commits
Qfrost911 created this revision.
Qfrost911 added reviewers: aaron.ballman, pengfei, JosephTremoulet, efriedma.
Herald added a project: All.
Qfrost911 requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

Using clang and VS to build Windows Kernel Driver, two errors will be raised

  1>clang-cl : error : no such file or directory: '/d1nodatetime'
  1>clang-cl : error : no such file or directory: '/d1import_no_registry'

In the patch, I ignore these options in order to build windows driver under 
visual studio.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D139167

Files:
  clang/include/clang/Driver/Options.td


Index: clang/include/clang/Driver/Options.td
===
--- clang/include/clang/Driver/Options.td
+++ clang/include/clang/Driver/Options.td
@@ -6914,7 +6914,10 @@
 def _SLASH_Zm : CLIgnoredJoined<"Zm">;
 def _SLASH_Zo : CLIgnoredFlag<"Zo">;
 def _SLASH_Zo_ : CLIgnoredFlag<"Zo-">;
-
+def _SLASH_d1nodatetime : CLIgnoredFlag<"d1nodatetime">,
+  HelpText<"d1nodatetime">;
+def _SLASH_d1import_no_registry : CLIgnoredFlag<"d1import_no_registry">,
+  HelpText<"d1import_no_registry">;
 
 // Unsupported:
 


Index: clang/include/clang/Driver/Options.td
===
--- clang/include/clang/Driver/Options.td
+++ clang/include/clang/Driver/Options.td
@@ -6914,7 +6914,10 @@
 def _SLASH_Zm : CLIgnoredJoined<"Zm">;
 def _SLASH_Zo : CLIgnoredFlag<"Zo">;
 def _SLASH_Zo_ : CLIgnoredFlag<"Zo-">;
-
+def _SLASH_d1nodatetime : CLIgnoredFlag<"d1nodatetime">,
+  HelpText<"d1nodatetime">;
+def _SLASH_d1import_no_registry : CLIgnoredFlag<"d1import_no_registry">,
+  HelpText<"d1import_no_registry">;
 
 // Unsupported:
 
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits