summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
* Convert inline asm source ranges into clang SourceRanges and print them with ↵Benjamin Kramer2011-10-161-2/+11
| | | | | | | | | | | | | | the instantiated note. t.c:2:7: error: invalid operand for instruction asm("movl 0(%rax), 0(%edx)"); ^ <inline asm>:1:16: note: instantiated into assembly here movl 0(%rax), 0(%edx) ^~~~~~~ 1 error generated. llvm-svn: 142131
* I fixed this with r142127; these notes now make sense even w/o the caret.Chandler Carruth2011-10-161-1/+0
| | | | llvm-svn: 142129
* Hoist the logic I added to compute the macro name into a helperChandler Carruth2011-10-161-16/+30
| | | | | | function. No functionality changed. llvm-svn: 142128
* Now that macro expansion notes are real notes and go through the sameChandler Carruth2011-10-164-44/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | formatting as any other diagnostic, they will be properly line wrapped and otherwise pretty printed. Let's take advantage of that and the new factoring to add some helpful information to them (much like template backtrace notes and other notes): the name of the macro whose expansion is being noted. This makes a world of difference if caret diagnostics are disabled, making the expansion notes actually useful in this case. It also helps ensure that in edge cases the information the user needs is present. Consider: % nl -ba t5.cc 1 #define M(x, y, z) \ 2 y 3 4 M( 5 1, 6 2, 7 3); We now produce: % ./bin/clang -fsyntax-only t5.cc t5.cc:6:3: error: expected unqualified-id 2, ^ t5.cc:2:3: note: expanded from macro: M y ^ 1 error generated. Without the added information in the note, the name of the macro being expanded would never be shown. This also deletes a FIXME to use the diagnostic formatting. It's not yet clear to me that we *can* do this reasonably, and the production of this message was my primary goal here anyways. I'd love any comments or suggestions on improving these notes, their wording, etc. Currently, I need to make them provide more helpful information in the presence of a token-pasting buffer, and I'm pondering adding something along the lines of "expanded from argument N of macro: ...". llvm-svn: 142127
* Fix the original bug in our diagnostic printing that got me started onChandler Carruth2011-10-161-29/+12
| | | | | | | | | | | | | this long quest: actually use the note printing machinery for each macro expansion note rather than a hacky version of it. This will colorize and format the notes the same as any other. There is still some stuff to fix here, but it's one step closer. No test case changes because currently we don't do anything differently that I can FileCheck for -- I don't really want to try matching the color escape codes... Suggestions for how to test this are welcome. =] llvm-svn: 142121
* Now that the structure of this is more reasonably laid out, fix a longChandler Carruth2011-10-163-33/+55
| | | | | | | | | | | | | | | standing deficiency: we were providing no macro backtrace information whenever caret diagnostics were turned off. This sinks the logic for suppressing the code snippet and caret to the code that actually prints tho code snippet and caret. Along the way, clean up the naming of functions, remove some now fixed FIXMEs, and generally improve the wording and logic of this process. Add a test case exerecising this functionality. It is notable that the resulting messages are extremely low quality. I'm working on a follow-up patch that should address this and have left a FIXME in the test case. llvm-svn: 142120
* Add a prefix to the existing test to prepare for more tests of otherChandler Carruth2011-10-161-14/+15
| | | | | | backtrace behavior. llvm-svn: 142119
* Fold two run lines into a single logical one, and move them down belowChandler Carruth2011-10-161-4/+5
| | | | | | | | the important code in this test to make the test more stable. Now adding further tests won't shift the line numbers occuring in the diagnostic output. llvm-svn: 142118
* Rename this test to a more general name in preparation for adding moreChandler Carruth2011-10-161-6/+6
| | | | | | tests to it to cover more of the macro bactrace functionality. llvm-svn: 142116
* Enable CREATE_SUBDIRS for a performance win, because there are a lot of ↵Bill Wendling2011-10-161-1/+1
| | | | | | files being generated. llvm-svn: 142113
* Add proper doxyments to the entry point routine, and remove a dead parameter.Chandler Carruth2011-10-162-4/+14
| | | | llvm-svn: 142109
* Persist the TextDiagnostic object across multiple diagnostics as long asChandler Carruth2011-10-164-59/+38
| | | | | | | | | the SourceManager doesn't change, and the source files don't change. This greatly simplifies the interfaces and interactions. The lifetime of the TextDiagnostic object forms the 'session' over which we attempt to condense and deduplicate information in diagnostics. llvm-svn: 142104
* Clean up the names of all the TextDiagnostic methods (and even a staticChandler Carruth2011-10-153-38/+40
| | | | | | | function) to agree with the coding conventions, and in one case have a bit more information in it. llvm-svn: 142088
* Move two functions out of the public interface that shouldn't have everChandler Carruth2011-10-152-238/+215
| | | | | | | | | | been there. Also delete their redundant doxyments in favor of those in the source file. I'm putting the doxyments for private and static helpers into the implementation file, and only the public interface doxyments into the header. If folks have strong opinions about this type of split, feel free to chime in, I'm happy to re-organize. llvm-svn: 142087
* Graduate the TextDiagnostic interface to its own header and source file,Chandler Carruth2011-10-154-1155/+1278
| | | | | | | | | | making it accessible to anyone from the Frontend library. Still a good bit of cleanup to do here, but its a good milestone. This ensures that *all* of the functionality needed to implement the DiagnosticConsumer is exposed via the generic interface in some form. No sneaky re-use of static functions. llvm-svn: 142086
* Move the message printing to a class-static function so that it can beChandler Carruth2011-10-151-28/+45
| | | | | | part of the TextDiagnostic interface without requiring a full instance. llvm-svn: 142085
* Move the diagnostic level printing into a class static helper. This willChandler Carruth2011-10-151-31/+38
| | | | | | | allow the TextDiagnosticPrinter to continue using it even if TextDiagnostic is implemented in a separate file. llvm-svn: 142084
* Rationalize the last bit of "arbitrary" state that is carried betweenChandler Carruth2011-10-152-10/+24
| | | | | | | | | | | | | diagnostics to control suppression of redundant information. It now follows the same model as all the other state, and has a bit more clear semantics. This is making the duality of the state a bit annoying, and I've added a FIXME to resolve it. The problem is that I need to lift the TextDiagnostic up into an externally visible layer before that can happen. llvm-svn: 142083
* Avoid duplicate unavailbility diagnostics in objc++.Fariborz Jahanian2011-10-152-1/+13
| | | | | | // rdar://10268422 llvm-svn: 142078
* Place static initializers on linux into the ".text.startup" section, so the ↵Benjamin Kramer2011-10-151-0/+4
| | | | | | | | linker can group them together for performance. This only has an effect with fairly new binutils (2.21.51 or later). Other ELF targets probably want this as well, but on BSDs binutils is usually old so it doesn't matter. llvm-svn: 142076
* obj-c++: allow the getter/setter to return/take parametersFariborz Jahanian2011-10-153-4/+20
| | | | | | by reference. // rdar://10188258 llvm-svn: 142075
* Internals manual: eliminate mention of System libraryPeter Collingbourne2011-10-151-8/+6
| | | | llvm-svn: 142074
* Replace vectors with arrays.Benjamin Kramer2011-10-153-69/+73
| | | | llvm-svn: 142072
* Neither 'Warning' nor 'NonNote' was a good name for this location...Chandler Carruth2011-10-152-14/+15
| | | | | | | It's the last include-stack-root we tried to walk up. Use a better name and better doxyments for it. llvm-svn: 142071
* Nuke a bunch of FIXMEs that are now fixed. =] Also, remove the now-deadChandler Carruth2011-10-151-8/+3
| | | | | | | | | TextDiagnosticPrinter argument to the TextDiagnostic helper class. This cements the proper ordering of things: TextDiagnostic is now a viable stand-alone class for emitting pretty-printed textual diagnostics to a terminal. llvm-svn: 142070
* Sink the include stack printing into the generic text diagnosticChandler Carruth2011-10-152-55/+50
| | | | | | | | | | | | | | | utility. This is a particularly nice win because it removes a pile of parameters from these routines. Also name them a bit better. I'm trying to follow the pattern of 'emit' routines writing directly to what is expected to be the final output, while 'print' routines take a output stream argument and can be used to build up intermediate buffers, etc. Also, fix a bug I spotted by inspection from my last commit where 'LastLoc' and 'LastNonNoteLoc' were reversed. It's really scary that this didn't trigger a single test failure. Will be working on tests for more of this functionality now. llvm-svn: 142069
* Rationalize some of how the locations of prior diagnostics are trackedChandler Carruth2011-10-152-13/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | across emissions. 1) The include stack printing is conditioned on non-note diagnostics, not just on warning diagnostics. 2) Those should be full source locations as they're tied to a source manager. 3) We should pass in the prior state to the TextDiagnostic constructor, allow it to mutate as diagnostics are emitted, and then cache the final state before tearing it down. Some of this remains incomplete, specifically #3 isn't finished for the non-note location. That'll come when the include stack printing sinks down a level. This also highlights how *completely* bug-ridden this code is. For example, we currently do all these comparisons of a FullSourceLoc and a SourceLocation... which silently does a SourceLocation to SourceLocation comparison, completely disregarding the source manager from whence one of the arguments came. Oops! Good thing in practice this wasn't important, but it could in theory be suppressing caret diagnostics in a second TU on a single clang invocation. I'm hoping to hammer these bugs out as the refactorings occur, although for so many of them it's really unlikely I can dream up a test case that would show the potentially buggy behavior. llvm-svn: 142067
* Sink the EmitDiagnosticLoc method down to the generic TextDiagnosticChandler Carruth2011-10-152-115/+108
| | | | | | interface now that its only caller is there. llvm-svn: 142065
* Sink the non-caret diagnostic logic down and out of the diagnosticChandler Carruth2011-10-152-276/+281
| | | | | | | | | | | | | consumer. The TextDiagnostic interface now has a generic entry point for emitting a diagnostic which uses a minimal interface that should be compatible with StoredDiagnostics such as are available in libclang etc. Some unfortunate shuffling of static functions as things get relocated. Also some unfortunate public interface points added to TextDiagnosticPrinter, but those are the next bits to get moved so they won't last long. llvm-svn: 142064
* Simplify the interface of a helper method in the TextDiagnosticPrinterChandler Carruth2011-10-152-21/+22
| | | | | | | | | | | to operate directly on the source location and ranges associated with a diagnostic rather than digging them out of the diagnostic. This had a side benefit of cleaning up its code a tiny bit by using the ArrayRef interface. No functionality changed. llvm-svn: 142063
* Add an accessor for all of the ranges in a diagnostic as an ArrayRef.Chandler Carruth2011-10-151-0/+5
| | | | | | | This will simplify a number of calls in the diagnostic printing going forward. llvm-svn: 142062
* Add -Wc++98-compat warning for deduced 'auto' type specifier.Richard Smith2011-10-153-1/+9
| | | | llvm-svn: 142057
* Implement -Wc++98-compat warnings for the parser.Richard Smith2011-10-1511-50/+206
| | | | llvm-svn: 142056
* Refactor: remove redundant check for 'final' specifier when parsing ↵Richard Smith2011-10-151-13/+4
| | | | | | class/struct definition. llvm-svn: 142054
* Testcase for half of r142048.Richard Smith2011-10-151-0/+5
| | | | llvm-svn: 142053
* Convert stray doxygen comments to regular comments. They logically ↵Ted Kremenek2011-10-151-9/+9
| | | | | | represent the fields in FunctionProtoType. llvm-svn: 142052
* Revert "Move doxygen comments to pair with the actual values."Ted Kremenek2011-10-151-9/+13
| | | | | | | John convinced me this wasn't the right thing to do. I'll follow up with a second commit to make these non-doxygen comments. llvm-svn: 142051
* Use of override keywords in C++98 should produce a warning by default.Richard Smith2011-10-152-1/+9
| | | | llvm-svn: 142050
* Rename an ExtWarn to ext_ for consistency.Richard Smith2011-10-152-2/+2
| | | | llvm-svn: 142049
* Don't warn about use of 'final' in ill-formed C++98 code which didn't useRichard Smith2011-10-152-4/+5
| | | | | | | 'final', and don't accept (then silently discard) braced init lists in C++98 new-expressions. llvm-svn: 142048
* Handle an edge case involving the conditional operator and throw ↵Eli Friedman2011-10-152-5/+17
| | | | | | expressions. PR10582. llvm-svn: 142047
* Change 'Emit' to 'EmitCaret' which sums up what it *should* be doing.Chandler Carruth2011-10-151-6/+9
| | | | | | | | Also note that it is actually doing much more than it should. This paves the way for building a more generic 'Emit' routine that is the real entry point here. llvm-svn: 142035
* -Wc++98-compat warnings for the lexer.Richard Smith2011-10-159-8/+81
| | | | | | | | This also adds a -Wc++98-compat-pedantic for warning on constructs which would be diagnosed by -std=c++98 -pedantic (that is, it warns even on C++11 features which we enable by default, with no warning, in C++98 mode). llvm-svn: 142034
* Teach the ASTImporter to perform DeclContext lookups in a way thatDouglas Gregor2011-10-153-77/+118
| | | | | | | | | | avoids loading data from an external source, since those lookups were causing some "interesting" recursion in LLDB. This code is not efficient. I plan to remedy this inefficiency in a follow-up commit. llvm-svn: 142023
* Add c_alignas and cxx_alignas featuresPeter Collingbourne2011-10-145-0/+43
| | | | llvm-svn: 142020
* Tweak the C++11 status prose a bit. We still need better user guidance on ↵Douglas Gregor2011-10-141-2/+1
| | | | | | the standard library issue llvm-svn: 142019
* Missed tests for half FP supportAnton Korobeynikov2011-10-144-0/+335
| | | | llvm-svn: 142017
* Provide half floating point support as a storage only type.Anton Korobeynikov2011-10-1436-43/+224
| | | | | | Lack of half FP was a regression compared to llvm-gcc. llvm-svn: 142016
* Switch the C++11 status table from a developer-centric list to aDouglas Gregor2011-10-141-587/+318
| | | | | | | user-centric list, with Clang version numbers, following GCC's lead (and user requests). llvm-svn: 142015
* Attempt to fix Windows buildbot, round 2.Eli Friedman2011-10-141-1/+1
| | | | llvm-svn: 142014
OpenPOWER on IntegriCloud