History log of /llvm-project/clang/lib/Basic/SourceManager.cpp (Results 201 – 225 of 397)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: llvmorg-3.2.0-rc2
# 0b50cb79 14-Nov-2012 Richard Smith <richard-llvm@metafoo.co.uk>

Add -cc1 option -fno-diagnostics-use-presumed-location, a handy mode for
working with preprocessed testcases. This causes source locations in
diagnostics to point at the spelling location instead of

Add -cc1 option -fno-diagnostics-use-presumed-location, a handy mode for
working with preprocessed testcases. This causes source locations in
diagnostics to point at the spelling location instead of the presumed location,
while still keeping the semantic effects of the line directives (entering and
leaving system-header mode, primarily).

llvm-svn: 168004

show more ...


Revision tags: llvmorg-3.2.0-rc1
# 73ccdb9c 20-Oct-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com>

When associating file ranges of macro arguments with their
macro expansion ranges, make sure to check all the FileID
entries that are contained in the spelling range of the
expansion for the macro ar

When associating file ranges of macro arguments with their
macro expansion ranges, make sure to check all the FileID
entries that are contained in the spelling range of the
expansion for the macro argument.

Fixes rdar://12537982

llvm-svn: 166359

show more ...


# 5e79ee08 19-Oct-2012 Craig Topper <craig.topper@gmail.com>

Teach getColumnNumber to use the line cache to get the start of the line if its on the same line as the last call to getLineNumber. Prevents needing to scan backwards for the new line. Fixes PR14106.

Teach getColumnNumber to use the line cache to get the start of the line if its on the same line as the last call to getLineNumber. Prevents needing to scan backwards for the new line. Fixes PR14106.

llvm-svn: 166265

show more ...


# bd1d7fa4 12-Oct-2012 Ted Kremenek <kremenek@apple.com>

Silence dead store warning. It is conceptually possible we will
add more code that references SourceFile, so removing the dead store
doesn't seem appropriate for the long term.

llvm-svn: 165837


# e637711a 06-Sep-2012 Roman Divacky <rdivacky@freebsd.org>

Dont cast away const needlessly. Found by gcc48 -Wcast-qual.

llvm-svn: 163325


# 6d7833f1 11-Jul-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com>

Introduce a flag in SourceManager to treat non-system source files
as "volatile", meaning there's a high enough chance that they may
change while we are trying to use them.

This flag is only enabled

Introduce a flag in SourceManager to treat non-system source files
as "volatile", meaning there's a high enough chance that they may
change while we are trying to use them.

This flag is only enabled by libclang.
Currently "volatile" source files will be stat'ed immediately
before opening them, because the file size stat info
may not be accurate since when we got it (e.g. from the PCH).
This avoids crashes when trying to reference mmap'ed memory
from a file whose size is not what we expect.

Note that there's still a window for a racing issue to occur
but the window for it should be way smaller than before.
We can consider later on to avoid mmap completely on such files.

rdar://11612916

llvm-svn: 160074

show more ...


# 0bb4164c 02-Jul-2012 James Dennett <jdennett@google.com>

Documentation cleanup: Delete a duplicated/malformed doc comment.

llvm-svn: 159628


# cdc0057e 19-Jun-2012 Meador Inge <meadori@codesourcery.com>

Revert predefined decl tracking.

r158085 added some logic to track predefined declarations. The main reason we
had predefined declarations in the input was because the __builtin_va_list
declaration

Revert predefined decl tracking.

r158085 added some logic to track predefined declarations. The main reason we
had predefined declarations in the input was because the __builtin_va_list
declarations were injected into the preprocessor input. As of r158592 we
explicitly build the __builtin_va_list declarations. Therefore the predefined
decl tracking is no longer needed.

llvm-svn: 158732

show more ...


# 8d63d5b8 19-Jun-2012 Jordan Rose <jordan_rose@apple.com>

Fix the location of the fixit for -Wnewline-eof.

It turns out SourceManager treating the "one-past-the-end" location as invalid,
but then failing to set the invalid flag properly.

llvm-svn: 158699


# 87a2acf1 17-Jun-2012 James Dennett <jdennett@google.com>

Documentation cleanup: escaped # characters in Doxygen comments.

llvm-svn: 158614


# 88b71e41 15-Jun-2012 James Dennett <jdennett@google.com>

Documentation cleanup: escape # in a Doxygen comment.

llvm-svn: 158549


# 02c2dbf4 08-Jun-2012 Douglas Gregor <dgregor@apple.com>

Switch LineTableInfo to use FileID instead of int for file references,
from Tom Honermann!

llvm-svn: 158211


# ccf43ca0 06-Jun-2012 Jordan Rose <jordan_rose@apple.com>

Add pedantic warning -Wempty-translation-unit (C11 6.9p1).

In standard C since C89, a 'translation-unit' is syntactically defined to have
at least one "external-declaration", which is either a decl

Add pedantic warning -Wempty-translation-unit (C11 6.9p1).

In standard C since C89, a 'translation-unit' is syntactically defined to have
at least one "external-declaration", which is either a decl or a function
definition. In Clang the latter gives us a declaration as well.

The tricky bit about this warning is that our predefines can contain external
declarations (__builtin_va_list and the 128-bit integer types). Therefore our
AST parser now makes sure we have at least one declaration that doesn't come
from the predefines buffer.

Also, remove bogus warning about empty source files. This doesn't catch source
files that only contain comments, and never fired anyway because of our
predefines.

PR12665 and <rdar://problem/9165548>

llvm-svn: 158085

show more ...


Revision tags: llvmorg-3.1.0, llvmorg-3.1.0-rc3
# 6eec06d0 03-May-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com>

[PCH] When validating that the files coming from PCH did not change, also
validate that we didn't override the contents of any of such files.

If this is detected, emit a diagnostic error and recover

[PCH] When validating that the files coming from PCH did not change, also
validate that we didn't override the contents of any of such files.

If this is detected, emit a diagnostic error and recover gracefully
by using the contents of the original file that the PCH was built from.

Part of rdar://11305263

llvm-svn: 156107

show more ...


Revision tags: llvmorg-3.1.0-rc2, llvmorg-3.1.0-rc1
# 543036a4 06-Apr-2012 Benjamin Kramer <benny.kra@googlemail.com>

SourceManager: Vectorize ComputeLineNumbers for SSE2.

This method is very hot, it is called when emitting diagnostics, in -E mode
and for many #pragma handlers. It scans through the whole source fil

SourceManager: Vectorize ComputeLineNumbers for SSE2.

This method is very hot, it is called when emitting diagnostics, in -E mode
and for many #pragma handlers. It scans through the whole source file to
count newlines, records and caches them in a vector.

The speedup from vectorization isn't very large, as we fall back to bytewise
scanning when we hit a newline. There might be a way to avoid leaving the sse
loop but everything I tried didn't work out because a call to push_back
clobbers xmm registers.

About 2% speedup on average on "clang -E > /dev/null" of all .cpp files in
clang's lib/Sema.

llvm-svn: 154204

show more ...


# 969fdfdd 20-Feb-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com>

[PCH] Recover gracefully if the ASTReader detects that a file is different
from the one stored in the PCH/AST, while trying to load a SLocEntry.

We verify that all files of the PCH did not change be

[PCH] Recover gracefully if the ASTReader detects that a file is different
from the one stored in the PCH/AST, while trying to load a SLocEntry.

We verify that all files of the PCH did not change before loading it but this is not enough because:

- The AST may have been 1) kept around, 2) to do queries on it.
- We may have 1) verified the PCH and 2) started parsing.

Between 1) and 2) files may change and we are going to have crashes because the rest of clang
cannot deal with the ASTReader failing to read a SLocEntry.

Handle this by recovering gracefully in such a case, by initializing the SLocEntry
with the info from the PCH/AST as well as reporting failure by the ASTReader.

rdar://10888929

llvm-svn: 151004

show more ...


# e841c901 21-Dec-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com>

Fix bugs in SourceManager::computeMacroArgsCache() and add a unit test for it.

llvm-svn: 147057


# 2403797e 21-Dec-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com>

For SourceManager::isBeforeInTranslationUnit(), have it consider macro arg expanded
token locations as coming before the closing ')' of a function macro expansion.

Include a unit test for SourceMana

For SourceManager::isBeforeInTranslationUnit(), have it consider macro arg expanded
token locations as coming before the closing ')' of a function macro expansion.

Include a unit test for SourceManager.

llvm-svn: 147056

show more ...


# 2a8bc152 19-Dec-2011 Dylan Noblesmith <nobled@dreamwidth.org>

SourceManager: use getBufferSize()

Forming an out of bounds pointer to check if it's out
of bounds was undefined behavior.

llvm-svn: 146861


# af41b3f0 15-Dec-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com>

In SourceManager::~SourceManager do a sanity check to make sure we
don't try to destruct a null ContentCache.

rdar://10567159

llvm-svn: 146707


# cc6107df 10-Dec-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com>

In ContentCache::replaceBuffer, add sanity check to make sure that we do not free a buffer
and then continue using it. rdar://10359140.

llvm-svn: 146308


# 6c8d29f7 10-Dec-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com>

Add a sanity check in SourceManager::getColumnNumber, make sure
we don't try to access beyond the buffer.

llvm-svn: 146305


Revision tags: llvmorg-3.0.0, llvmorg-3.0.0-rc4
# 9dc3212f 16-Nov-2011 Douglas Gregor <dgregor@apple.com>

Implement (de-)serialization of the buffer contents for an overridden
file in the source manager. This allows us to properly create and use
modules described by module map files without umbrella head

Implement (de-)serialization of the buffer contents for an overridden
file in the source manager. This allows us to properly create and use
modules described by module map files without umbrella headers (or
with incompletely umbrella headers). More generally, we can actually
build a PCH file that makes use of file -> buffer remappings, which
could be useful in libclang in the future.

llvm-svn: 144830

show more ...


Revision tags: llvmorg-3.0.0-rc3, llvmorg-3.0.0-rc2
# 8edffaa6 25-Oct-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com>

Use assert(0) instead of duplicating the check, suggestion by Anna.

llvm-svn: 142886


Revision tags: llvmorg-3.0.0-rc1
# 7f6b029c 12-Oct-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com>

Introduce SourceManager::getFileLoc which returns a file location
taking into account macro arguments.

llvm-svn: 141771


12345678910>>...16