aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Basic/SourceLocation.cpp
AgeCommit message (Collapse)AuthorFilesLines
2014-08-18Inline function into only use.Rafael Espindola1-6/+2
llvm-svn: 215925
2014-01-04Only mark dump() function definitions 'used' in debug buildsAlp Toker1-3/+4
This has the dual effect of (1) enabling more dead-stripping in release builds and (2) ensuring that debug helper functions aren't stripped away in debug builds, as they're intended to be called from the debugger. Note that the attribute is applied to definitions rather than declarations in headers going forward because it's now conditional on NDEBUG: /// \brief Mark debug helper function definitions like dump() that should not be /// stripped from debug builds. Requires corresponding macro added in LLVM r198456. llvm-svn: 198489
2012-12-12PR14581: Make SourceLocation::printToString work, or it will always return ↵Benjamin Kramer1-1/+1
an empty string. No test case, this is debugging code. llvm-svn: 169980
2012-11-09Add a SourceLocation::printToString() that returns in a std::string what dump()Argyrios Kyrtzidis1-0/+7
writes to stderr; for debugging purposes. llvm-svn: 167629
2012-02-26Move FullSourceLoc::dump into the .cpp file, the used attribute made us emit ↵Benjamin Kramer1-0/+4
this into every TU that includes SourceLocation.h. llvm-svn: 151493
2011-07-26Clean up as many of the comments in Basic I can find to talk in terms ofChandler Carruth1-1/+1
'expansion' rather than 'instantiation' for macro source locations. llvm-svn: 136058
2011-07-25Rename getInstantiationLineNumber to getExpansionLineNumber in bothChandler Carruth1-2/+2
SourceManager and FullSourceLoc. llvm-svn: 135969
2011-07-25Rename getInstantiationColumnNumber to getExpansionColumnNumber in bothChandler Carruth1-2/+2
SourceManager and FullSourceLoc. llvm-svn: 135965
2011-07-25Mechanically rename SourceManager::getInstantiationLoc andChandler Carruth1-3/+3
FullSourceLoc::getInstantiationLoc to ...::getExpansionLoc. This is part of the API and documentation update from 'instantiation' as the term for macros to 'expansion'. llvm-svn: 135914
2011-07-23remove unneeded llvm:: namespace qualifiers on some core types now that ↵Chris Lattner1-3/+3
LLVM.h imports them into the clang namespace. llvm-svn: 135852
2010-12-15Fix diagnostic pragmas.Argyrios Kyrtzidis1-0/+5
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
2010-11-12Make sure to always check the result ofDouglas Gregor1-0/+5
SourceManager::getPresumedLoc(), so that we don't try to make use of an invalid presumed location. Doing so can cause crashes. llvm-svn: 118885
2010-03-16Update get*LineNumber() and get*ColumnNumber() functions to pass theDouglas Gregor1-8/+8
Invalid bit through; there are no safety-critical callers of these functions. llvm-svn: 98674
2010-03-16Audit all callers of SourceManager::getCharacterData(); update some ofDouglas Gregor1-2/+2
them to recover more gracefully on failure. llvm-svn: 98672
2010-03-16Audit all getBuffer() callers (for both the FullSourceLoc andDouglas Gregor1-4/+4
SourceManager versions), updating those callers that need to recover gracefully from failure. llvm-svn: 98665
2010-03-16Switch another function to StringRef instead of char pointer pairs.Benjamin Kramer1-3/+2
llvm-svn: 98631
2009-09-09Remove tabs, and whitespace cleanups.Mike Stump1-2/+2
llvm-svn: 81346
2009-04-22Remove the serialization code that predates precompiledDouglas Gregor1-22/+0
headers. Future approaches to (de-)serializing ASTs will be based on the PCH infrastructure. llvm-svn: 69828
2009-03-10Remove some now-unneeded calls to llvm::errs().flush().Daniel Dunbar1-1/+0
llvm-svn: 66555
2009-03-10Add FullSourceLoc::getDecomposedLoc.Ted Kremenek1-0/+4
llvm-svn: 66522
2009-03-05Include information about compound statements when crashing in sema or theChris Lattner1-11/+35
parser. For example, we now print out: 0. t.c:5:10: in compound statement {} 1. t.c:3:12: in compound statement {} 2. clang t.c -fsyntax-only llvm-svn: 66108
2009-03-02improve compatibility with GCC 4.4, patch by Michel Salim (PR3697)Chris Lattner1-0/+1
llvm-svn: 65884
2009-02-04lower the interface to getLineNumber like we did forChris Lattner1-5/+0
getColumnNumber. This fixes a FIXME in SourceManager::getPresumedLoc because we now just decompose the sloc once. llvm-svn: 63701
2009-02-04make SM::getColumnNumber take a predecomposed FileID/offset, whichChris Lattner1-6/+0
makes it clear to clients that they have to pick an instantiation or spelling location before calling it and allows optimization based on that. llvm-svn: 63698
2009-01-28Add method FullSourceLoc::getBufferData().Ted Kremenek1-0/+6
llvm-svn: 63229
2009-01-27Introduce a new PresumedLoc class to represent the concept of a locationChris Lattner1-29/+23
as reported to the user and as manipulated by #line. This is what __FILE__, __INCLUDE_LEVEL__, diagnostics and other things should follow (but not dependency generation!). This patch also includes several cleanups along the way: - SourceLocation now has a dump method, and several other places that did similar things now use it. - I cleaned up some code in AnalysisConsumer, but it should probably be simplified further now that NamedDecl is better. - TextDiagnosticPrinter is now simplified and cleaned up a bit. This patch is a prerequisite for #line, but does not actually provide any #line functionality. llvm-svn: 63098
2009-01-19Rename SourceManager::getCanonicalFileID -> getFileID. There isChris Lattner1-2/+2
no longer such thing as a non-canonical FileID. llvm-svn: 62499
2009-01-19remove the SourceManager:: and FullSourceLoc::getFileEntryForLoc methods.Chris Lattner1-5/+0
llvm-svn: 62496
2009-01-19some minor cleanups to SourceManager, and eliminate the Chris Lattner1-1/+1
SourceManager::getBuffer(SourceLocation) method. llvm-svn: 62494
2009-01-17Rename SourceLocation::getFileID to getChunkID, because it returnsChris Lattner1-0/+6
the chunk ID not the file ID. This exposes problems in TextDiagnosticPrinter where it should have been using the canonical file ID but wasn't. Fix these along the way. llvm-svn: 62427
2009-01-17this massive patch introduces a simple new abstraction: it makesChris Lattner1-1/+1
"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
2009-01-16Make FullSourceLoc derive from SourceLocation instead of Chris Lattner1-27/+27
containing one. Containment is generally better than derivation, but in this case FullSourceLoc really 'isa' SourceLocation. llvm-svn: 62375
2009-01-16elimiante FullSourceLoc::getCanonicalFileIDChris Lattner1-7/+2
llvm-svn: 62374
2009-01-16remove FullSourceLoc::isFileIDChris Lattner1-1/+1
llvm-svn: 62371
2009-01-16more SourceLocation lexicon change: instead of referring to theChris Lattner1-11/+11
"logical" location, refer to the "instantiation" location. llvm-svn: 62316
2009-01-16Change some terminology in SourceLocation: instead of referring to Chris Lattner1-10/+10
the "physical" location of tokens, refer to the "spelling" location. This is more concrete and useful, tokens aren't really physical objects! llvm-svn: 62309
2008-09-29Make some methods const, add some helpers to FullSourceLoc,Chris Lattner1-5/+39
and add a dump method to FullSourceLoc! Patch by Nico Weber! llvm-svn: 56806
2008-08-10* Remove isInSystemHeader() from DiagClient, move it to SourceManagerNico Weber1-0/+6
* Move FormatError() from TextDiagnostic up to DiagClient, remove now empty class TextDiagnostic * Make DiagClient optional for Diagnostic This fixes the following problems: * -html-diags (and probably others) does now output the same set of warnings as console clang does * nothing crashes if one forgets to call setHeaderSearch() on TextDiagnostic * some code duplication is removed llvm-svn: 54620
2008-04-14Added "getCanonicalID()", "isFromSameFile", and "isFromMainFile" to compareTed Kremenek1-0/+4
the files of different SourceLocations. These methods correctly handle the case where a file may have multiple FileIDs due to it being large enough to be spread across several chunks. llvm-svn: 49682
2008-04-03Added "getLogicalLineNumber" and "getLogicalColumnNumber" to FullSourceLoc.Ted Kremenek1-2/+13
llvm-svn: 49177
2008-03-15Make a major restructuring of the clang tree: introduce a top-levelChris Lattner1-0/+79
lib dir and move all the libraries into it. This follows the main llvm tree, and allows the libraries to be built in parallel. The top level now enforces that all the libs are built before Driver, but we don't care what order the libs are built in. This speeds up parallel builds, particularly incremental ones. llvm-svn: 48402