Michael J. Spencer
2c35bc1232
Revert r109428 "Hoist argument type checking into CheckFormatHandler. This is prep for scanf format"
...
Got errors about ASTContext being undefined with Visual Studio 2010.
llvm-svn: 109491
2010-07-27 04:46:02 +00:00
Jordy Rose
55442abee6
Don't warn about unreachable code if the block starts with __builtin_unreachable().
...
The next step is to warn if a block labeled unreachable is, in fact, reachable. Somewhat related to PR810.
llvm-svn: 109487
2010-07-27 03:39:53 +00:00
Ted Kremenek
2bd41d1e30
Add PTHLexer::LexEndOfFile() to emit diagnostics at end-of-file similar to those by Lexer::LexEndOfFile().
...
llvm-svn: 109486
2010-07-27 02:59:02 +00:00
Ted Kremenek
3d625eb2bf
Fix predicate in 'InCachingLexMode' to include 'CurPTHLexer'.
...
llvm-svn: 109485
2010-07-27 02:58:59 +00:00
Ted Kremenek
fee882ac95
PTH generation: Don't save the leading '#' token in a null directive. This unbreaks using PTH with Boost (<rdar://problem/8227989>).
...
llvm-svn: 109484
2010-07-27 02:58:57 +00:00
Jordy Rose
b052e8f436
Groundwork for C string length tracking. Currently only handles the length of constant string literals, which is not too helpful, and only calls to strlen() are checked.
...
llvm-svn: 109480
2010-07-27 01:37:31 +00:00
Douglas Gregor
ce3a8293a0
Implement -fno-validate-pch at the -cc1 level, which suppresses most
...
of the usual consistency checks used to determine when a precompiled
header is incompatible with the translation unit it's being loaded
into.
Enable this option when loading a precompiled preamble, because the
preamble loader will be performing all of this checking itself. Enable
the preamble-based test now that it's working.
This option is also useful for debugging Clang's PCH
(<rdar://problem/7532213>).
llvm-svn: 109475
2010-07-27 00:27:13 +00:00
Sebastian Redl
66c5eef182
- Fix recording of offsets of types in dependent PCHs.
...
- Stop reading in (and thus deserializing) every declaration in the TU when creating a dependent PCH.
- Switch the storage of a decl context's lexical declarations to a blob containing the IDs instead of a record. This is the only sane way of supporting update records later on.
llvm-svn: 109474
2010-07-27 00:17:23 +00:00
Douglas Gregor
81c000fb6d
When remapping a virtual file, also make an entry for the file with
...
its absolute path on disk. Also, introduce a fun test for the
precompiled preamble, which almost works...
llvm-svn: 109470
2010-07-26 23:54:23 +00:00
Fariborz Jahanian
0ebca28f1d
2nd argument of __builtin_expect must be evaluated
...
if it hs side-effect to matchgcc's behaviour.
Addresses radar 8172109.
llvm-svn: 109467
2010-07-26 23:11:03 +00:00
Chris Lattner
76f0cf457c
path renamed.
...
llvm-svn: 109464
2010-07-26 22:51:00 +00:00
John McCall
5cbe152ffc
Test for the presence of EH branch-throughs instead of normal branch-throughs.
...
I knew this code duplication would bite me.
llvm-svn: 109463
2010-07-26 22:44:58 +00:00
Benjamin Kramer
e93c39045a
Mark __builtin_eh_return as noreturn. Patch by Dimitry Andric.
...
llvm-svn: 109452
2010-07-26 22:04:15 +00:00
Dan Gohman
e83f624f44
Fix an apparent bug.
...
llvm-svn: 109447
2010-07-26 21:44:15 +00:00
Douglas Gregor
3f4bea0646
Introduce basic support for loading a precompiled preamble while
...
reparsing an ASTUnit. When saving a preamble, create a buffer larger
than the actual file we're working with but fill everything from the
end of the preamble to the end of the file with spaces (so the lexer
will quickly skip them). When we load the file, create a buffer of the
same size, filling it with the file and then spaces. Then, instruct
the lexer to start lexing after the preamble, therefore continuing the
parse from the spot where the preamble left off.
It's now possible to perform a simple preamble build + parse (+
reparse) with ASTUnit. However, one has to disable a bunch of checking
in the PCH reader to do so. That part isn't committed; it will likely
be handled with some other kind of flag (e.g., -fno-validate-pch).
As part of this, fix some issues with null termination of the memory
buffers created for the preamble; we were trying to explicitly
NULL-terminate them, even though they were also getting implicitly
NULL terminated, leading to excess warnings about NULL characters in
source files.
llvm-svn: 109445
2010-07-26 21:36:20 +00:00
Dan Gohman
4888f1a210
Minor code simplification.
...
llvm-svn: 109443
2010-07-26 21:33:22 +00:00
Dan Gohman
0eb9c124a7
It's not necessary to call flush() on a raw_ostream immediately prior
...
to deleting it.
llvm-svn: 109441
2010-07-26 21:29:50 +00:00
Dan Gohman
28ade550f4
Fix namespace polution.
...
llvm-svn: 109440
2010-07-26 21:25:24 +00:00
Dan Gohman
a8b949883e
Make a variable static.
...
llvm-svn: 109438
2010-07-26 21:12:29 +00:00
Dan Gohman
c0539d2eb6
Use an export file. Plugins must export llvm::Registry symbols.
...
Also, don't link in all the clang libraries statically.
llvm-svn: 109436
2010-07-26 21:12:10 +00:00
Ted Kremenek
df4472bca0
Hoist argument type checking into CheckFormatHandler. This is prep for scanf format
...
string argument type checking.
llvm-svn: 109428
2010-07-26 19:45:54 +00:00
Ted Kremenek
6adb7e35ab
Consolidate #args checking for scanf/printf format strings.
...
llvm-svn: 109427
2010-07-26 19:45:42 +00:00
Devang Patel
6005082354
Revert 109303.
...
llvm-svn: 109426
2010-07-26 18:49:27 +00:00
Sebastian Redl
ae8cbb7220
Make sure that implicit qualification and derived-to-base conversions of xvalues preserve xvalue-ness. Unfortunately I have no idea how to test this property; there doesn't seem to be a syntactical construct that triggers such a conversion and still allows the distinction between prvalues and xvalues to be made.
...
llvm-svn: 109406
2010-07-26 17:52:21 +00:00
Nick Lewycky
19b9f958e1
Add source location information to C++ base specifiers.
...
llvm-svn: 109396
2010-07-26 16:56:01 +00:00
Douglas Gregor
d6009ffb8e
When LIBCLANG_CODE_COMPLETION_LOGGING is set in the environment, log code-completion command lines to stderr
...
llvm-svn: 109395
2010-07-26 16:29:14 +00:00
Douglas Gregor
67ca40c419
Eliminate the "minimal" and printing parser actions, which only ever
...
worked for C anyway. Also kills the -cc1 options -parse-noop and
-parse-print-callbacks.
llvm-svn: 109392
2010-07-26 04:08:02 +00:00
Benjamin Kramer
f5c4b49278
Wrap bit mangling logic for DiagMappings in its own class so it doesn't leak
...
into other code. Make it an array instead of a constant-length vector.
llvm-svn: 109384
2010-07-25 21:40:48 +00:00
Douglas Gregor
29b8e3d91c
Remove a bunch of trivial destructors
...
llvm-svn: 109382
2010-07-25 18:44:37 +00:00
Douglas Gregor
5a9310cfb9
Move Type destructor out-of-line
...
llvm-svn: 109381
2010-07-25 18:39:40 +00:00
Douglas Gregor
9c832f75c0
Remove destructors from declaration nodes
...
llvm-svn: 109380
2010-07-25 18:38:02 +00:00
Douglas Gregor
717ceeae76
I lied. Kill off a few more Destroy methods
...
llvm-svn: 109379
2010-07-25 18:32:30 +00:00
Douglas Gregor
a9b2dbc1a4
Kill off the last Destroy method in the AST library
...
llvm-svn: 109378
2010-07-25 18:23:53 +00:00
Douglas Gregor
b412e174db
Remove the vast majority of the Destroy methods from the AST library,
...
since we aren't going to be calling them ever.
llvm-svn: 109377
2010-07-25 18:17:45 +00:00
Douglas Gregor
5b11d49a7c
Make ASTContext always use the BumpPtrAllocator.
...
llvm-svn: 109375
2010-07-25 17:53:33 +00:00
Douglas Gregor
f2430ba223
Start removing the use of smart pointers from the Parse/Sema
...
interaction, by effectively defaulting to
DISABLE_SMART_POINTERS. We're embracing the model where all AST nodes
are ASTContext-allocated and live as long as the ASTContext lives.
llvm-svn: 109374
2010-07-25 17:39:21 +00:00
Nick Lewycky
e602efc6f6
Remove emacs file mode marker on file with .cpp extension.
...
llvm-svn: 109366
2010-07-25 03:12:58 +00:00
Eli Friedman
e4686d7acf
Remove dead code.
...
llvm-svn: 109358
2010-07-24 21:35:09 +00:00
Nick Lewycky
84a11fdf57
Add header searching for llvm-gcc trunk on Gentoo AMD64. Patch by Mark Wood!
...
llvm-svn: 109357
2010-07-24 21:33:13 +00:00
Eli Friedman
9255adfb7a
PR7698: Make sure we correctly handle the initialization of an array with
...
dependent size.
llvm-svn: 109356
2010-07-24 21:19:15 +00:00
Peter Collingbourne
5a75e1ae07
Fix clang-interpreter build
...
llvm-svn: 109347
2010-07-24 17:59:51 +00:00
Nick Lewycky
c863c0fa75
Fix sort order.
...
llvm-svn: 109319
2010-07-24 02:58:13 +00:00
John McCall
268b576b72
Mangle enum constant expressions. Fixes rdar://problem/8204122
...
llvm-svn: 109315
2010-07-24 01:17:35 +00:00
Chris Lattner
938533db60
turn down the logical bitwise confusion warning to not warn
...
when the RHS of the ||/&& is ever 0 or 1. This handles a variety of
creative idioms for "true" used in C programs and fixes many false
positives at the expense of a few false negatives. This fixes
rdar://8230351.
llvm-svn: 109314
2010-07-24 01:10:11 +00:00
Devang Patel
268ad093a7
Untangle filename/dirname confusion. Store constructed strings on the side. Avoid use of Path.makeAbsolute().
...
DW_TAG_compile_unit uses two attributes DW_AT_name and DW_AT_comp_dir. Their expected values are:
$ clang foo.c -g
DW_AT_name - foo.c
DW_AT_comp_dir - `pwd`
$ clang one/two/foo.c -g
DW_AT_name - one/two/foo.c
DW_AT_comp_dir - `pwd`
$ clang /tmp/one/foo.c -g
DW_AT_name - /tmp/one/foo.c
DW_AT_comp_dir - empty
llvm-svn: 109303
2010-07-24 00:59:16 +00:00
Douglas Gregor
f5275a8339
Put a newline at the end of the padded buffers used for the
...
precompiled preamble. This will suppress the -pedantic "no newline at
end of file" warning.
llvm-svn: 109301
2010-07-24 00:42:07 +00:00
Douglas Gregor
6481ef1f9c
Once we've built (or reused) a precompiled preamble, create the
...
appropriately-padded main file buffer (that has spaces in the extra
"reserved" space) and thread that buffer through to the parsing
function. This still does nothing.
llvm-svn: 109299
2010-07-24 00:38:13 +00:00
John McCall
2ca705eb13
Support catching Objective C pointers in C++ under the non-fragile NeXT runtime.
...
Diagnose attempts to do this under the GNU or fragile NeXT runtimes.
llvm-svn: 109298
2010-07-24 00:37:23 +00:00
Fariborz Jahanian
72cdffa401
Return type of a setter call caused by
...
use of property-dot syntax using 'super' as receiver
is 'void'. This fixes a bug in generating correct
API for setter call. Fixes radar 8203426.
llvm-svn: 109297
2010-07-24 00:34:08 +00:00
Douglas Gregor
536f091f95
Be careful; even though we had a proper name at the beginning of
...
Sema::ActOnDeclarator doesn't mean that the Decl we ended up creating
has a useful name. <rdar://problem/8229910>
llvm-svn: 109296
2010-07-24 00:10:38 +00:00