summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix use-after-free with precompiled preamblesDouglas Gregor2010-07-271-3/+9
| | | | llvm-svn: 109505
* Always deserialize from PCH file scoped variables with non trivial ↵Argyrios Kyrtzidis2010-07-271-0/+8
| | | | | | | | constructor/destructor. Fixes http://llvm.org/PR7692 llvm-svn: 109501
* Revert r109428 "Hoist argument type checking into CheckFormatHandler. This ↵Michael J. Spencer2010-07-273-62/+42
| | | | | | | | is prep for scanf format" Got errors about ASTContext being undefined with Visual Studio 2010. llvm-svn: 109491
* Don't warn about unreachable code if the block starts with ↵Jordy Rose2010-07-271-1/+16
| | | | | | | | __builtin_unreachable(). The next step is to warn if a block labeled unreachable is, in fact, reachable. Somewhat related to PR810. llvm-svn: 109487
* Add PTHLexer::LexEndOfFile() to emit diagnostics at end-of-file similar to ↵Ted Kremenek2010-07-271-4/+25
| | | | | | those by Lexer::LexEndOfFile(). llvm-svn: 109486
* PTH generation: Don't save the leading '#' token in a null directive. This ↵Ted Kremenek2010-07-271-4/+9
| | | | | | unbreaks using PTH with Boost (<rdar://problem/8227989>). llvm-svn: 109484
* Groundwork for C string length tracking. Currently only handles the length ↵Jordy Rose2010-07-271-2/+189
| | | | | | of constant string literals, which is not too helpful, and only calls to strlen() are checked. llvm-svn: 109480
* Implement -fno-validate-pch at the -cc1 level, which suppresses mostDouglas Gregor2010-07-275-18/+33
| | | | | | | | | | | | | | | 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
* - Fix recording of offsets of types in dependent PCHs.Sebastian Redl2010-07-275-43/+76
| | | | | | | - 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
* When remapping a virtual file, also make an entry for the file withDouglas Gregor2010-07-261-0/+12
| | | | | | | its absolute path on disk. Also, introduce a fun test for the precompiled preamble, which almost works... llvm-svn: 109470
* 2nd argument of __builtin_expect must be evaluatedFariborz Jahanian2010-07-261-1/+4
| | | | | | | if it hs side-effect to matchgcc's behaviour. Addresses radar 8172109. llvm-svn: 109467
* Test for the presence of EH branch-throughs instead of normal branch-throughs.John McCall2010-07-261-1/+1
| | | | | | I knew this code duplication would bite me. llvm-svn: 109463
* Introduce basic support for loading a precompiled preamble whileDouglas Gregor2010-07-267-33/+117
| | | | | | | | | | | | | | | | | | | | | | | 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
* Minor code simplification.Dan Gohman2010-07-261-2/+1
| | | | llvm-svn: 109443
* It's not necessary to call flush() on a raw_ostream immediately priorDan Gohman2010-07-262-2/+0
| | | | | | to deleting it. llvm-svn: 109441
* Fix namespace polution.Dan Gohman2010-07-269-3/+28
| | | | llvm-svn: 109440
* Hoist argument type checking into CheckFormatHandler. This is prep for ↵Ted Kremenek2010-07-263-42/+62
| | | | | | | | scanf format string argument type checking. llvm-svn: 109428
* Consolidate #args checking for scanf/printf format strings.Ted Kremenek2010-07-261-30/+31
| | | | llvm-svn: 109427
* Revert 109303.Devang Patel2010-07-262-40/+14
| | | | llvm-svn: 109426
* Make sure that implicit qualification and derived-to-base conversions of ↵Sebastian Redl2010-07-261-4/+8
| | | | | | 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
* Add source location information to C++ base specifiers.Nick Lewycky2010-07-2610-44/+50
| | | | llvm-svn: 109396
* Eliminate the "minimal" and printing parser actions, which only everDouglas Gregor2010-07-267-1163/+105
| | | | | | | worked for C anyway. Also kills the -cc1 options -parse-noop and -parse-print-callbacks. llvm-svn: 109392
* Wrap bit mangling logic for DiagMappings in its own class so it doesn't leakBenjamin Kramer2010-07-251-5/+2
| | | | | | into other code. Make it an array instead of a constant-length vector. llvm-svn: 109384
* Remove a bunch of trivial destructorsDouglas Gregor2010-07-251-2/+0
| | | | llvm-svn: 109382
* Move Type destructor out-of-lineDouglas Gregor2010-07-251-0/+2
| | | | llvm-svn: 109381
* Remove destructors from declaration nodesDouglas Gregor2010-07-254-35/+1
| | | | llvm-svn: 109380
* I lied. Kill off a few more Destroy methodsDouglas Gregor2010-07-252-25/+1
| | | | llvm-svn: 109379
* Kill off the last Destroy method in the AST libraryDouglas Gregor2010-07-252-11/+0
| | | | llvm-svn: 109378
* Remove the vast majority of the Destroy methods from the AST library,Douglas Gregor2010-07-2527-621/+17
| | | | | | since we aren't going to be calling them ever. llvm-svn: 109377
* Make ASTContext always use the BumpPtrAllocator.Douglas Gregor2010-07-254-73/+15
| | | | llvm-svn: 109375
* Remove emacs file mode marker on file with .cpp extension.Nick Lewycky2010-07-251-1/+1
| | | | llvm-svn: 109366
* Remove dead code.Eli Friedman2010-07-241-3/+0
| | | | llvm-svn: 109358
* Add header searching for llvm-gcc trunk on Gentoo AMD64. Patch by Mark Wood!Nick Lewycky2010-07-241-1/+6
| | | | llvm-svn: 109357
* PR7698: Make sure we correctly handle the initialization of an array withEli Friedman2010-07-241-4/+1
| | | | | | dependent size. llvm-svn: 109356
* Mangle enum constant expressions. Fixes rdar://problem/8204122John McCall2010-07-241-0/+6
| | | | llvm-svn: 109315
* turn down the logical bitwise confusion warning to not warn Chris Lattner2010-07-241-11/+14
| | | | | | | | | 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
* Untangle filename/dirname confusion. Store constructed strings on the side. ↵Devang Patel2010-07-242-14/+40
| | | | | | | | | | | | | | | | | | | | 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
* Put a newline at the end of the padded buffers used for theDouglas Gregor2010-07-241-4/+6
| | | | | | | precompiled preamble. This will suppress the -pedantic "no newline at end of file" warning. llvm-svn: 109301
* Once we've built (or reused) a precompiled preamble, create theDouglas Gregor2010-07-241-31/+45
| | | | | | | | 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
* Support catching Objective C pointers in C++ under the non-fragile NeXT runtime.John McCall2010-07-245-24/+77
| | | | | | Diagnose attempts to do this under the GNU or fragile NeXT runtimes. llvm-svn: 109298
* Return type of a setter call caused byFariborz Jahanian2010-07-241-1/+1
| | | | | | | | 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
* Be careful; even though we had a proper name at the beginning ofDouglas Gregor2010-07-241-1/+1
| | | | | | | Sema::ActOnDeclarator doesn't mean that the Decl we ended up creating has a useful name. <rdar://problem/8229910> llvm-svn: 109296
* Once we've built a precompiled preamble, keep track of the details ofDouglas Gregor2010-07-231-42/+164
| | | | | | | | | | | | that preamble (the preamble text, preamble file, reserved main file size). Check these details when we try to rebuild the precompiled preamble, and when nothing has changed, re-use the precompiled preamble. This code is still very much a WIP, and can't even properly be tested because we have no way to use the precompiled preamble yet. "Trust me" llvm-svn: 109294
* Make declarations in the dependent PCH visible, for C at least.Sebastian Redl2010-07-233-11/+36
| | | | llvm-svn: 109292
* Added an path-sensitive unreachable code checker to the experimental ↵Tom Care2010-07-234-9/+154
| | | | | | | | | | analyzer checks. - Created a new class to do post-analysis - Updated several test cases with unreachable code to expect a warning - Added some general tests llvm-svn: 109286
* Revert r109263.Devang Patel2010-07-231-15/+8
| | | | llvm-svn: 109284
* We never want to pop the translation unit DC, so assert if this happens.John McCall2010-07-231-0/+1
| | | | llvm-svn: 109280
* Revise cleanup IR generation to fix a major bug with cleanups (PR7686)John McCall2010-07-238-376/+801
| | | | | | | as well as some significant asymptotic inefficiencies with threading multiple jumps through deep cleanups. llvm-svn: 109274
* Allow __func__ and __FUNCTION__ and __PRETTY_FUNCTION__ inside blocks.Fariborz Jahanian2010-07-231-0/+2
| | | | | | Radar 8218839. llvm-svn: 109272
* There is no need to use separate dir name for AT_comp_dir attribute. Using ↵Devang Patel2010-07-231-8/+15
| | | | | | absolute path for filename allows clients to query complete file location info from gdb breakpoints. Save constructed full file name. llvm-svn: 109263
OpenPOWER on IntegriCloud