[PATCH] Implement command line options for stack probe space

Andrew H clangbugs.10.mdwxzxkl at spamgourmet.com
Fri Jan 9 06:41:38 PST 2015


> Why not just make ##StackProbeSize## default to 4096 and get rid of ##IsStackProbeSizeOverridden##. Then you can get rid of ##IsStackProbeSizeOverridden##.

> After all that, only add the "stack-probe-size" attribute to the function if the ##StackProbeSize## is not equal to 4096.


I could see the problem that this would expose a (somewhat) magic constant to the frontend, whereas only the backend knows what sane default size should be used. ##StackAlignment## has the same problem, but it can use 0 to indicate the usage of the default value, thus it does not need an ##Is...Overridden## code gen option.

So the question is whether we should duplicate that magic value of 4096 for both frontend and backend. You can make that decision; I have no preference and I am very pragmatic on that issue.

> Please do the same for the X86_64 side so nothing mysterious happens if somebody adds an implementation of SetTargetAttributes.


Please be aware that ##WinX86_32TargetCodeGenInfo## inherits from ##X86_32TargetCodeGenInfo## (which in turn inherits from ##TargetCodeGenInfo##), whereas ##WinX86_64TargetCodeGenInfo## directly inherits from ##TargetCodeGenInfo##. Thus I have added a call to ##TargetCodeGenInfo::SetTargetAttributes##.


REPOSITORY
  rL LLVM

http://reviews.llvm.org/D6685

Files:
  include/clang/Driver/CLCompatOptions.td
  include/clang/Driver/Options.td
  include/clang/Frontend/CodeGenOptions.def
  lib/CodeGen/TargetInfo.cpp
  lib/Driver/Tools.cpp
  lib/Frontend/CompilerInvocation.cpp
  test/Driver/cl-options.c

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D6685.17925.patch
Type: text/x-patch
Size: 7435 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150109/a84af42e/attachment.bin>


More information about the cfe-commits mailing list