summaryrefslogtreecommitdiffstats
path: root/clang/tools/libclang/CXSourceLocation.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* Reverting r316278 due to failing build bots.Aaron Ballman2017-10-211-1/+2
| | | | | | | http://lab.llvm.org:8011/builders/clang-ppc64be-linux/builds/11896 http://lab.llvm.org:8011/builders/clang-s390x-linux/builds/12380 llvm-svn: 316279
* [libclang, bindings]: add spelling locationMasud Rahman2017-10-211-2/+1
| | | | | | | | | | | | | | | | | | o) Add a 'Location' class that represents the four properties of a physical location o) Enhance 'SourceLocation' to provide 'expansion' and 'spelling' locations, maintaining backwards compatibility with existing code by forwarding the four properties to 'expansion'. o) Update the implementation to use 'clang_getExpansionLocation' instead of the deprecated 'clang_getInstantiationLocation', which has been present since 2011. o) Update the implementation of 'clang_getSpellingLocation' to actually obtain spelling location instead of file location. llvm-svn: 316278
* [libclang] Remove the 'extern "C"' blocks from the implementation files.Argyrios Kyrtzidis2016-12-171-12/+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
* Replace uses of LLVM_FUNCTION_NAME with __func__, this was macro was removed ↵Erik Pilkington2016-10-201-1/+1
| | | | | | from llvm/Support in r284681 llvm-svn: 284690
* Store FileEntry::Filename as a StringRef instead of raw pointer (NFC)Mehdi Amini2016-10-101-3/+4
| | | | llvm-svn: 283815
* Fix some Clang-tidy readability-redundant-control-flow warnings; other minor ↵Eugene Zelenko2016-02-101-6/+0
| | | | | | | | fixes. Differential revision: http://reviews.llvm.org/D17060 llvm-svn: 260414
* [C++11] Use 'nullptr'. Tools edition.Craig Topper2014-06-081-6/+6
| | | | llvm-svn: 210422
* Fix a typo in the function name that I just introduced (r201155)Dmitri Gribenko2014-02-111-2/+2
| | | | llvm-svn: 201156
* libclang: audit all APIs that accept a CXTranslationUnit to make sure thatDmitri Gribenko2014-02-111-3/+11
| | | | | | | checks for invalid translation unit are in place. Also, while there, add log output for this case. llvm-svn: 201155
* [libclang] In clang_getLocation, check that the provided line/column is valid.Argyrios Kyrtzidis2013-09-121-0/+2
| | | | | | rdar://14971432 llvm-svn: 190568
* Fix 2 cases of uninitialized reads of an invalid PresumedLoc.Evgeniy Stepanov2013-09-111-13/+15
| | | | | | | | | The code in CGExpr was added back in 2012 (r165536) but not exercised in tests until recently. Detected on the MemorySanitizer bootstrap bot. llvm-svn: 190521
* Split isFromMainFile into two functions.Eli Friedman2013-08-221-1/+1
| | | | | | | | | 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). llvm-svn: 188968
* Add clang_Location_isFromMainFile() to libclang.Stefanus Du Toit2013-08-081-0/+11
| | | | | | | | Also bump the minor version number and update libclang.exports. Reviewed by: Dmitri Gribenko, Doug Gregor llvm-svn: 187994
* [libclang] Introduce clang_Location_isInSystemHeader to check if a location ↵Argyrios Kyrtzidis2013-04-121-0/+11
| | | | | | | | resides in a system header. This is a modified patch provided from Mikołaj Siedlarek! llvm-svn: 179384
* libclang: remove 'using namespace cxstring'Dmitri Gribenko2013-02-031-1/+0
| | | | llvm-svn: 174285
* libclang: introduce cxstring::{createRef,createDup} for C stringsDmitri Gribenko2013-02-021-1/+1
| | | | | | Also migrate all clients from the old API. llvm-svn: 174238
* libclang: itroduce cxstring::createEmpty()Dmitri Gribenko2013-02-011-1/+1
| | | | llvm-svn: 174174
* libclang: factor out the frequent pattern static_cast<ASTUnit *>(TU->TUData)Dmitri Gribenko2013-01-261-6/+6
| | | | | | into a getter cxtu::getASTUnit(TU) llvm-svn: 173585
* Remove uneeded castsDmitri Gribenko2013-01-231-1/+1
| | | | llvm-svn: 173269
* Explicitly cast away the const-ness instead of doing it implicitly.Bill Wendling2013-01-231-1/+1
| | | | llvm-svn: 173241
* Re-sort all the headers. Lots of regressions have crept in here.Chandler Carruth2013-01-191-1/+1
| | | | | | | | | | 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. llvm-svn: 172892
* Fix CastingDavid Greene2013-01-151-2/+2
| | | | | | Use const_cast<> to avoid a cast-away-const error. llvm-svn: 172564
* Replace more usages of __func__ with LLVM_FUNCTION_NAMEDmitri Gribenko2013-01-111-1/+2
| | | | llvm-svn: 172161
* [libclang] Enhance logging capabilities of libclang.Argyrios Kyrtzidis2013-01-101-9/+13
| | | | | | | | | -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. llvm-svn: 172089
* [libclang] Introduce clang_getFileLocation.Argyrios Kyrtzidis2013-01-041-1/+38
| | | | | | | | | 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. llvm-svn: 171486
* Simplify logic to use SourceManager::getFileLoc(), per Argyrios's feedback.Ted Kremenek2012-12-191-8/+1
| | | | llvm-svn: 170487
* Have clang_getSpellingLocation() use the same logic as DiagnosticRenderer ↵Ted Kremenek2012-12-181-8/+6
| | | | | | | | | | | | 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). llvm-svn: 170468
* Sort #include lines for tools/...Chandler Carruth2012-12-041-3/+2
| | | | | | Completely automated with sort_includes.py llvm-svn: 169240
* serialized diagnostics: implement full deserialization of clang diagnostics ↵Ted Kremenek2011-11-101-88/+107
| | | | | | | | via the libclang API. I've tested it on simple cases and it works. Test cases to follow as well as a few tweaks. llvm-svn: 144269
* [libclang] Add missing return in clang_getExpansionLocation that resulted in ↵Argyrios Kyrtzidis2011-11-031-0/+1
| | | | | | | | | | | 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. llvm-svn: 143606
* [libclang] Tweak internals of CXSourceLocation to allow an alternate ↵Ted Kremenek2011-10-311-75/+111
| | | | | | | | implementation if the lowest bit of ptr_data[0] is not 0. This is prep for work on serialized diagnostics. llvm-svn: 143373
* [libclang] Move implementation of functions for manipulation ↵Ted Kremenek2011-10-311-0/+270
CXSourceLocations and CXSourceRanges into a separate file. llvm-svn: 143370
OpenPOWER on IntegriCloud