summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend
Commit message (Collapse)AuthorAgeFilesLines
...
* Template instantiation for do-while statements.Douglas Gregor2009-05-152-0/+2
| | | | llvm-svn: 71899
* Template instantiation for "if" statements. Also:Douglas Gregor2009-05-152-0/+2
| | | | | | | | - Skip semantic analysis of the "if" condition if it is type-dependent. - Added the location of the "else" keyword into IfStmt, so that we can provide it for type-checking after template instantiation. llvm-svn: 71875
* When word-wrapping, be more defensive about a ridiculously small number of ↵Douglas Gregor2009-05-151-2/+4
| | | | | | columns. Fixes <rdar://problem/6892178> llvm-svn: 71870
* Fix processing of -Ufoo to not inject "#undef foo 1" into the predefinesChris Lattner2009-05-151-1/+11
| | | | | | | | | | | | | | | | buffer. This caused exciting nonsense like this: $ clang t.c -fsyntax-only -UMACRO In file included from <built-in>:104: <command line>:1:14: warning: extra tokens at end of #undef directive [-Wextra-tokens] #undef MACRO 1 ^ // 1 diagnostic generated. rdar://6891800 llvm-svn: 71860
* Check that the function being overridden is virtual.Anders Carlsson2009-05-142-2/+2
| | | | llvm-svn: 71802
* Improvements to the FunctionDecl getters/setters.Anders Carlsson2009-05-142-4/+4
| | | | llvm-svn: 71800
* Link FunctionDecls instantiated from the member functions of a classDouglas Gregor2009-05-142-0/+2
| | | | | | | | template to the FunctionDecls from which they were instantiated. This is a necessary first step to support instantiation of the definitions of such functions, but by itself does essentially nothing. llvm-svn: 71792
* Disable access control by default. It can be enabled with the ↵Anders Carlsson2009-05-132-0/+3
| | | | | | -faccess-control option. When we have better support for it, we can enable it by default again. llvm-svn: 71706
* Some early declarations to support sentinel attribute onFariborz Jahanian2009-05-132-0/+14
| | | | | | | message dispatches (and function calls later). No change in functionality. llvm-svn: 71683
* Make precompiled headers work with -E. When we're only preprocessingDouglas Gregor2009-05-122-11/+125
| | | | | | | (with -E), we turn the PCH include into an implicit include of the file from which the PCH file was generated. llvm-svn: 71534
* Implement C++0x nullptr.Sebastian Redl2009-05-102-0/+2
| | | | llvm-svn: 71405
* Add back Parse/Sema support for attributes cf_returns_retained andTed Kremenek2009-05-092-0/+4
| | | | | | | ns_returns_retained, but do not include the other ownership attributes we previously had. llvm-svn: 71308
* Remove experimental ownership attributes from Clang.Ted Kremenek2009-05-082-14/+0
| | | | llvm-svn: 71216
* Back out r70506 (exception spec in AST) again. We won't have exception specs ↵Sebastian Redl2009-05-062-14/+1
| | | | | | until we've had a lot more discussion. llvm-svn: 71125
* Eliminate extra vertical space in Clang diagnosticsDouglas Gregor2009-05-061-21/+3
| | | | llvm-svn: 71066
* Fix rdar://6849429 - -Wunused-value with deeply nested macro expansion ↵Chris Lattner2009-05-051-14/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | generates untraceable warnings The "instantiated from" messages coming from the caret diagnostics system are basically walking the macro expansion tree, emitting each level as it goes. However, it was skipping certain leaves in the tree by skipping up the entire instantiation arm every time it went up one spelling arm. This caused it to miss some things. For example, in this testcase: #define M1(x) x #define M2 1; void foo() { M1(M2) } we now print: /Users/sabre/Desktop/clang-unused-value-macro.c:6:2: warning: expression result unused M1(M2) ^~~~~~ /Users/sabre/Desktop/clang-unused-value-macro.c:6:5: note: instantiated from: M1(M2) ^~ /Users/sabre/Desktop/clang-unused-value-macro.c:3:12: note: instantiated from: #define M2 1; ^ Previously we didn't print the last line, so we never emitted the caret pointing to the 1! Incidentally, the spaces between the lines is really noisy, I think we should reconsider this heuristic (which adds them when the printed code starts too close to the start of the line). The regression test can't use -verify, because -verify doesn't catch notes for macro instantiation history. llvm-svn: 71025
* Implement attribute 'ns_autorelease'.Ted Kremenek2009-05-052-0/+2
| | | | llvm-svn: 70990
* Implement attribute 'cf_returns_owned' (mirrors 'ns_returns_owned').Ted Kremenek2009-05-052-0/+2
| | | | llvm-svn: 70952
* Remove experimental attribute 'ns_ownership_make_collectable.'Ted Kremenek2009-05-042-2/+0
| | | | llvm-svn: 70940
* Rename attributes 'objc_ownership...' to 'ns_ownership...'.Ted Kremenek2009-05-042-8/+8
| | | | llvm-svn: 70897
* Rename attributes:Ted Kremenek2009-05-042-4/+4
| | | | | | | | | | | 'objc_ownership_cfretain' -> 'cf_ownership_retain' 'objc_ownership_cfrelease' -> 'cf_ownership_release' Motivation: Core Foundation objects can be used in isolation from Objective-C, and this forces users to reason about the separate semantics of CF objects. More Sema support pending. llvm-svn: 70884
* Simplify the interesting-region code by assimmilating blocks of ↵Douglas Gregor2009-05-041-57/+18
| | | | | | non-whitespace text with each expansion step. It's easier and seems to have better results. llvm-svn: 70833
* Tweak the extraction of the "interesting" part of a source range in two ways: Douglas Gregor2009-05-041-4/+19
| | | | | | | | | 1) First of all, we treat _ as part of an identifier and not as punctuation (oops). 2) Second of all, always make sure that the token that the ^ is pointing at is fully within the "interesting" part of the range. llvm-svn: 70831
* Fix an infinite loop in diagnostic printing.Daniel Dunbar2009-05-031-7/+5
| | | | | | | | | | - The diagnostic is still poor, however. Doug, can you investigate? - Improved the test case to not depend on the file name, now it can be extended to actually check the formatting of the diagnostics (I'm hoping grep -A is portable here). llvm-svn: 70807
* Fix crash in source-line truncation code for diagnosticDouglas Gregor2009-05-031-2/+3
| | | | | | | printing. Also, when we only need to truncate the line at the end, make sure there is room for the ellipsis. llvm-svn: 70781
* temporary hack to work around PR4128Chris Lattner2009-05-031-1/+1
| | | | llvm-svn: 70681
* When a fix-it hint would span multiple lines, don't print it; half aDouglas Gregor2009-05-031-0/+21
| | | | | | | | | fix-it hint is much worse than no fix-it hint. (Fixes PR4084). When we need to truncate a source line to fix in the terminal, make sure to take the width of the fix-it information into account, too. llvm-svn: 70656
* When we truncate a source line to fit it within the terminal width,Douglas Gregor2009-05-031-5/+6
| | | | | | | | | | | | show an ellipsis where we have removed text. An example: /Users/dgregor/Projects/llvm/tools/clang/test/Misc/message-length.c:18:120: warning: comparison of distinct pointer types ('int *' and 'float *') ...a_func_to_call(ip == FloatPointer, ip[ALongIndexName], ... ~~ ^ ~~~~~~~~~~~~ llvm-svn: 70655
* Respect the COLUMNS environment variable for word-wrapping (so we getDouglas Gregor2009-05-031-1/+2
| | | | | | | | | | | word-wrapping by default in Emacs; yay!). Thanks, Daniel. Use LLVM's System layer rather than calling isatty() directly. Fix a thinko in printing the indentation string that was causing some weird output. llvm-svn: 70654
* When printing a source line as part of a diagnostic, the source lineDouglas Gregor2009-05-011-35/+180
| | | | | | | | | | | | | | | | | | | | | | | | might be wider than we're supposed to print. In this case, we try to select the "important" subregion of the source line, which contains everything that we want to show (e.g., with underlining and the caret itself) and tries to also contain some of the context. From the fantastically long line in the test case, we get an error message that slices down to this: message-length.c:18:120: warning: comparison of distinct pointer types ('int *' and 'float *') a_func_to_call(ip == FloatPointer, ip[ALongIndexName], ~~ ^ ~~~~~~~~~~~~ There are a bunch of gee-it-sounds-good heuristics in here, which seem to do well on the various simple tests I've thrown at it. However, we're going to need to look at a bunch more diagnostics to tweak these heuristics. This is the second part of <rdar://problem/6711348>. Almost there! llvm-svn: 70597
* Implement -fmessage-length=N, which word-wraps diagnostics to N columns. Douglas Gregor2009-05-011-7/+211
| | | | | | | | | | | | | | | | | | | | | | | | | | Also, put a line of whitespace between the diagnostic and the source code/caret line when the start of the actual source code text lines up (or nearly lines up) with the most recent line of the diagnostic. For example, here it's okay for the last line of the diagnostic to be (vertically) next to the source line, because there is horizontal whitespace to separate them: decl-expr-ambiguity.cpp:12:16: error: function-style cast to a builtin type can only take one argument typeof(int)(a,5)<<a; However, here is a case where we need the vertical separation (since there is no horizontal separation): message-length.c:10:46: warning: incompatible pointer types initializing 'void (int, float, char, float)', expected 'int (*)(int, float, short, float)' int (*fp1)(int, float, short, float) = f; This is part one of <rdar://problem/6711348>. llvm-svn: 70578
* Make a home for exception specs in the AST. Now Sema can hook them up.Sebastian Redl2009-04-302-1/+14
| | | | llvm-svn: 70506
* initial support for __[u]int128_t, which should be basicallyChris Lattner2009-04-302-0/+4
| | | | | | | | compatible with VC++ and GCC. The codegen/mangling angle hasn't been fully ironed out yet. Note that we accept int128_t even in 32-bit mode, unlike gcc. llvm-svn: 70464
* BugReporter/PathDiagnostics:Ted Kremenek2009-04-291-0/+1
| | | | | | | | | - Add an (optional) short description for BugReports for clients that want to distinguish between long and short descriptions for bugs - Make the bug report for VLA less obscene for Plist diagnostics by using the short description llvm-svn: 70415
* In -fdiagnostics-print-source-range-info mode, print a space before theChris Lattner2009-04-281-1/+14
| | | | | | | lines that clang extracts from the source code so that machine parsing can easily ignore them. llvm-svn: 70337
* Implement ownership attribute 'objc_ownership_make_collectable'. This allows oneTed Kremenek2009-04-282-2/+4
| | | | | | to add 'CFMakeCollectable' semantics to a method. llvm-svn: 70336
* Make all PCH-incompatibility warnings into errors, and abortDouglas Gregor2009-04-281-10/+1
| | | | | | | compilation if the user requested a PCH file but no such PCH file exists. llvm-svn: 70332
* Make the PCH reader use the diagnostics system for its complaints.Douglas Gregor2009-04-282-52/+46
| | | | llvm-svn: 70330
* Optimize IdentifierInfo storage within the precompiled header. We'veDouglas Gregor2009-04-282-15/+10
| | | | | | now gotten back about 180k of the 500k we lost. llvm-svn: 70326
* Implement a minor space optimization for the PCH identifier table,Douglas Gregor2009-04-282-12/+45
| | | | | | | | which eliminates the storage for IdentifierInfo in the "uninteresting identifier" cases. Sadly, this only brought back 7k of the 500k we lost :( llvm-svn: 70325
* Replace a lame fprintf with a slightly-less lame diagnosticDouglas Gregor2009-04-281-4/+4
| | | | llvm-svn: 70322
* Implement checking for macro definitions that occur on the commandDouglas Gregor2009-04-282-8/+33
| | | | | | | | line when using a PCH that were not provided when building the PCH file. If those names were used as identifiers somewhere in the PCH file, reject the PCH file. llvm-svn: 70321
* Revert r70075 and r70078, which reorganized the PCH on-disk hash tableDouglas Gregor2009-04-282-76/+12
| | | | | | | | | | for identifiers to separate "interesting" from "uninteresting" identifiers. However, to cope with compiler invocations where the predefines buffers mismatch, we need to be able to search the complete identifier table. Cocoa.h.pch is now about 500k larger that it used to be :( llvm-svn: 70320
* Allow some differences between the predefines buffer used to build aDouglas Gregor2009-04-281-42/+182
| | | | | | | | | | | | | PCH file and the predefines buffer used when including the PCH file. We (explicitly) detect conflicting macro definitions (rejecting the PCH file) and about missing macro definitions (they'll be automatically pulled from the PCH file anyway). We're missing some checking to make sure that new macro definitions won't have any impact on the PCH file itself (e.g., #define'ing an identifier that the PCH file used). llvm-svn: 70316
* Remove unused LangOptions NoExtensions and Boolean.Eli Friedman2009-04-282-4/+0
| | | | llvm-svn: 70282
* Add a header containing the Clang version; make the driver use thisDouglas Gregor2009-04-272-10/+25
| | | | | | | | | Clang version value rather than hard-coding "1.0". Add PCH and Clang version information into the PCH file. Reject PCH files with the wrong version information. llvm-svn: 70264
* fix test/PCH/method_pool.mChris Lattner2009-04-271-1/+1
| | | | llvm-svn: 70263
* -E, -Eonly and -parse-noop now work with PCH!Chris Lattner2009-04-271-0/+2
| | | | llvm-svn: 70259
* Teach PCH that ASTContext is optional. Move -parse-noop and -Eonly (so far)Chris Lattner2009-04-273-125/+128
| | | | | | | processing to after PCH is loaded. -Eonly and -parse-noop are close to working with PCH now but are not quite there yet. llvm-svn: 70257
* Be more careful in our teardown of the PCHReader after deciding toDouglas Gregor2009-04-271-0/+8
| | | | | | ignore a PCH file. llvm-svn: 70251
OpenPOWER on IntegriCloud