summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend
Commit message (Collapse)AuthorAgeFilesLines
* PCH support for functions and their parameters.Douglas Gregor2009-04-132-1/+103
| | | | llvm-svn: 68997
* PCH support for record decls/types and their fields. Now that we canDouglas Gregor2009-04-132-6/+54
| | | | | | | handle the definition of __builtin_va_list on x86-64, eliminate the forced -triple in PCH tests to get better coverage. llvm-svn: 68988
* Print the number (and percentage) of identifiers read from the PCH file as ↵Douglas Gregor2009-04-131-2/+11
| | | | | | part of its statistics llvm-svn: 68985
* Introduce PCH (de-)serialization for most compound types, excludingDouglas Gregor2009-04-131-7/+120
| | | | | | Objective-C types and record types for the moment. llvm-svn: 68984
* Add PCH support for enumerations and enumerators.Douglas Gregor2009-04-132-1/+88
| | | | llvm-svn: 68974
* Make the reading of the line table from a PCH file more robust againstDouglas Gregor2009-04-131-6/+5
| | | | | | | | the unlikely event that the filename IDs in the stored line table end up being different from the filename IDs in the newly-created line table. llvm-svn: 68965
* Include the SourceManager's line table in the PCH file. We can nowDouglas Gregor2009-04-132-5/+93
| | | | | | properly cope with #line directives in PCH files. llvm-svn: 68963
* implement the microsoft/gnu "__COUNTER__" macro: rdar://4329310Chris Lattner2009-04-132-4/+12
| | | | llvm-svn: 68933
* now that we have an identifier table in the PCH file, finish hooking upChris Lattner2009-04-112-49/+43
| | | | | | | macro deserialization. We now correctly install II's in tokens, handle function-like macros, etc. llvm-svn: 68882
* add some #includes for better compatibility with gcc 4.4,Chris Lattner2009-04-111-1/+1
| | | | | | thanks to Tobias Stadler for pointing this out. llvm-svn: 68868
* Store unique IDs for identifiers in the PCH file. Use some bitmanglingDouglas Gregor2009-04-112-13/+98
| | | | | | | so that we only need to perform the lookup and identifier resolution once per identifier in the PCH file. llvm-svn: 68846
* Compare the predefines buffer in the PCH file with the predefinesDouglas Gregor2009-04-102-34/+137
| | | | | | | | | | | | | | | buffer generated for the current translation unit. If they are different, complain and then ignore the PCH file. This effectively checks for all compilation options that somehow would affect preprocessor state (-D, -U, -include, the dreaded -imacros, etc.). When we do accept the PCH file, throw away the contents of the predefines buffer rather than parsing them, since all of the results of that parsing are already stored in the PCH file. This eliminates the ugliness with the redefinition of __builtin_va_list, among other things. llvm-svn: 68838
* do a dance with predefines, and finally enable reading of macros fromChris Lattner2009-04-101-4/+6
| | | | | | | PCH. This works now, except for limitations not being able to do things with identifiers. The basic example in the testcase works though. llvm-svn: 68832
* add support for reading macros. This does all the reading (with a bunch ofChris Lattner2009-04-102-0/+119
| | | | | | | fixme's, e.g. for tokens with identifiers) but does not actually install them. Some details with the predefines buffer needs to be sorted out first. llvm-svn: 68828
* Encode the target triple in the PCH file, and check that target triple when ↵Douglas Gregor2009-04-102-6/+36
| | | | | | using the PCH file llvm-svn: 68824
* Implement serialization/deserialization of LangOptions in the PCHDouglas Gregor2009-04-102-23/+209
| | | | | | | | | file. When de-serializing LangOptions, we check that the currently-provided language options are consistent with the options used to compile the PCH file. If they are not, we emit a diagnostic and ignore the PCH file. llvm-svn: 68820
* add a new PP_MACRO_NAME hack so that I can test object-like macros.Chris Lattner2009-04-101-0/+7
| | | | llvm-svn: 68803
* emit tokens, constify the Preprocessor passed down into PCH writer.Chris Lattner2009-04-101-3/+25
| | | | llvm-svn: 68798
* emit function-like and object-like macros to the PCH file.Chris Lattner2009-04-101-0/+50
| | | | | | | Note that we don't do anything useful with identifier infos yet and don't emit the tokens that the macros are defined to. llvm-svn: 68797
* Add PCH sources to CMake build filesDouglas Gregor2009-04-101-0/+2
| | | | llvm-svn: 68794
* Various minor fixes to PCH reading and writing, with generalDouglas Gregor2009-04-102-108/+38
| | | | | | | cleanup. Aside from a minor tweak to the PCH file format, no functionality change. llvm-svn: 68793
* improve punctuationChris Lattner2009-04-101-4/+11
| | | | llvm-svn: 68791
* Arrange for the preprocessor to be passed down into the PCH writer.Chris Lattner2009-04-101-1/+9
| | | | llvm-svn: 68790
* PCH serialization/deserialization of the source manager. With thisDouglas Gregor2009-04-102-0/+237
| | | | | | | | | | | | improvement, source locations read from the PCH file will properly resolve to the source files that were used to build the PCH file itself. Once we have the preprocessor state stored in the PCH file, source locations that refer to macro instantiations that occur in the PCH file should have the appropriate instantiation information. llvm-svn: 68758
* Implementation of pre-compiled headers (PCH) based on lazyDouglas Gregor2009-04-092-0/+1238
| | | | | | | | | | | | | | | | | | | de-serialization of abstract syntax trees. PCH support serializes the contents of the abstract syntax tree (AST) to a bitstream. When the PCH file is read, declarations are serialized as-needed. For example, a declaration of a variable "x" will be deserialized only when its VarDecl can be found by a client, e.g., based on name lookup for "x" or traversing the entire contents of the owner of "x". This commit provides the framework for serialization and (lazy) deserialization, along with support for variable and typedef declarations (along with several kinds of types). More declarations/types, along with important auxiliary structures (source manager, preprocessor, etc.), will follow. llvm-svn: 68732
* Fix output of ranges in analyzer plist files.Ted Kremenek2009-04-051-8/+14
| | | | llvm-svn: 68437
* Add a new command-line option "-fixit-at=file:line:column" that onlyDouglas Gregor2009-04-021-2/+37
| | | | | | | applies fix-its to error messages that occur at that specific location in the program. llvm-svn: 68342
* Provide FIX-IT notes to describe what fix-it is doing behind theDouglas Gregor2009-04-021-31/+39
| | | | | | | scenes, using the underlying diagnostic client to format the messages. llvm-svn: 68324
* Some cleanups to the fix-it rewriter. Thanks, ChrisDouglas Gregor2009-04-022-29/+44
| | | | llvm-svn: 68322
* Also "flatten" PathLocations fed to the HTMLDiagnosticClient. We need a betterTed Kremenek2009-04-021-0/+1
| | | | | | long-term strategy, but this should work for now. llvm-svn: 68297
* Hack: Add 'PathDiagnostic::flattenLocations()'. Because PlistDiagnosticClientTed Kremenek2009-04-021-0/+4
| | | | | | | can use a PathLocation after any reference Stmts are reclaimed, flattenLocation() converts those references to statements to source ranges. llvm-svn: 68292
* Clean up -fixit output slightlyDouglas Gregor2009-04-021-1/+2
| | | | llvm-svn: 68278
* Introduce a "-fixit" mode to clang-cc that applies code-modification hints.Douglas Gregor2009-04-021-0/+140
| | | | llvm-svn: 68268
* For plist diagnostics, use the extensive PathDiagnostic generation algorithm.Ted Kremenek2009-04-021-1/+1
| | | | llvm-svn: 68264
* - Changed PathDiagnosticPiece::getLocation() to return a PathDiagnosticLocationTed Kremenek2009-04-012-30/+40
| | | | | | | | | instead of a FullSourceLoc. This resulted in a bunch of small edits in various clients. - Updated BugReporter to include an alternate PathDiagnostic generation algorithm for PathDiagnosticClients desiring more control-flow pieces. llvm-svn: 68193
* Allow two codepaths for PathDiagnostic generation. This patch mainly consists ofTed Kremenek2009-03-311-0/+2
| | | | | | refactoring to make this possible (no functionality change). llvm-svn: 68141
* Properly escape special characters in <string>'s in plist file.Ted Kremenek2009-03-281-12/+34
| | | | llvm-svn: 67924
* analyzer plist: For PathDiagnosticControlFlowPieces, now output an array ofTed Kremenek2009-03-271-0/+21
| | | | | | start-end points, where start and end are source ranges. llvm-svn: 67847
* Emit aggregate "location" for PathDiagnostic to plist. This fixes ↵Ted Kremenek2009-03-271-2/+7
| | | | | | <rdar://problem/6729558>. llvm-svn: 67845
* BugReporter:Ted Kremenek2009-03-271-1/+3
| | | | | | | | - Added an internal helper class 'PathDiagnosticBuilder' which now bundles the 'ExecutionContinues' methods. - Added preliminary diagnostics for short-circuit '&&' and '||' llvm-svn: 67822
* Really fix cmake style builds.Mike Stump2009-03-241-1/+1
| | | | llvm-svn: 67633
* Plist diagnostics: distinguish between regular and extended messages for ↵Ted Kremenek2009-03-191-0/+5
| | | | | | "events". llvm-svn: 67269
* Build system changes to use TableGen to generate the variousDouglas Gregor2009-03-161-1/+1
| | | | | | | | | | | | | | | | | | diagnostics. This builds on the patch that Sebastian committed and then revert. Major differences are: - We don't remove or use the current ".def" files. Instead, for now, we just make sure that we're building the ".inc" files. - Fixed CMake makefiles to run TableGen and build the ".inc" files when needed. Tested with both the Xcode and Makefile generators provided by CMake, so it should be solid. - Fixed normal makefiles to handle out-of-source builds that involve the ".inc" files. I'll send a separate patch to the list with Sebastian's changes that eliminate the use of the .def files. llvm-svn: 67058
* implement a new -fprint-source-range-info option, whichChris Lattner2009-03-131-0/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | defaults to off. When enabled, it emits range info along with the file/line/col information for a diagnostic. This allows tools that textually parse the output of clang to know where the ranges are, even if they span multiple lines. For example, with: $ clang exprs.c -fprint-source-range-info We now produce: exprs.c:21:11:{21:12-21:13}: warning: use of unary operator that may be intended as compound assignment (+=) var =+ 5; // expected-warning {{use of unary operator that may be intended as compound assignment (+=)}} ^~ exprs.c:22:11:{22:12-22:13}: warning: use of unary operator that may be intended as compound assignment (-=) var =- 5; // expected-warning {{use of unary operator that may be intended as compound assignment (-=)}} ^~ exprs.c:36:13:{36:3-36:12}: error: assignment to cast is illegal, lvalue casts are not supported (float*)X = P; // expected-error {{assignment to cast is illegal, lvalue casts are not supported}} ~~~~~~~~~ ^ exprs.c:41:4:{41:3-41:4}: error: called object type 'int' is not a function or function pointer X(); // expected-error {{called object type 'int' is not a function or function pointer}} ~^ exprs.c:45:15:{45:8-45:14}{45:17-45:24}: error: invalid operands to binary expression ('int *' and '_Complex float') P = (P-42) + Gamma*4; // expected-error {{invalid operands to binary expression ('int *' and '_Complex float')}} ~~~~~~ ^ ~~~~~~~ exprs.c:61:7:{61:16-61:22}: error: invalid application of '__alignof' to bitfield R = __alignof(P->x); // expected-error {{invalid application of '__alignof' to bitfield}} expected-warning {{extension used}} ^ ~~~~~~ Note the range info after the column in the initial diagnostic. This is obviously really annoying if you're not a tool parsing the output of clang, which is why it is off by default. llvm-svn: 66862
* PathDiagnostics:Ted Kremenek2009-03-121-32/+83
| | | | | | | | | | | | | | | | - PathDiagnosticControlFlowPiece now consists of a "start" and "end" location to indicating the branch location and where the branch goes. BugReporter: - Updated BugReporter to construct PathDiagnosticControlFlowPiece objects with "end" locations. PlistDiagnostics: - Plists now contain the bug "type" (not just bug "category") - Plists now encode control-flow pieces differently than events; now the "start" and "end" locations are recorded llvm-svn: 66818
* Extend the notion of active template instantiations to include theDouglas Gregor2009-03-101-4/+8
| | | | | | | | | | | | context of a template-id for which we need to instantiate default template arguments. In the TextDiagnosticPrinter, don't suppress the caret diagnostic if we are producing a non-note diagnostic that follows a note diagnostic with the same location, because notes are (conceptually) a part of the warning or error that comes before them. llvm-svn: 66572
* BugReporter:Ted Kremenek2009-03-101-49/+135
| | | | | | | | | | | | - Group control flow and event PathDiagnosticPieces into PathDiagnosticMacroPieces. - Afterwards, eliminate any PathDiagnosticMacroPieces from a PathDiagnostic that contain no informative events. HTMLDiagnostics: - Use new information about PathDiagnosticMacroPieces to specially format message bubbles for macro expansions containing interesting events. llvm-svn: 66524
* Handle "Macro" PathDiagnosticPiece kind when getting string identifier.Ted Kremenek2009-03-102-8/+11
| | | | llvm-svn: 66518
* generalize the "end of line" checking logic to stop at any \0 at theChris Lattner2009-03-081-3/+1
| | | | | | | | | end of line instead of just the end of buffer. Scratch buffers contain embedded \0's between tokens which are logic line separators. If a normal text buffer contains \0's, it doesn't make a lot of sense to include them in the caret diag output anyway. llvm-svn: 66374
* Resize message bubble back to original size.Ted Kremenek2009-03-021-1/+1
| | | | llvm-svn: 65892
OpenPOWER on IntegriCloud