Commit Graph

216 Commits

Author SHA1 Message Date
Daniel Dunbar b1b2016b83 Force triple for this test (non-fragile ABI is default on x86_64-apple-darwin9).
llvm-svn: 80645
2009-09-01 00:36:20 +00:00
David Chisnall 4dc74a0d9f Added test cases for presence and absence of __has_feature(objc_nonfragile_abi) with and without -fobjc-nonfragile-abi.
llvm-svn: 80593
2009-08-31 16:53:06 +00:00
Daniel Dunbar 97ea867690 MultiTestRunner: Validate '&&' at the end of RUN lines.
- This is just to normalize, these will go away soon hopefully.

Added all the missing '&&'s that have crept in. :)

llvm-svn: 77062
2009-07-25 11:27:37 +00:00
Chris Lattner fb42a1820f add push/pop semantics for diagnostics. Patch by Louis Gerbarg!
llvm-svn: 75431
2009-07-12 21:18:45 +00:00
Chris Lattner d9efb6ee52 Fix #pragma GCC system_header by making it insert a virtual linemarker into
the file at the point of the pragma.  This allows clang to know that all
sourcelocations after the pragma are in a system header.

llvm-svn: 73376
2009-06-15 05:02:34 +00:00
Chris Lattner 2228a1ee61 rename test
llvm-svn: 73375
2009-06-15 05:00:02 +00:00
Chris Lattner 77eb1d5333 convert this test to -verify mode.
llvm-svn: 73374
2009-06-15 04:59:21 +00:00
Chris Lattner f2d49da9a8 Fix PR2741 by making our newline tracking be aware of newlines that
can occur in the middle of comment tokens.

llvm-svn: 73365
2009-06-15 01:25:23 +00:00
Chris Lattner 15ba94987a Sink the BuiltinInfo object from ASTContext into the
preprocessor and initialize it early in clang-cc.  This
ensures that __has_builtin works in all modes, not just
when ASTContext is around.

llvm-svn: 73319
2009-06-14 01:54:56 +00:00
Chris Lattner b6f77af532 implement and document a new __has_feature and __has_builtin magic
builtin preprocessor macro.  This appears to work with two caveats:
1) builtins are registered in -E mode, and 2) target-specific builtins
are unconditionally registered even if they aren't supported by the
target (e.g. SSE4 builtin when only SSE1 is enabled).

llvm-svn: 73289
2009-06-13 07:13:28 +00:00
Eli Friedman fd80b2af16 PR4288: Make -dD (dump macros with preprocessed source) play nicely with
# line directives.

llvm-svn: 72724
2009-06-02 07:55:39 +00:00
Eli Friedman d8cec57b9d PR4283: Don't truncate multibyte character constants in the
preprocessor.

llvm-svn: 72686
2009-06-01 05:25:02 +00:00
Chris Lattner 378d72cc40 update test for r72519
llvm-svn: 72520
2009-05-28 05:41:32 +00:00
Eli Friedman 54eb224c3b Make the bad paste diagnostic print the entire pasted token.
llvm-svn: 72497
2009-05-27 22:00:37 +00:00
Chris Lattner 83bd8281e5 Fix a couple of bugs:
1. When we accept "#garbage" in asm-with-cpp mode, change the token kind
   of the # to unknown so that the preprocessor won't try to process it as
   a real #.  This fixes a crash on the attached example
2. Fix macro definition extents processing to handle #foo at the end of a
   macro to say the definition ends with the foo, not the #.

This is a follow-on fix to r72283, and rdar://6916026

llvm-svn: 72388
2009-05-25 17:16:10 +00:00
Chris Lattner fc39bccd2b fix this test to fail when the patch isn't applied.
llvm-svn: 72385
2009-05-25 16:14:52 +00:00
Eli Friedman 2d49c4f98d Make sure an invalid concatentaion doesn't insert whitespace before
the RHS.  Fixes assembler-with-cpp issue reported on cfe-dev.

llvm-svn: 72370
2009-05-24 19:25:46 +00:00
Daniel Dunbar 0721c2c155 In assembler-with-cpp mode, don't error on '#' (stringize) operator applied to
non-argument names, pass the tokens through.

llvm-svn: 72283
2009-05-22 21:35:34 +00:00
Eli Friedman b529b01985 PR3942: Don't warn on unsigned overflow in preprocessor expressions.
llvm-svn: 71960
2009-05-16 21:24:10 +00:00
Chris Lattner ff96dd0301 Fix rdar://6880630 - # in _Pragma does not start a preprocessor directive.
llvm-svn: 71643
2009-05-13 06:10:29 +00:00
Chris Lattner c898a68998 convert test to use -verify
llvm-svn: 71642
2009-05-13 06:07:25 +00:00
Chris Lattner cfd0fadc75 rename test
llvm-svn: 71641
2009-05-13 06:07:04 +00:00
Chris Lattner f160b5f9e1 When we expect two arguments but have zero, make sure to add
two empty arguments.  Also, add an assert so that this bug
manifests as an assertion failure, not a valgrind problem.

This fixes rdar://6880648 - [cpp] crash in ArgNeedsPreexpansion

llvm-svn: 71616
2009-05-13 00:55:26 +00:00
Daniel Dunbar f9d90275f9 Handle -march for the LLVM recognized cpu names.
- x86 target feature handling should not be feature complete, even if
   the code quality is lacking.

llvm-svn: 71123
2009-05-06 21:56:32 +00:00
Daniel Dunbar bb36aed06b More x86 target feature support.
- Apologies for the extremely gross code duplication, I want to get
   this working and then decide how to get this information out of the
   back end.

 - This replaces -m[no-]sse4[12] by -m[no-]sse4, it appears gcc
   doesn't distinguish them?

 - -msse, etc. now properly disable/enable related features.

 - Don't always define __SSE3__...

 - The main missing functionality bit here is that we don't initialize
   the features based on the CPU for all -march options.

llvm-svn: 71117
2009-05-06 21:07:50 +00:00
Eli Friedman 426056acf2 Fix the testcase for PR4132.
llvm-svn: 70796
2009-05-03 19:54:21 +00:00
Eli Friedman 2f621b72f4 Fix for PR4132: make sure to insert whitespace consistently before a
pasted token.

llvm-svn: 70793
2009-05-03 19:16:00 +00:00
Daniel Dunbar d58929be46 PR4063, with feeling: Chain PP callbacks by default.
- This is somewhat cleaner and also fixes PR4063 for real, I had the
   order wrong so we were just creating an empty dependency file.

llvm-svn: 70687
2009-05-03 10:04:17 +00:00
Daniel Dunbar f6d272f241 PR4063: Fix dependency generation with -E.
llvm-svn: 70686
2009-05-03 09:35:25 +00:00
Eli Friedman 2b680b43e9 Simplify the scheme used for keywords, and change the classification
scheme to be more useful.

The new scheme introduces a set of categories that should be more 
readable, and also reflects what we want to consider as an extension 
more accurately.  Specifically, it makes the "what is a keyword" 
determination accurately reflect whether the keyword is a GNU or 
Microsoft extension.

I also introduced separate flags for keyword aliases; this is useful 
because the classification of the aliases is mostly unrelated to the 
classification of the original keyword.

This patch treats anything that's in the implementation 
namespace (prefixed with "__", or "_X" where "X" is any upper-case 
letter) as a keyword without marking it as an extension.  This is 
consistent with the standards in that an implementation is allowed to define 
arbitrary extensions in the implementation namespace without violating 
the standard. This gets rid of all the nasty "extension used" warnings 
for stuff like __attribute__ in -pedantic mode.  We still warn for 
extensions outside of the the implementation namespace, like typeof.
If someone wants to implement -Wextensions or something like that, we 
could add additional information to the keyword table.

This also removes processing for the unused "Boolean" language option; 
such an extension isn't supported on any other C implementation, so I 
don't see any point to adding it.

The changes to test/CodeGen/inline.c are required because previously, we 
weren't actually disabling the "inline" keyword in -std=c89 mode.

I'll remove Boolean and NoExtensions from LangOptions in a follow-up 
commit.

llvm-svn: 70281
2009-04-28 03:13:54 +00:00
Chris Lattner 9a84589671 Change our silencing of C typedef redefinition handling to what we had
before r69391: typedef redefinition is an error by default, but if
*either* the old or new definition are from a system header, we silence
it.

llvm-svn: 70177
2009-04-27 01:46:12 +00:00
Chris Lattner 35cfb0544a make -Wtypedef-redefinition an extwarn instead of defaulting
to error, doing this breaks too many programs (e.g. Adium).

llvm-svn: 70170
2009-04-27 00:41:01 +00:00
Chris Lattner 40493eb6eb fix rdar://6816766 - Crash with function-like macro test at end of directive.
llvm-svn: 69964
2009-04-24 07:15:46 +00:00
Chris Lattner ca515ccb49 apply Eli's patch to fix PR4008, with a testcase. Thanks Eli!
llvm-svn: 69750
2009-04-21 23:28:41 +00:00
Chris Lattner f4c68741d4 fix the second half of PR4006 and rdar://6807000 by treating
() as being either zero arguments or one empty argument depending
on situation.

llvm-svn: 69627
2009-04-20 21:08:10 +00:00
Chris Lattner ddddff4f41 Fix PR4007: clang doesn't know -Werror-foo is the same as -Werror=foo
llvm-svn: 69557
2009-04-19 22:07:21 +00:00
Chris Lattner df2226839f Warn about uses of #pragma STDC FENV_ACCESS ON, since we don't
support it.  I don't know what evaluation method we use for complex
arithmetic, so I don't know whether/if we should warn about use of
CX_LIMITED_RANGE.

This concludes my planned hacking on STDC pragmas, flame away :)

llvm-svn: 69556
2009-04-19 21:55:32 +00:00
Chris Lattner 02ef4e3dba diagnose invalid syntax of STDC pragmas.
llvm-svn: 69554
2009-04-19 21:50:08 +00:00
Chris Lattner a0b1f76d10 reject invalid stuff in the STDC namespace.
llvm-svn: 69551
2009-04-19 21:25:37 +00:00
Chris Lattner 958ee04368 stub out STDC #pragmas.
llvm-svn: 69550
2009-04-19 21:20:35 +00:00
Chris Lattner 21656f22db basic support for -Wunknown-pragmas, more coming.
llvm-svn: 69547
2009-04-19 21:10:26 +00:00
Chris Lattner 1c1a00cf51 move token paste poisoning diagnostics to after the instantiation loc
for a token is set, this makes the diagnostic "expanded from stack" work
for this diagnostic.  Add a testcase for PR3918.

llvm-svn: 69544
2009-04-19 20:29:42 +00:00
Chris Lattner db41ddf756 pick a smaller header, one that we control to test this.
llvm-svn: 69540
2009-04-19 20:18:57 +00:00
Chris Lattner 1dc5219a0a rename test for consistency with other pragma test.
llvm-svn: 69539
2009-04-19 20:16:27 +00:00
Chris Lattner 0e71dbf9f0 merge pragma poison tests into one file with -verify mode.
llvm-svn: 69538
2009-04-19 20:15:59 +00:00
Chris Lattner ab9d51cfc4 merge two tests
llvm-svn: 69537
2009-04-19 20:10:12 +00:00
Chris Lattner 1377dc4c79 convert to -verify mode.
llvm-svn: 69532
2009-04-19 18:54:13 +00:00
Chris Lattner 249c38bb02 Fix PR4006, incorrect handling of __VA_ARGS__ when it was the first token
in a function-like macro body.  This has the added bonus of moving some
function-like macro specific code out of the object-like macro codepath.

llvm-svn: 69530
2009-04-19 18:26:34 +00:00
Chris Lattner 98b100590d fix rdar://6804322 by wiring up -fdollars-in-identifiers
with assembler-with-cpp mode.

llvm-svn: 69520
2009-04-19 07:00:02 +00:00
Chris Lattner ea73782ce3 convert to -verify mode.
llvm-svn: 69518
2009-04-19 06:56:11 +00:00