summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend
Commit message (Collapse)AuthorAgeFilesLines
...
* Frontend: Add support for reading named pipes as the main file.Daniel Dunbar2012-11-051-0/+13
| | | | | | | | - The whole {File,Source}Manager is built around wanting to pre-determine the size of files, so we can't fit this in naturally. Instead, we handle it like we do STDIN, where we just replace the main file contents upfront. llvm-svn: 167419
* Use the individual -fsanitize=<...> arguments to control which of the UBSanRichard Smith2012-11-051-3/+0
| | | | | | | checks to enable. Remove frontend support for -fcatch-undefined-behavior, -faddress-sanitizer and -fthread-sanitizer now that they don't do anything. llvm-svn: 167413
* Add -fsanitize=<sanitizers> argument to driver and frontend, and addRichard Smith2012-11-051-0/+31
| | | | | | | | | | | | -fno-sanitize=<sanitizers> argument to driver. These allow ASan, TSan, and the various UBSan checks to be enabled and disabled separately. Right now, the different modes can't be combined, but the intention is that combining UBSan and the other sanitizers will be permitted in the near future. Currently, the UBSan checks will all be enabled if any of them is; that will be fixed by the next patch. llvm-svn: 167411
* Rename LangOptions members for address sanitizer and thread sanitizer fromRichard Smith2012-11-051-2/+2
| | | | | | *Sanitizer to Sanitize* in preparation for later patches. llvm-svn: 167405
* Hash the various compiler version, target, preprocessor, andDouglas Gregor2012-11-051-34/+31
| | | | | | | | | header-search options into the module hash. We're just using ADT/Hashing.hpp for this, which isn't as cryptographically strong as I'd like, but it'll do. If someone contributes (say) and MD4 implementation, we'd happily switch to that. llvm-svn: 167397
* only truncate source lines in text diagnostics whenSeth Cantrell2012-11-031-2/+2
| | | | | | the ellipsis is shorter than the text it replaces llvm-svn: 167364
* don't step into the middle of multibyte sequencesSeth Cantrell2012-11-031-2/+2
| | | | llvm-svn: 167361
* fix bug in SourceColumnMap::startOfPreviousColumnSeth Cantrell2012-11-031-1/+1
| | | | llvm-svn: 167360
* Add a proper algorithm to compute accurate source ranges for diagnostics withEli Friedman2012-11-032-26/+62
| | | | | | | | | caret locations and source ranges in macros. Makes ranges more accurate in some cases, and fixes an assertion failure. Fixes <rdar://problem/12472249>. llvm-svn: 167353
* When code-completing don't disable the preprocessing record if modules are ↵Argyrios Kyrtzidis2012-11-021-2/+3
| | | | | | enabled. llvm-svn: 167325
* Remove first argument from Arg::getValue; it's been unused since r105760.Richard Smith2012-11-011-55/+55
| | | | llvm-svn: 167211
* Remove CompilerInvocation::toArgs and clang -cc1test mode. These were untestedRichard Smith2012-11-011-908/+1
| | | | | | | and apparently unused (and since they are untested, they're presumably also broken). llvm-svn: 167210
* [PCH] Remove the stat cache from the PCH file.Argyrios Kyrtzidis2012-10-313-11/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The stat cache became essentially useless ever since we started validating all file entries in the PCH. But the motivating reason for removing it now is that it also affected correctness in this situation: -You have a header without include guards (using "#pragma once" or #import) -When creating the PCH: -The same header is referenced in an #include with different filename cases. -In the PCH, of course, we record only one file entry for the header file -But we cache in the PCH file the stat info for both filename cases -Then the source files are updated and the header file is updated in a way that its size and modification time are the same but its inode changes -When using the PCH: -We validate the headers, we check that header file and we create a file entry with its current inode -There's another #include with a filename with different case than the previously created file entry -In order to get its stat info we go through the cached stat info of the PCH and we receive the old inode -because of the different inodes, we think they are different files so we go ahead and include its contents. Removing the stat cache will potentially break clients that are attempting to use the stat cache as a way of avoiding having the actual input files available. If that use case is important, patches are welcome to bring it back in a way that will actually work correctly (i.e., emit a PCH that is self-contained, coping with literal strings, line/column computations, etc.). This fixes rdar://5502805 llvm-svn: 167172
* Fix for -ast-dump-filterAlexander Kornienko2012-10-311-3/+1
| | | | | | | | | | | | | | | | | Summary: -ast-dump-filter implementation used to stop AST traversal after traversing a NULL Decl node. Added test and fixed. Reviewers: djasper, klimek, rsmith Reviewed By: djasper CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D93 llvm-svn: 167155
* Decouple code-completion for the SkipFunctionBodies frontend option andArgyrios Kyrtzidis2012-10-312-3/+0
| | | | | | add a test to make sure code-completion skips bodies. llvm-svn: 167141
* remove duplicate data arraySeth Cantrell2012-10-301-14/+1
| | | | llvm-svn: 167007
* fix calculation of end pointerSeth Cantrell2012-10-301-1/+1
| | | | llvm-svn: 167006
* Move getOriginalSourceFileName inline. Patch by Laszlo Nagy.Rafael Espindola2012-10-291-4/+0
| | | | llvm-svn: 166981
* Remove spurious mode marker from .cpp file.Nick Lewycky2012-10-291-1/+1
| | | | llvm-svn: 166915
* Reverted back the changes made in 166868 and in 166869Mahesha S2012-10-271-3/+0
| | | | llvm-svn: 166871
* -------------------------------------------------Mahesha S2012-10-271-0/+3
| | | | | | | | | | | | | | | | | | | | Feature: OpenMP support in CLANG: Sub-Feature: Support for option -fopenmp Files Changed/Added: * include/clang/Driver/Options.td (C) * include/clang/Basic/LangOptions.def (C) * lib/Driver/Tools.cpp (C) * lib/Frontend/CompilerInvocation.cpp (C) Test Cases Changed/Added: * test/Driver/clang_fopenmp_opt.c (A) ------------------------------------------------- llvm-svn: 166868
* ASTUnit doesn't actually care about the predefines; don't record them.Douglas Gregor2012-10-251-18/+2
| | | | llvm-svn: 166650
* Teach the PCH validator to check the preprocessor options, especiallyDouglas Gregor2012-10-241-1/+2
| | | | | | | | | | | | | | | the macros that are #define'd or #undef'd on the command line. This checking happens much earlier than the current macro-definition checking and is far cleaner, because it does a direct comparison rather than a diff of the predefines buffers. Moreover, it allows us to use the result of this check to skip over PCH files within a directory that have non-matching -D's or -U's on the command line. Finally, it improves the diagnostics a bit for mismatches, fixing <rdar://problem/8612222>. The old predefines-buffer diff'ing will go away in a subsequent commit. llvm-svn: 166641
* Teach the preprocessor to hold onto the preprocessor options.Douglas Gregor2012-10-242-2/+5
| | | | llvm-svn: 166599
* Move PreprocessorOptions into the Lex library, and make it intrusivelyDouglas Gregor2012-10-242-3/+5
| | | | | | reference-counted. llvm-svn: 166587
* Move HeaderSearchOptions into the Lex library, make it intrusivelyDouglas Gregor2012-10-244-5/+11
| | | | | | reference-counted, and hold a reference to it in HeaderSearch. llvm-svn: 166583
* [analyzer] Replace -analyzer-no-eagerly-trim-egraph with graph-trim-interval.Jordan Rose2012-10-231-1/+0
| | | | | | | | | | | | | After every 1000 CFGElements processed, the ExplodedGraph trims out nodes that satisfy a number of criteria for being "boring" (single predecessor, single successor, and more). Rather than controlling this with a cc1 option, which can only disable this behavior, we now have an analyzer-config option, 'graph-trim-interval', which can change this interval from 1000 to something else. Setting the value to 0 disables reclamation. The next commit relies on this behavior to actually test anything. llvm-svn: 166528
* Use a .def file for most of the diagnostic options.Douglas Gregor2012-10-233-11/+10
| | | | llvm-svn: 166520
* Make DiagnosticOptions intrusively reference-counted, and make sureDouglas Gregor2012-10-2312-83/+88
| | | | | | | the various stakeholders bump up the reference count. In particular, the diagnostics engine now keeps the DiagnosticOptions object alive. llvm-svn: 166508
* Switch CodeGenOptions over to a .def file, like we do with LangOptions.Douglas Gregor2012-10-231-12/+16
| | | | llvm-svn: 166497
* If the precompiled header named by "-include" is actually a directory,Douglas Gregor2012-10-232-11/+45
| | | | | | | | | check each of the files within that directory to determine if any of them is an AST file that matches the language and target options. If so, the first matching AST file is loaded. This fixes a longstanding discrepency with GCC's precompiled header implementation. llvm-svn: 166469
* Handle implicitly-included PCH files the same way asDouglas Gregor2012-10-222-10/+17
| | | | | | | | implicitly-included PTH files during initialization, delaying the mapping down to the "original source file" until after later in the initialization process. llvm-svn: 166452
* Allow clients of the AST reader to specify what kinds of AST loadDouglas Gregor2012-10-223-7/+14
| | | | | | | | | | failures they know how to tolerate, e.g., out-of-date input files or configuration/version mismatches. Suppress the corresponding diagnostics if the client can handle it. No clients actually use this functionality, yet. llvm-svn: 166449
* Distinguish the various kinds of AST file loading failures:Douglas Gregor2012-10-223-4/+16
| | | | | | | | file corruption, compiler version mismatch, target/language configuration mismatch, out-of-date AST file. No functionality change yet. llvm-svn: 166446
* [Options] Add prefixes to options.Michael J. Spencer2012-10-221-2/+2
| | | | | | | | | | | | | | Each option has a set of prefixes. When matching an argument such as -funroll-loops. First the leading - is removed as it is a prefix. Then a lower_bound search for "funroll-loops" is done against the option table by option name. From there each option prefix + option name combination is tested against the argument. This allows us to support Microsoft style options where both / and - are valid prefixes. It also simplifies the cases we already have where options come in both - and -- forms. Almost every option for gnu-ld happens to have this form. llvm-svn: 166444
* [Options] Make Option non clang specific.Michael J. Spencer2012-10-191-1/+1
| | | | llvm-svn: 166348
* Change VerifyDiagnosticConsumer so that it *must* contain at least one ↵Andy Gibbs2012-10-191-6/+31
| | | | | | | | | | "expected-*" directive. As a result, for test-cases that are not expected to generate any diagnostics, an additional directive "expected-no-diagnostics" has been implemented which can then be included in such test-cases. This new directive may not be used in conjunction with any other "expected-*" directive. This change was initially proposed as a solution to the problem highlighted by check-in r164677, i.e. that -verify will not cause a test-case failure where the compile command does not actually reference the file. Patch reviewed by David Blaikie. llvm-svn: 166281
* Fix directive parsing in VerifyDiagnosticConsumer so that it ensures that ↵Andy Gibbs2012-10-191-5/+17
| | | | | | | | "expected" is at the start of the word and will no longer accept typos such as "junkexpected-*" as a valid "expected-*" directive. A very few test-cases had to be amended to adhere to the new rule. Patch reviewed by David Blaikie. llvm-svn: 166279
* Revert r166223 and the subsequent commits that depend on it, r166230 & r166235.Argyrios Kyrtzidis2012-10-181-1/+1
| | | | | | This seems to have introduced assertion hit when building compiler-rt. llvm-svn: 166245
* Add a new option for and disable column number information as thereEric Christopher2012-10-181-0/+3
| | | | | | | | | | are no known current users of column info. Robustify and fix up a few tests in the process. Reduces the size of debug information by a small amount. Part of PR14106 llvm-svn: 166236
* [Options] Make Option non clang specific.Michael J. Spencer2012-10-181-1/+1
| | | | llvm-svn: 166230
* Emit diagnostics in chunks even when we're trying to print colored template ↵Benjamin Kramer2012-10-181-12/+15
| | | | | | | | diffs. char-by-char is really slow on an unbuffered stream. llvm-svn: 166218
* Add -std=c++1y argument, for *highly* experimental C++14 support.Richard Smith2012-10-172-0/+3
| | | | llvm-svn: 166139
* Serialize TargetOptions into an AST file, and make sure that we keepDouglas Gregor2012-10-162-28/+18
| | | | | | | target options around so they can be accessed at any point (rather than keeping them transient). llvm-svn: 166072
* Teach TargetInfo to hold on to the TargetOptions with which it wasDouglas Gregor2012-10-151-4/+6
| | | | | | created. llvm-svn: 165943
* Make sure temporary files are deleted when recovering from a crash when ↵Benjamin Kramer2012-10-141-0/+1
| | | | | | compiling modules. llvm-svn: 165911
* Delete temporary output files when an error occurs during PCH reading.Benjamin Kramer2012-10-142-0/+2
| | | | | | | | This reduces the spam make test leaves behind in /tmp. The assert isn't particularly useful because it's not run with -disable-free (the default when using the clang driver) but should cover all -cc1 tests. llvm-svn: 165910
* [libclang] Improve AST serialization done by ASTUnit::Save().Argyrios Kyrtzidis2012-10-111-28/+64
| | | | | | | | | The ASTUnit needs to initialize an ASTWriter at the beginning of parsing to fully handle serialization of a translation unit that imports modules. Do this by introducing an option to enable it, which corresponds to CXTranslationUnit_ForSerialization on the C API side. llvm-svn: 165717
* When indexing a module file, for the ppIncludedFile callback giveArgyrios Kyrtzidis2012-10-101-5/+11
| | | | | | | an invalid location if the location points to the synthetic buffer for the module input. llvm-svn: 165592
* [modules] Consistently construct a buffer as input to build the module.Argyrios Kyrtzidis2012-10-101-82/+42
| | | | | | This means the main file for modules will always be a virtual one. llvm-svn: 165591
OpenPOWER on IntegriCloud