Hi,
This patch fixes the StackProtector pass so that it actually uses the
stack-protector-buffer-size (i.e., --param ssp-buffer-size=N).
Currently, stack protectors are not generated for the following code:
// clang -fstack-protector --param ssp-buffer-size=5
extern int fun(char *c);
int test(void) {
char a[5]; return fun(a);
}
The problem is that the attribute was queried and saved at the wrong place.
Specifically, SSPBufferSize was set to "stack-protoctor-buffer-size" after all
uses of SSPBufferSize. The result was that the default SSPBufferSize was
always used.
I added a few test cases to test/CodeGen/X86/stack-protector.ll that verify the
stack-protector-buffer-size attribute now has an effect.
In preparation for these new tests I previously modernized the rest of tests in
that file in r205996.
Let me know if this is okay to go in.
Thanks,
- Josh