Commit Graph

12038 Commits

Author SHA1 Message Date
Chris Lattner 40cc0044e7 make scope checking be static functions instead of sema methods.
llvm-svn: 69429
2009-04-18 07:36:39 +00:00
Chris Lattner c2e868fd14 fix incorrect lowering of __builtin_ia32_shufpd, rdar://6803924
llvm-svn: 69428
2009-04-18 07:01:54 +00:00
Chris Lattner 032f7665d0 rename file.
llvm-svn: 69427
2009-04-18 07:00:54 +00:00
Chris Lattner 85e4dd4055 don't dump .ll file in this dir.
llvm-svn: 69426
2009-04-18 07:00:06 +00:00
Chris Lattner 24ad8621a4 __builtin_prefetch should be declared as "void __builtin_prefetch(const void *)",
not "const void __builtin_prefetch(void *)".  This fixes PR3912.

llvm-svn: 69425
2009-04-18 06:51:21 +00:00
Chris Lattner 974e1f40b3 rename test
llvm-svn: 69424
2009-04-18 06:49:47 +00:00
Chris Lattner 35dd5056fc fix PR3927 by being more careful about the pp test for identifier.
llvm-svn: 69423
2009-04-18 06:44:18 +00:00
Chris Lattner 5ca5d40cf4 second half of PR3940: #line requires simple digit sequence.
llvm-svn: 69422
2009-04-18 06:38:24 +00:00
Douglas Gregor 652d82a096 Store the type ID for __builtin_va_list in the PCH file, so that the
AST context's __builtin_va_list type will be set when the PCH file is
loaded. This fixes the crash when CodeGen'ing a va_arg expression
pulled in from a PCH file.

llvm-svn: 69421
2009-04-18 05:55:16 +00:00
Chris Lattner 751f045e32 this is really just a recommendation, not a requirement.
llvm-svn: 69416
2009-04-18 02:25:14 +00:00
Chris Lattner 2425bcb49a enforce requirements imposed by C90 6.8 TC1, fixing PR3919.
llvm-svn: 69415
2009-04-18 02:23:25 +00:00
Chris Lattner bc63de144f Fix PR3938 by taking into account C99 6.10p4.
llvm-svn: 69413
2009-04-18 01:34:22 +00:00
Chris Lattner b547394ba5 convert test to -verify style.
llvm-svn: 69412
2009-04-18 01:33:54 +00:00
Chris Lattner c17925da61 Substantially restructure function-like macro argument parsing.
Highlights: PP::isNextPPTokenLParen() no longer eats the ( 
when present.  We now simplify slightly the logic parsing
macro arguments.  We now handle PR3937 and other related cases
correctly.

llvm-svn: 69411
2009-04-18 01:13:56 +00:00
Douglas Gregor 111af7d7b4 Preliminary PCH support in the driver
llvm-svn: 69410
2009-04-18 00:34:01 +00:00
Douglas Gregor 3c3aa61758 Lazy deserialization of function bodies for PCH files. For the Carbon
"Hello, World!", this takes us from deserializing 6469
statements/expressions down to deserializing 1
statement/expression. It only translated into a 1% improvement on the
Carbon-prefixed 403.gcc, but (a) it's the right thing to do, and (b)
we expect this to matter more once we lazily deserialize identifiers.

llvm-svn: 69407
2009-04-18 00:07:54 +00:00
Douglas Gregor e3dcb2ddd1 FunctionDecl::getBody() is getting an ASTContext argument for use in
lazy PCH deserialization. Propagate that argument wherever it needs to
be. No functionality change, except that I've tightened up a few PCH
tests in preparation.

llvm-svn: 69406
2009-04-18 00:02:19 +00:00
Chris Lattner 7d59a92b45 remove dead diagnostic.
llvm-svn: 69405
2009-04-17 23:57:31 +00:00
Chris Lattner b40289b2b8 Fix two problems from PR3916, and one problem I noticed while hacking
on the code.

llvm-svn: 69404
2009-04-17 23:56:52 +00:00
Chris Lattner ca556cb3e3 implement PR3940: #line numbers not fully checked
llvm-svn: 69403
2009-04-17 23:37:49 +00:00
Chris Lattner 0003c27f5e #line is allowed to have macros that expand to nothing after them.
llvm-svn: 69401
2009-04-17 23:30:53 +00:00
Douglas Gregor 08f0129003 Keep track of the number of statements/expressions written to and read
from a PCH file. It turns out that "Hello, World!" is bringing in 19%
of all of the statements in Carbon.h, so we need to be lazy.

llvm-svn: 69393
2009-04-17 22:13:46 +00:00
Chris Lattner 6fdd57cba8 fix a crash compiling code with its own definition of objc_assign_weak.
rdar://6800430

llvm-svn: 69392
2009-04-17 22:12:36 +00:00
Chris Lattner 2581fc3fa9 tweak redefinition of a typedef a bit to fix a couple of problems:
1. We had logic in sema to decide whether or not to emit the error
   based on manually checking whether in a system header file.
2. we were allowing redefinitions of typedefs in class scope in C++
   if in header file.
3. there was no way to force typedef redefinitions to be accepted
   by the C compiler, which annoys me when stripping linemarkers out
   of .i files.

The fix is to split the C++ class typedef redefinition path from the
C path, and change the C path to be a warning that normally maps to
error.  This causes it to properly be ignored in system headers, 
etc. and gives us a way to control it.  Passing 
-Wtypedef-redefinition now turns the error into a warning.

One behavior change is that we now diagnose cases where you redefine
a typedef in your .c file that was defined in a header file.  This
seems like reasonable behavior, and the diagnostic now indicates that
it can be controlled with -Wtypedef-redefinition.

llvm-svn: 69391
2009-04-17 22:04:20 +00:00
Douglas Gregor ba6e557378 Fix two embarrassing PCH bugs:
1) Accidentally used delete [] on an array of statements that was allocated with ASTContext's allocator
  2) Deserialization of names with multiple declarations (e.g., a struct and a function) used the wrong mangling constant, causing it to view declaration IDs as Decl*s.

403.gcc builds and links properly.

llvm-svn: 69390
2009-04-17 21:46:47 +00:00
Devang Patel 12f0dea922 Use PresumedLoc to record line number in debug info entries.
llvm-svn: 69389
2009-04-17 21:35:15 +00:00
Daniel Dunbar 66b13dac0a Don't put msgrefs in used globals (in particular, we don't want
no-dead-strip set on them).

llvm-svn: 69388
2009-04-17 21:10:58 +00:00
Devang Patel 75009454e3 Appropriately set file name and directory name in debug info compile units.
llvm-svn: 69387
2009-04-17 21:06:59 +00:00
Chris Lattner 6395285306 implement a new clang-cc option -dump-build-information=filename which causes the
compiler to dump random stuff from the build into the file.  Right now this
amounts to dumping command line arguments and diagnostics to the file.

The idea is that you can set an envvar, do a world build of an OS, then grep 
through all the logs for interesting things or something.

Daniel, please wire the driver up to do something with this.

llvm-svn: 69386
2009-04-17 21:05:01 +00:00
Douglas Gregor f994f062fd PCH support for inline assembly statements.
This completes support for all of C (+ extensions). We can (again)
build a PCH file for Carbon.h.

llvm-svn: 69385
2009-04-17 20:57:14 +00:00
Chris Lattner 25ef69a36e refactor htmldiags to be created up front like the other diag clients.
llvm-svn: 69379
2009-04-17 20:40:01 +00:00
Chris Lattner c6b5613460 add a virtual method to DiagnosticClient to get rid of some fragile
casting in clang-cc.

llvm-svn: 69377
2009-04-17 20:16:08 +00:00
Douglas Gregor 5ceb1a2dd9 PCH tests for va_arg expressions. Verified that the blocks test does create a BlockDeclRefExpr
llvm-svn: 69376
2009-04-17 20:06:59 +00:00
Chris Lattner fbbf539c45 fix a crash on invalid by making ActOnDeclarator create decl with
a dummy *function* type when it is recovering and knows it needs 
a function.  rdar://6802350 - clang crash on invalid input

llvm-svn: 69374
2009-04-17 19:32:54 +00:00
Douglas Gregor c95701da6c PCH support for blocks
llvm-svn: 69373
2009-04-17 19:21:43 +00:00
Chris Lattner b63e1db6bc wire up comment diagnostics to -Wcomment, add it to -Wall. Now
you can silence these with -Wno-all or -Wno-comment, but they
still default to on.

llvm-svn: 69372
2009-04-17 19:09:26 +00:00
Douglas Gregor af97671954 PCH support for GNU statement expressions
llvm-svn: 69370
2009-04-17 19:05:30 +00:00
Douglas Gregor 779d865b48 PCH support for indirect gotos and address-of-label expressions.
llvm-svn: 69369
2009-04-17 18:58:21 +00:00
Chris Lattner 70a42144ca adjust for the new -Wvector-conversions option
llvm-svn: 69366
2009-04-17 18:39:25 +00:00
Chris Lattner cce935edfe move a vector conversion warning to be diabled by default (like gcc),
but add it to -Wall (unlike gcc) and give it a controlling group 
(-Wvector-conversions).

llvm-svn: 69365
2009-04-17 18:28:37 +00:00
Douglas Gregor 6cc68a47b5 PCH support for labels and goto.
llvm-svn: 69364
2009-04-17 18:18:49 +00:00
Steve Naroff 059c6f6293 Update Xcode project with some PCH related headers.
llvm-svn: 69363
2009-04-17 18:02:59 +00:00
Chris Lattner ff8a9e6ee4 fix misspelt attribute.
llvm-svn: 69362
2009-04-17 17:55:23 +00:00
Chris Lattner 10dae30049 Fix rdar://6800926 - crash compiling non-fragile _Bool bitfield ivar,
the functional change here is changing ConvertType -> ConvertTypeForMem
so that we handle i1 fields properly as memory.

llvm-svn: 69361
2009-04-17 17:46:19 +00:00
Chris Lattner c4688d21f7 tidy some code.
llvm-svn: 69360
2009-04-17 17:44:48 +00:00
Chris Lattner ead1e0002f clean up run lines.
llvm-svn: 69359
2009-04-17 17:43:56 +00:00
Chris Lattner e49652b1c8 add basic support for building DiagnosticGroups.inc with cmake
llvm-svn: 69357
2009-04-17 17:04:48 +00:00
Douglas Gregor 915b6c663d PCH support for declaration statements, and a test for PredefinedExpr
llvm-svn: 69356
2009-04-17 16:55:36 +00:00
Douglas Gregor f961e5921f PCH support for return statements.
Optimize PCH encoding for switch-case statements slightly, by making
the switch-case numbering local to a particular statement.

llvm-svn: 69355
2009-04-17 16:34:57 +00:00
Sebastian Redl 5775af1afd Implement lvalue test for conditional expressions.
Add a few commented lines to the test case that point out things that don't work yet.

llvm-svn: 69354
2009-04-17 16:30:52 +00:00