aboutsummaryrefslogtreecommitdiff
path: root/clang/tools/libclang/CIndexInclusionStack.cpp
AgeCommit message (Collapse)AuthorFilesLines
2016-12-17[libclang] Remove the 'extern "C"' blocks from the implementation files.Argyrios Kyrtzidis1-2/+0
These are unnecessary, the declarations already carry the 'extern C' property, and if there is mismatch between declaration and definition then we will get linker errors via libclang.exports. llvm-svn: 290025
2016-07-18[NFC] Header cleanupMehdi Amini1-2/+0
Summary: Removed unused headers, replaced some headers with forward class declarations Patch by: Eugene <claprix@yandex.ru> Differential Revision: https://reviews.llvm.org/D20100 llvm-svn: 275882
2016-01-06Show inclusions from a preamble in clang_getInclusions.Erik Verbruggen1-26/+51
When reparsing a translation unit with preamble generation turned on, no includes are found. This is due to the fact that all SLocs from AST/PCH files are skipped as they are 'loaded', and inclusions from a preamble are also 'loaded'. So, in case a file has a preamble, it first needs to process those loaded inclusions, and then check for any local inclusions. This latter one is for any includes that are not part of the preamble, like includes half-way through a file. This fixes PR24748. Differential Revision: http://reviews.llvm.org/D14329 llvm-svn: 256939
2014-02-11Fix a typo in the function name that I just introduced (r201155)Dmitri Gribenko1-1/+1
llvm-svn: 201156
2014-02-11libclang: audit all APIs that accept a CXTranslationUnit to make sure thatDmitri Gribenko1-1/+5
checks for invalid translation unit are in place. Also, while there, add log output for this case. llvm-svn: 201155
2013-01-26libclang: factor out the frequent pattern static_cast<ASTUnit *>(TU->TUData)Dmitri Gribenko1-1/+1
into a getter cxtu::getASTUnit(TU) llvm-svn: 173585
2013-01-15Fix CastingDavid Greene1-1/+2
Use const_cast<> to avoid a cast-away-const error. llvm-svn: 172562
2012-12-04Sort #include lines for tools/...Chandler Carruth1-1/+1
Completely automated with sort_includes.py llvm-svn: 169240
2011-07-23remove unneeded llvm:: namespace qualifiers on some core types now that ↵Chris Lattner1-1/+1
LLVM.h imports them into the clang namespace. llvm-svn: 135852
2011-07-19Revamp the SourceManager to separate the representation of parsedDouglas Gregor1-7/+10
source locations from source locations loaded from an AST/PCH file. Previously, loading an AST/PCH file involved carefully pre-allocating space at the beginning of the source manager for the source locations and FileIDs that correspond to the prefix, and then appending the source locations/FileIDs used for parsing the remaining translation unit. This design forced us into loading PCH files early, as a prefix, whic has become a rather significant limitation. This patch splits the SourceManager space into two parts: for source location "addresses", the lower values (growing upward) are used to describe parsed code, while upper values (growing downward) are used for source locations loaded from AST/PCH files. Similarly, positive FileIDs are used to describe parsed code while negative FileIDs are used to file/macro locations loaded from AST/PCH files. As a result, we can load PCH/AST files even during parsing, making various improvemnts in the future possible, e.g., teaching #include <foo.h> to look for and load <foo.h.gch> if it happens to be already available. This patch was originally written by Sebastian Redl, then brought forward to the modern age by Jonathan Turner, and finally polished/finished by me to be committed. llvm-svn: 135484
2011-04-20Teach SourceManager::getSLocEntry() that it can fail due to problemsDouglas Gregor1-3/+3
during deserialization from a precompiled header, and update all of its callers to note when this problem occurs and recover (more) gracefully. Fixes <rdar://problem/9119249>. llvm-svn: 129839
2011-03-05Currently we can only remap a file by creating a MemoryBuffer and replacing ↵Argyrios Kyrtzidis1-2/+2
the file contents with it. Allow remapping a file by specifying another filename whose contents should be loaded if the original file gets loaded. This allows to override files without having to create & load buffers in advance. llvm-svn: 127052
2010-11-17Make definition of CXTranslationUnitImpl privateTed Kremenek1-0/+1
to libclang. llvm-svn: 119585
2010-11-16Change CXTranslationUnit to not directly cast to an ASTUnit*,Ted Kremenek1-1/+1
but to wrap both an ASTUnit and a "string pool" that will be used for fast USR generation. This requires a bunch of mechanical changes, as there was a ton of code that assumed that CXTranslationUnit and ASTUnit* were the same. Along with this change, introduce CXStringBuf, which provides an llvm::SmallVector<char> backing for repeatedly generating CXStrings without a huge amount of malloc() traffic. This requires making some changes to the representation of CXString by renaming a few fields (but keeping the size of the object the same). llvm-svn: 119337
2010-11-12Make sure to always check the result ofDouglas Gregor1-1/+1
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-04-30Rename 'CIndex' to 'libclang', since it has basically become our stable publicDaniel Dunbar1-0/+67
(C) API, and will likely grow further in this direction in the future. llvm-svn: 102779