| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
| |
Diagnostic pragmas are broken because we don't keep track of the diagnostic state changes and we only check the current/latest state.
Problems manifest if a diagnostic is emitted for a source line that has different diagnostic state than the current state; this can affect
a lot of places, like C++ inline methods, template instantiations, the lexer, etc.
Fix the issue by having the Diagnostic object keep track of the source location of the pragmas so that it is able to know what is the diagnostic state at any given source location.
Fixes rdar://8365684.
llvm-svn: 121873
|
|
|
|
|
|
|
|
| |
into ContentCache::getBuffer. This allows it to produce
diagnostics on the broken #include line instead of without a
location.
llvm-svn: 101939
|
|
|
|
|
|
| |
DependencyFile to not do work in its destructor.
llvm-svn: 99257
|
|
|
|
|
|
|
| |
SourceManager versions), updating those callers that need to recover
gracefully from failure.
llvm-svn: 98665
|
|
|
|
|
|
| |
simplifying the SourceManager interfaces somewhat.
llvm-svn: 98598
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
SourceManager's getBuffer() (and similar) operations. This abstract
can be used to force callers to cope with errors in getBuffer(), such
as missing files and changed files. Fix a bunch of callers to use the
new interface.
Add some very basic checks for file consistency (file size,
modification time) into ContentCache::getBuffer(), although these
checks don't help much until we've updated the main callers (e.g.,
SourceManager::getSpelling()).
llvm-svn: 98585
|
|
|
|
|
|
|
|
| |
definitions from a precompiled header. This ensures that
code-completion with macro names behaves the same with or without
precompiled headers.
llvm-svn: 92497
|
|
|
|
|
|
|
|
| |
expected to fail.
Also, update SourceManager.h doxyments for getBuffer() to reflect reality.
llvm-svn: 90701
|
|
|
|
|
|
| |
should be forced to deal with error conditions.
llvm-svn: 90700
|
|
|
|
|
|
|
|
|
|
|
|
| |
in diagnostics when we fail to open a file. This allows us to
report things like:
$ clang test.c -I.
test.c:2:10: fatal error: error opening file './foo.h': Permission denied
#include "foo.h"
^
llvm-svn: 90276
|
|
|
|
|
|
|
|
|
|
| |
stat a file but where mmaping it fails. In this case, we emit an
error like:
t.c:1:10: fatal error: error opening file '../../foo.h'
instead of "cannot find file".
llvm-svn: 90110
|
|
|
|
| |
llvm-svn: 90080
|
|
|
|
| |
llvm-svn: 81346
|
|
|
|
| |
llvm-svn: 69987
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
and the token after the # should be expanded if it is not a valid directive.
This allows us to transform things like:
#define FOO BAR
# FOO
into # BAR, even though FOO is not normally expanded for directives.
This should fix PR3833
llvm-svn: 67236
|
|
|
|
| |
llvm-svn: 66954
|
|
|
|
|
|
|
|
|
|
|
|
| |
Now instead of just tracking the expansion history, also track the full
range of the macro that got replaced. For object-like macros, this doesn't
change anything. For _Pragma and function-like macros, this means we track
the locations of the ')'.
This is required for PR3579 because apparently GCC uses the line of the ')'
of a function-like macro as the location to expand __LINE__ to.
llvm-svn: 64601
|
|
|
|
| |
llvm-svn: 64503
|
|
|
|
| |
llvm-svn: 63925
|
|
|
|
|
|
| |
redundant #includes. Patch by Anders Johnsen!
llvm-svn: 63271
|
|
|
|
|
|
|
|
|
| |
.def file for each library. This means that adding a diagnostic
to sema doesn't require all the other libraries to be rebuilt.
Patch by Anders Johnsen!
llvm-svn: 63111
|
|
|
|
|
|
|
| |
safe because a #line can change the file characteristic on a per-loc
basis.
llvm-svn: 62502
|
|
|
|
| |
llvm-svn: 62424
|
|
|
|
|
|
| |
of a SourceLocation. This should speed it up and definitely simplifies it.
llvm-svn: 62422
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
"FileID" a concept that is now enforced by the compiler's type checker
instead of yet-another-random-unsigned floating around.
This is an important distinction from the "FileID" currently tracked by
SourceLocation. *That* FileID may refer to the start of a file or to a
chunk within it. The new FileID *only* refers to the file (and its
#include stack and eventually #line data), it cannot refer to a chunk.
FileID is a completely opaque datatype to all clients, only SourceManager
is allowed to poke and prod it.
llvm-svn: 62407
|
|
|
|
| |
llvm-svn: 61382
|
|
|
|
|
|
| |
No big functionality change.
llvm-svn: 61381
|
|
|
|
|
|
|
|
| |
- Added virtual method 'getSourceLocation()' (no arguments) that gets the location of the next "observable" location (e.g., next character, next token).
PPLexerChange.cpp:
- Implemented FIXME by using PreprocessorLexer::getSourceLocation() to get the location in the file we are returning to after lexing a #included file. This appears to be slightly faster than having the branch (i.e., 'if(CurLexer)'). It's also not a really hot part of the Preprocessor.
llvm-svn: 60860
|
|
|
|
|
|
|
|
|
| |
- Added method "setPTHManager" that will be called by the driver to install
a PTHManager for the Preprocessor.
- Fixed some comments.
- Added EnterSourceFileWithPTH to mirror EnterSourceFileWithLexer.
llvm-svn: 60437
|
|
|
|
| |
llvm-svn: 60136
|
|
|
|
| |
llvm-svn: 59843
|
|
|
|
|
|
| |
the file to include is checked for being an identifier.
llvm-svn: 59842
|
|
|
|
|
|
| |
for #include directives.
llvm-svn: 59840
|
|
|
|
| |
llvm-svn: 59731
|
|
|
|
|
|
|
|
|
|
| |
(temporary hack) to test the PTHLexer is that whenever we would create a Lexer
object we instead raw lex a memory buffer first and then use the PTHLexer. This
logic exists only to driver the PTHLexer and will be removed/changed in the
future. Note that the regular path using normal Lexer objects is what is used by
default.
llvm-svn: 59723
|
|
|
|
| |
llvm-svn: 59695
|
|
|
|
|
|
|
| |
a Lexer*. This means it will either return the current (normal) file Lexer or a
PTHLexer.
llvm-svn: 59694
|
|
|
|
|
|
| |
Use PTHLexer::isNextPPTokenLParen() when using the PTHLexer.
llvm-svn: 59671
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Add variants of IsNonPragmaNonMacroLexer to accept an IncludeMacroStack entry
(simplifies some uses).
- Use IsNonPragmaNonMacroLexer in Preprocessor::LookupFile.
- Add 'FileID' to PreprocessorLexer, and have Preprocessor query this fileid
when looking up the FileEntry for a file
Performance testing of -Eonly on Cocoa.h shows no performance regression because
of this patch.
llvm-svn: 59666
|
|
|
|
| |
llvm-svn: 59579
|
|
|
|
|
|
|
|
|
|
|
| |
- Add variants of IsNonPragmaNonMacroLexer to accept an IncludeMacroStack entry
(simplifies some uses).
- Use IsNonPragmaNonMacroLexer in Preprocessor::LookupFile.
Performance testing of -Eonly on Cocoa.h shows no performance regression because
of this patch.
llvm-svn: 59574
|
|
|
|
|
|
|
|
|
| |
- Add static method to test if the current lexer is a non-macro/non-pragma
lexer.
- Refactor some code in PPLexerChange to use this static method.
- No performance change.
llvm-svn: 59486
|
|
|
|
|
|
|
|
|
| |
PreprocessorLexer, which will either be a 'Lexer' or 'PTHLexer'.
- Added stub field 'CurPTHLexer' to keep track of the current PTHLexer.
- Modified IncludeStackInfo to track both the current PTHLexer and
current PreprocessorLexer.
llvm-svn: 59472
|
|
|
|
|
|
| |
ownership semantics of these objects explicit within the Preprocessor and also tightens up the code (explicit deletes not needed).
llvm-svn: 59249
|
|
|
|
|
|
| |
from IncludeMacroStack. This is both cleaner and makes the include stack transparently extensible.
llvm-svn: 59248
|
|
|
|
| |
llvm-svn: 58224
|
|
|
|
|
|
|
| |
were setting a kind and then forming it. This is just a minor API cleanup,
no functionality change.
llvm-svn: 57404
|
|
|
|
|
|
| |
DirectoryLookup::DirType into SourceManager.h
llvm-svn: 56692
|
|
|
|
|
|
|
|
|
|
|
| |
to whether the fileid is a 'extern c system header' in addition to whether it
is a system header, most of this is spreading plumbing around. Once we have that,
PPLexerChange bases its "file enter/exit" notifications to PPCallbacks to
base the system header state on FileIDInfo instead of HeaderSearch. Finally,
in Preprocessor::HandleIncludeDirective, mirror logic in GCC: the system headerness
of a file being entered can be set due to the #includer or the #includee.
llvm-svn: 56688
|
|
|
|
|
|
|
|
|
|
|
| |
- Kill unnecessary #includes in .cpp files. This is an automatic
sweep so some things removed are actually used, but happen to be
included by a previous header. I tried to get rid of the obvious
examples and this was the easiest way to trim the #includes in one
fell swoop.
- We now return to regularly scheduled development.
llvm-svn: 54632
|