Граф коммитов

26 Коммитов

Автор SHA1 Сообщение Дата
Craig Topper 085452490f [C++11] Use 'nullptr'. Tools edition.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210422 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-08 08:38:04 +00:00
Dmitri Gribenko 5d1b349501 Fix a typo in the function name that I just introduced (r201155)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201156 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-11 15:02:48 +00:00
Dmitri Gribenko f9db0e0340 libclang: audit all APIs that accept a CXTranslationUnit to make sure that
checks for invalid translation unit are in place.  Also, while there, add log
output for this case.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201155 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-11 14:34:14 +00:00
Argyrios Kyrtzidis 8644aa9149 [libclang] In clang_getLocation, check that the provided line/column is valid.
rdar://14971432

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190568 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-12 01:10:36 +00:00
Evgeniy Stepanov 2bb6dad4a4 Fix 2 cases of uninitialized reads of an invalid PresumedLoc.
The code in CGExpr was added back in 2012 (r165536) but not exercised in tests
until recently.

Detected on the MemorySanitizer bootstrap bot.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190521 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-11 12:33:58 +00:00
Eli Friedman 24146975f1 Split isFromMainFile into two functions.
Basically, isInMainFile considers line markers, and isWrittenInMainFile
doesn't.  Distinguishing between the two is useful when dealing with
files which are preprocessed files or rewritten with -frewrite-includes
(so we don't, for example, print useless warnings).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188968 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-22 00:27:10 +00:00
Stefanus Du Toit ad0d570746 Add clang_Location_isFromMainFile() to libclang.
Also bump the minor version number and update libclang.exports.

Reviewed by: Dmitri Gribenko, Doug Gregor

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187994 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-08 17:48:14 +00:00
Argyrios Kyrtzidis 4522f63e00 [libclang] Introduce clang_Location_isInSystemHeader to check if a location resides in a system header.
This is a modified patch provided from Mikołaj Siedlarek!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179384 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-12 17:06:51 +00:00
Dmitri Gribenko aca3e56144 libclang: remove 'using namespace cxstring'
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174285 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-03 13:52:47 +00:00
Dmitri Gribenko 0c4394c7f6 libclang: introduce cxstring::{createRef,createDup} for C strings
Also migrate all clients from the old API.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174238 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-02 00:02:12 +00:00
Dmitri Gribenko dc66adb40e libclang: itroduce cxstring::createEmpty()
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174174 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-01 14:21:22 +00:00
Dmitri Gribenko 5694feb5cc libclang: factor out the frequent pattern static_cast<ASTUnit *>(TU->TUData)
into a getter cxtu::getASTUnit(TU)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173585 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-26 18:53:38 +00:00
Dmitri Gribenko e4ea879fe7 Remove uneeded casts
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173269 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-23 15:56:07 +00:00
Bill Wendling 69652660e7 Explicitly cast away the const-ness instead of doing it implicitly.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173241 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-23 08:58:23 +00:00
Chandler Carruth b1ba0efc3d Re-sort all the headers. Lots of regressions have crept in here.
Manually fix the order of UnwrappedLineParser.cpp as that one didn't
have its associated header as the first header.

This also uncovered a subtle inclusion order dependency as CLog.h didn't
include LLVM.h to pick up using declarations it relied upon.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172892 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-19 08:09:44 +00:00
David Greene 3cfa5324ef Fix Casting
Use const_cast<> to avoid a cast-away-const error.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172564 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-15 22:09:49 +00:00
Dmitri Gribenko acbe4ba0be Replace more usages of __func__ with LLVM_FUNCTION_NAME
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172161 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-11 02:23:13 +00:00
Argyrios Kyrtzidis c6f5c6a58d [libclang] Enhance logging capabilities of libclang.
-provide a "raw_ostream'ish" class to make it convenient to output logging info.
-use macros to automate a bit the logging functionality inside libclang functions
-when logging, print a stack trace if "LIBCLANG_LOGGING=2" environment is set.
-add logging to more functions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172089 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-10 18:54:52 +00:00
Argyrios Kyrtzidis 2d5c133d3d [libclang] Introduce clang_getFileLocation.
Uses of clang_getSpellingLocation should eventually move to calling
clang_getFileLocation, and clang_getSpellingLocation should do what
its name represents and actually point at the 'spelling' location, e.g.
inside a macro definition if the spelling of a token came from that.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171486 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-04 18:30:13 +00:00
Ted Kremenek 6ee225c8d4 Simplify logic to use SourceManager::getFileLoc(), per Argyrios's feedback.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170487 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-19 01:16:49 +00:00
Ted Kremenek d9b877765c Have clang_getSpellingLocation() use the same logic as DiagnosticRenderer for plowing through macros.
This fixes a subtle bug reported in <rdar://problem/12584554> where a double-nested
macro could lead to an incorrect fixit location with live issues.

This fix also uncovers a bunch of subtle bugs in our indexer test cases which
are now fixed (mostly around source ranges for attributes).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170468 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-18 23:07:30 +00:00
Chandler Carruth f59edb96b2 Sort #include lines for tools/...
Completely automated with sort_includes.py

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169240 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-04 09:25:21 +00:00
Ted Kremenek 153221717e serialized diagnostics: implement full deserialization of clang diagnostics via the libclang API.
I've tested it on simple cases and it works.  Test cases to follow as well as a few tweaks.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144269 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-10 08:43:12 +00:00
Argyrios Kyrtzidis b4efaa0a14 [libclang] Add missing return in clang_getExpansionLocation that resulted in that function
always returning a null file/line/column.

Also add at least one use of clang_getExpansionLocation inside c-index-test that would have
made the tests to catch that.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143606 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-03 02:20:36 +00:00
Ted Kremenek 51a7d5d7f6 [libclang] Tweak internals of CXSourceLocation to allow an alternate implementation if the lowest bit of ptr_data[0] is not 0. This
is prep for work on serialized diagnostics.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143373 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-31 22:23:51 +00:00
Ted Kremenek 3ddef060a9 [libclang] Move implementation of functions for manipulation CXSourceLocations and CXSourceRanges into a separate file.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143370 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-31 22:05:42 +00:00