aboutsummaryrefslogtreecommitdiff
path: root/include/clang/Basic/SourceManager.h
AgeCommit message (Collapse)Author
2008-08-10* Remove isInSystemHeader() from DiagClient, move it to SourceManagerNico Weber
* 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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54620 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-09add assert, use make_pair() instead of pair constructorNico Weber
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54596 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-26Another class -> struct in declaration to match definition.Cedric Venet
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52782 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-06Use a common SourceManager when processing multiple files. This allows us ↵Ted Kremenek
to cache the contents of source files already loaded from disk. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52066 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-14Added "getCanonicalID()", "isFromSameFile", and "isFromMainFile" to compareTed Kremenek
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49682 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-08Make SourceManager::getFullFilePos() public.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49402 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-02Cleanup previous patch (based on feedback from Ted).Steve Naroff
Since this behavior is useful for most classes, we might consider adding a simple 3 method class that implements the behavior. Ted said that Boost has such a class. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46654 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-01Make sure SourceManager/HeaderSearch don't support default copy constructors ↵Steve Naroff
(since they result in bad runtime behavior). I'm sure there are other classes that might need this "guard", however I was bitten by these 2 recently (so I thought I'd fix them). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46653 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-29Don't attribute in file headers anymore. See llvmdev for theChris Lattner
discussion of this change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45410 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-20Fix trivial self-infinite-recursionChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45248 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-20Added method getFileEntryForID() to SourceManager.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45237 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-19Added methods createMainFileID() and createMainFileIDForMemBuffer() toTed Kremenek
SourceManager to allow SourceManager to directly intern the MainFileID when it is created. Removed setMainFileID(). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45231 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-19Added storage of the FileID of the the main source file of a translation unitTed Kremenek
in SourceManager. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45225 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-05Renamed SourceManager::Read to SourceManager::CreateAndRegister.Ted Kremenek
Now sourcemanager deserializer automatically self-registers itself with the deserializer. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44591 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-05Implemented initial serialization support for SourceManager.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44590 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-04Implemented serialization of SrcMgr::ContentCache.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44578 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-04Fixed a few more comments to change "FileInfo" to "ContentCache."Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44574 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-09rename getInstantiationLoc to match the scheme of isPhysicalLoc.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43969 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-09change source location to have two bits for macros, trackingChris Lattner
whether the location is the start and/or end of an expansion. These are currently not set or used by anything. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43968 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-30Updated some comments.Ted Kremenek
Disabled assignments for ContentCache. Copy-ctor for ContentCache now has an assertion preventing it to be copied from an object that already has an allocated buffer. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43526 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-30Removed SrcMgr::FileInfo and SrcMgr::InfoRec and replaced them with aTed Kremenek
single class: ContentCache. This simplifies the logic in SourceManager and makes the ownership of MemoryBuffers clearer. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43518 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-30update some comments.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43506 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-12add a new SM::getDecomposedFileLoc method.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42931 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-11Push the rewriting APIs along. Build a trivial client that replaces tabsChris Lattner
with x's for now. The APIs are all unimplemented, so it doesn't do anything yet! :) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42868 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-30constify a method.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41600 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-24Use a smallstring instead of an std::string in FileChanged to avoid some ↵Chris Lattner
malloc traffic. This speeds up -E on xalancbmk by 2.4% git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40461 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-24Add a cache to SourceManager to accellerate line # lookup. This is aChris Lattner
bottleneck for -E computation, because every token that starts a line needs to determine *which* line it is on (so -E mode can insert the appropriate vertical whitespace). This optimization improves this common case where it is striding through the line # table. This speeds up -E on xalancbmk by 3.2% git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40459 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-22when running in -E mode on multiple files, there is no reason to accumulate Chris Lattner
fileid's and macroid's across files. Clearing between files keeps the tables smaller and slightly speeds up compilation. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40383 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-20improve comments, implement a trivial single-entry cache in Chris Lattner
SourceManager::getInstantiationLoc. With this change, every token expanded from a macro doesn't get its own MacroID. :) This reduces # macro IDs in carbon.h from 16805 to 9197 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40108 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-20Reimplement SourceLocation. Instead of having a Chris Lattner
fileid/offset pair, it now contains a bit discriminating between mapped locations and file locations. This separates the tables for macros and files in SourceManager, and allows better separation of concepts in the rest of the compiler. This allows us to have *many* macro instantiations before running out of 'addressing space'. This is also more efficient, because testing whether something is a macro expansion is now a bit test instead of a table lookup (which also used to require having a srcmgr around, now it doesn't). This is fully functional, but there are several refinements and optimizations left. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40103 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-15Change SourceManager::getInstantiationLoc to take virtual locations, doing itsChris Lattner
virtual->physical mapping explicitly. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39867 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-12Improve portability to compilers where <cassert> is not implicitlyChris Lattner
included. Patch contributed by Benoit Boissinot! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39779 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-11Stage two of getting CFE top correct.Reid Spencer
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39734 91177308-0d34-0410-b5e6-96231b3b80d8