summaryrefslogtreecommitdiffstats
path: root/include/clang/Lex
Commit message (Collapse)AuthorAgeFilesLines
* Revert "Correct the source range returned from preprocessor callbacks."Benjamin Kramer2019-01-151-5/+2
| | | | | | | This reverts commit r350891. Also add a test case that would return an empty string with r350891. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@351209 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix header issues.Richard Trieu2019-01-111-0/+1
| | | | | | | | | | | | | | Several headers would fail to compile if other headers were not previously included. The usual issue is that a class is forward declared, but the full definition is needed. The requirement for the definition is use of isa/dyn_cast or calling functions of pointer-packed data types such as DenseMap or PointerIntPair. Add missing includes to these headers. SVals.h required an out-of-line method definition in the .cpp file to avoid circular inclusion of headers with BasicValueFactory.h git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@350913 91177308-0d34-0410-b5e6-96231b3b80d8
* Correct the source range returned from preprocessor callbacks.Aaron Ballman2019-01-101-2/+5
| | | | | | This adjusts the source range passed in to the preprocessor callbacks to only include the condition range itself, rather than all of the conditionally skipped tokens. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@350891 91177308-0d34-0410-b5e6-96231b3b80d8
* Add vtable anchor to classes.Richard Trieu2018-12-291-0/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@350143 91177308-0d34-0410-b5e6-96231b3b80d8
* Move diagnostic enums into Basic.Richard Trieu2018-12-081-14/+1
| | | | | | | | | | Move enums from */*Diagnostic.h to Basic/Diagnostic*.h. Basic/AllDiagnostics.h needs all the enums and moving the sources to Basic prevents a Basic->*->Basic dependency loop. This also allows each Basic/Diagnostics*Kinds.td to have a header at Basic/Diagnostic*.h (except for Common). The old headers are kept in place since other packages are still using them. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348685 91177308-0d34-0410-b5e6-96231b3b80d8
* [Preprocessor] Don't avoid entering included files after hitting a fatal error.Volodymyr Sapsai2018-12-071-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | Change in r337953 violated the contract for `CXTranslationUnit_KeepGoing`: > Do not stop processing when fatal errors are encountered. Use different approach to fix long processing times with multiple inclusion cycles. Instead of stopping preprocessing for fatal errors, do this after reaching the max allowed include depth and only for the files that were processed already. It is likely but not guaranteed those files cause a cycle. rdar://problem/46108547 Reviewers: erik.pilkington, arphaman Reviewed By: erik.pilkington Subscribers: jkorous, dexonsmith, ilya-biryukov, Dmitry.Kozhevnikov Differential Revision: https://reviews.llvm.org/D55095 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348641 91177308-0d34-0410-b5e6-96231b3b80d8
* PTH-- Remove feature entirely-Erich Keane2018-12-044-301/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When debugging a boost build with a modified version of Clang, I discovered that the PTH implementation stores TokenKind in 8 bits. However, we currently have 368 TokenKinds. The result is that the value gets truncated and the wrong token gets picked up when including PTH files. It seems that this will go wrong every time someone uses a token that uses the 9th bit. Upon asking on IRC, it was brought up that this was a highly experimental features that was considered a failure. I discovered via googling that BoostBuild (mostly Boost.Math) is the only user of this feature, using the CC1 flag directly. I believe that this can be transferred over to normal PCH with minimal effort: https://github.com/boostorg/build/issues/367 Based on advice on IRC and research showing that this is a nearly completely unused feature, this patch removes it entirely. Note: I considered leaving the build-flags in place and making them emit an error/warning, however since I've basically identified and warned the only user, it seemed better to just remove them. Differential Revision: https://reviews.llvm.org/D54547 Change-Id: If32744275ef1f585357bd6c1c813d96973c4d8d9 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348266 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "Make clang-based tools find libc++ on MacOS"Jonas Devlieghere2018-11-121-7/+0
| | | | | | This breaks the LLDB bots. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@346675 91177308-0d34-0410-b5e6-96231b3b80d8
* Make clang-based tools find libc++ on MacOSIlya Biryukov2018-11-121-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: When they read compiler args from compile_commands.json. This change allows to run clang-based tools, like clang-tidy or clangd, built from head using the compile_commands.json file produced for XCode toolchains. On MacOS clang can find the C++ standard library relative to the compiler installation dir. The logic to do this was based on resource dir as an approximation of where the compiler is installed. This broke the tools that read 'compile_commands.json' and don't ship with the compiler, as they typically change resource dir. To workaround this, we now use compiler install dir detected by the driver to better mimic the behavior of the original compiler when replaying the compilations using other tools. Reviewers: sammccall, arphaman, EricWF Reviewed By: sammccall Subscribers: ioeric, christof, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D54310 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@346652 91177308-0d34-0410-b5e6-96231b3b80d8
* [Lex] Make MacroDirective::findDirectiveAtLoc take const SourceManagerKristof Umann2018-10-311-1/+2
| | | | | | | | | | I'm currently working on including macro expansions in the Static Analyzer's plist output, where I can only access a const SourceManager. Differential Revision: https://reviews.llvm.org/D53940 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@345741 91177308-0d34-0410-b5e6-96231b3b80d8
* Wdocumentation fixSimon Pilgrim2018-10-061-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@343915 91177308-0d34-0410-b5e6-96231b3b80d8
* Attempt to fix a -Wdocumentation-html warning. NFCI.Simon Pilgrim2018-09-291-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@343374 91177308-0d34-0410-b5e6-96231b3b80d8
* [Lex] TokenConcatenation now takes const PreprocessorKristof Umann2018-09-271-2/+2
| | | | | | | Differential Revision: https://reviews.llvm.org/D52502 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@343204 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a callback for `__has_include` and use it for dependency scanning.Volodymyr Sapsai2018-09-181-0/+13
| | | | | | | | | | | | | | | | | This adds a preprocessor callback for the `__has_include` and `__has_include_next` directives. Successful checking for the presence of a header should add it to the list of header dependencies so this overrides the callback in the dependency scanner. Patch by Pete Cooper with some additions by me. rdar://problem/39545636 Differential Revision: https://reviews.llvm.org/D30882 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@342517 91177308-0d34-0410-b5e6-96231b3b80d8
* [CodeComplete] Add completions for filenames in #include directives.Sam McCall2018-09-183-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: The dir component ("somedir" in #include <somedir/fo...>) is considered fixed. We append "foo" to each directory on the include path, and then list its files. Completions are of the forms: #include <somedir/fo^ foo.h> fox/ The filter is set to the filename part ("fo"), so fuzzy matching can be applied to the filename only. No fancy scoring/priorities are set, and no information is added to CodeCompleteResult to make smart scoring possible. Could be in future. Reviewers: ilya-biryukov Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D52076 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@342449 91177308-0d34-0410-b5e6-96231b3b80d8
* [modules] Frontend support for building a header module from a list ofRichard Smith2018-09-151-5/+7
| | | | | | headaer files. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@342304 91177308-0d34-0410-b5e6-96231b3b80d8
* [clang-cl, PCH] Support for /Yc and /Yu without filename and #pragma hdrstopMike Rice2018-09-112-4/+26
| | | | | | | | | | | | | | | With clang-cl, when the user specifies /Yc or /Yu without a filename the compiler uses a #pragma hdrstop in the main source file to determine the end of the PCH. If a header is specified with /Yc or /Yu #pragma hdrstop has no effect. The optional #pragma hdrstop filename argument is not yet supported. Differential Revision: https://reviews.llvm.org/D51391 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@341963 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix Wdocumentation warnings. NFCI.Simon Pilgrim2018-08-222-8/+7
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@340394 91177308-0d34-0410-b5e6-96231b3b80d8
* [Lex] Make HeaderMaps a unique_ptr vectorFangrui Song2018-08-202-6/+5
| | | | | | | | | | | | Summary: unique_ptr makes the ownership clearer than a raw pointer container. Reviewers: Eugene.Zelenko, dblaikie Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D50945 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@340198 91177308-0d34-0410-b5e6-96231b3b80d8
* [Lex] Fix some inconsistent parameter names and duplicate comments. NFCFangrui Song2018-08-198-58/+56
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@340145 91177308-0d34-0410-b5e6-96231b3b80d8
* [clang] Store code completion token range in preprocessor.Kadir Cetinkaya2018-08-131-0/+13
| | | | | | | | | | | | | | | | | Summary: This change is to support a new fature in clangd, tests will be send toclang-tools-extra with that change. Unittests are included in: https://reviews.llvm.org/D50449 Reviewers: ilya-biryukov Reviewed By: ilya-biryukov Subscribers: ioeric, MaskRay, jkorous, arphaman, cfe-commits Differential Revision: https://reviews.llvm.org/D50443 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@339540 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove trailing spaceFangrui Song2018-07-3022-166/+166
| | | | | | sed -Ei 's/[[:space:]]+$//' include/**/*.{def,h,td} lib/**/*.{cpp,h} git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@338291 91177308-0d34-0410-b5e6-96231b3b80d8
* Reapply r336660: [Modules] Autoload subdirectory modulemaps with specific ↵Bruno Cardoso Lopes2018-07-181-2/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | LangOpts Summary: Reproducer and errors: https://bugs.llvm.org/show_bug.cgi?id=37878 lookupModule was falling back to loadSubdirectoryModuleMaps when it couldn't find ModuleName in (proper) search paths. This was causing iteration over all files in the search path subdirectories for example "/usr/include/foobar" in bugzilla case. Users don't expect Clang to load modulemaps in subdirectories implicitly, and also the disk access is not cheap. if (AllowExtraModuleMapSearch) true with ObjC with @import ModuleName. Reviewers: rsmith, aprantl, bruno Subscribers: cfe-commits, teemperor, v.g.vassilev Differential Revision: https://reviews.llvm.org/D48367 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@337430 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "[modules] Fix 37878; Autoload subdirectory modulemaps with specific ↵Bruno Cardoso Lopes2018-07-121-10/+2
| | | | | | | | | | | | | | | LangOpts" This reverts commit f40124d4f05ecf4f880cf4e8f26922d861f705f3 / r336660. This change shouldn't be affecting `@import` behavior, but turns out it is: https://ci.swift.org/view/swift-master-next/job/oss-swift-incremental-RA-osx-master-next/2800/consoleFull#-12570166563122a513-f36a-4c87-8ed7-cbc36a1ec144 Working on a reduced testcase for this, reverting in the meantime. rdar://problem/42102222 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@336920 91177308-0d34-0410-b5e6-96231b3b80d8
* [modules] Fix 37878; Autoload subdirectory modulemaps with specific LangOptsYuka Takahashi2018-07-101-2/+10
| | | | | | | | | | | | | | | | | | | | | | | | Summary: Reproducer and errors: https://bugs.llvm.org/show_bug.cgi?id=37878 lookupModule was falling back to loadSubdirectoryModuleMaps when it couldn't find ModuleName in (proper) search paths. This was causing iteration over all files in the search path subdirectories for example "/usr/include/foobar" in bugzilla case. Users don't expect Clang to load modulemaps in subdirectories implicitly, and also the disk access is not cheap. if (AllowExtraModuleMapSearch) true with ObjC with @import ModuleName. Reviewers: rsmith, aprantl, bruno Subscribers: cfe-commits, teemperor, v.g.vassilev Differential Revision: https://reviews.llvm.org/D48367 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@336660 91177308-0d34-0410-b5e6-96231b3b80d8
* [PCH] Add an option to not write comments into PCHIlya Biryukov2018-07-091-0/+5
| | | | | | | | | | | | | | | | | | Summary: Will be used in clangd, see the follow-up change. Clangd does not use comments read from PCH to avoid crashes due to changed contents of the file. However, reading them considerably slows down code completion on files with large preambles. Reviewers: sammccall Reviewed By: sammccall Subscribers: ioeric, cfe-commits Differential Revision: https://reviews.llvm.org/D48942 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@336539 91177308-0d34-0410-b5e6-96231b3b80d8
* [clang-cl, PCH] Implement support for MS-style PCH through headersErich Keane2018-07-052-0/+32
| | | | | | | | | | | | | | | | | | | | | | Implement support for MS-style PCH through headers. This enables support for /Yc and /Yu where the through header is either on the command line or included in the source. It replaces the current support the requires the header also be specified with /FI. This change adds a -cc1 option -pch-through-header that is used to either start or stop compilation during PCH create or use. When creating a PCH, the compilation ends after compilation of the through header. When using a PCH, tokens are skipped until after the through header is seen. Patch By: mikerice Differential Revision: https://reviews.llvm.org/D46652 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@336379 91177308-0d34-0410-b5e6-96231b3b80d8
* [Fixed Point Arithmetic] Fixed Point Precision Bits and Fixed Point LiteralsLeonard Chan2018-06-201-3/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This diff includes the logic for setting the precision bits for each primary fixed point type in the target info and logic for initializing a fixed point literal. Fixed point literals are declared using the suffixes ``` hr: short _Fract uhr: unsigned short _Fract r: _Fract ur: unsigned _Fract lr: long _Fract ulr: unsigned long _Fract hk: short _Accum uhk: unsigned short _Accum k: _Accum uk: unsigned _Accum ``` Errors are also thrown for illegal literal values ``` unsigned short _Accum u_short_accum = 256.0uhk; // expected-error{{the integral part of this literal is too large for this unsigned _Accum type}} ``` Differential Revision: https://reviews.llvm.org/D46915 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@335148 91177308-0d34-0410-b5e6-96231b3b80d8
* Recommit r335063: [Darwin] Add a warning for missing include path for libstdc++Alex Lorenz2018-06-191-0/+2
| | | | | | | | | | | | | | | | | The recommit ensures that the tests that failed on bots don't trigger the warning. Xcode 10 removes support for libstdc++, but the users just get a confusing include not file warning when including an STL header (when building for iOS6 which uses libstdc++ by default for example). This patch adds a new warning that lets the user know that the libstdc++ include path was not found to ensure that the user is more aware of why the error occurs. rdar://40830462 Differential Revision: https://reviews.llvm.org/D48297 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@335081 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r335063 as it causes bot failuresAlex Lorenz2018-06-191-2/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@335073 91177308-0d34-0410-b5e6-96231b3b80d8
* [Darwin] Add a warning for missing include path for libstdc++Alex Lorenz2018-06-191-0/+2
| | | | | | | | | | | | | | | Xcode 10 removes support for libstdc++, but the users just get a confusing include not file warning when including an STL header (when building for iOS6 which uses libstdc++ by default for example). This patch adds a new warning that lets the user know that the libstdc++ include path was not found to ensure that the user is more aware of why the error occurs. rdar://40830462 Differential Revision: https://reviews.llvm.org/D48297 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@335063 91177308-0d34-0410-b5e6-96231b3b80d8
* [Modules] Warning for module declarations lacking 'framework' qualifierBruno Cardoso Lopes2018-06-011-4/+19
| | | | | | | | | | | | | | | When a module declaration for a framework lacks the 'framework' qualifier, the listed headers aren't found (because there's no trigger for the special framework style path lookup) and the module is silently not built. This leads to frameworks not being modularized by accident, which is pretty bad. Add a warning and suggest the user to add the 'framework' qualifier when we can prove that it's the case. rdar://problem/39193062 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@333718 91177308-0d34-0410-b5e6-96231b3b80d8
* Reland '[clang] Adding CharacteristicKind to PPCallbacks::InclusionDirective'Julie Hockett2018-05-102-6/+12
| | | | | | | | | | | | | | This commit relands r331904. Adding a SrcMgr::CharacteristicKind parameter to the InclusionDirective in PPCallbacks, and updating calls to that function. This will be useful in https://reviews.llvm.org/D43778 to determine which includes are system headers. Differential Revision: https://reviews.llvm.org/D46614 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@332021 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "[clang] Adding CharacteristicKind to PPCallbacks::InclusionDirective"Julie Hockett2018-05-092-12/+6
| | | | | | This reverts commit r331904 because of a memory leak. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@331932 91177308-0d34-0410-b5e6-96231b3b80d8
* [clang] Adding CharacteristicKind to PPCallbacks::InclusionDirectiveJulie Hockett2018-05-092-6/+12
| | | | | | | | | | | Adding a SrcMgr::CharacteristicKind parameter to the InclusionDirective in PPCallbacks, and updating calls to that function. This will be useful in https://reviews.llvm.org/D43778 to determine which includes are system headers. Differential Revision: https://reviews.llvm.org/D46614 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@331904 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove \brief commands from doxygen comments.Adrian Prantl2018-05-0921-658/+658
| | | | | | | | | | | | | | | | | | | This is similar to the LLVM change https://reviews.llvm.org/D46290. We've been running doxygen with the autobrief option for a couple of years now. This makes the \brief markers into our comments redundant. Since they are a visual distraction and we don't want to encourage more \brief markers in new code either, this patch removes them all. Patch produced by for i in $(git grep -l '\@brief'); do perl -pi -e 's/\@brief //g' $i & done for i in $(git grep -l '\\brief'); do perl -pi -e 's/\\brief //g' $i & done Differential Revision: https://reviews.llvm.org/D46320 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@331834 91177308-0d34-0410-b5e6-96231b3b80d8
* PR37189 Fix incorrect end source location and spelling for a split '>>' token.Richard Smith2018-04-302-2/+17
| | | | | | | | | | | | | | | | | | | When a '>>' token is split into two '>' tokens (in C++11 onwards), or (as an extension) when we do the same for other tokens starting with a '>', we can't just use a location pointing to the first '>' as the location of the split token, because that would result in our miscomputing the length and spelling for the token. As a consequence, for example, a refactoring replacing 'A<X>' with something else would sometimes replace one character too many, and similarly diagnostics highlighting a template-id source range would highlight one character too many. Fix this by creating an expansion range covering the first character of the '>>' token, whose spelling is '>'. For this to work, we generalize the expansion range of a macro FileID to be either a token range (the common case) or a character range (used in this new case). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@331155 91177308-0d34-0410-b5e6-96231b3b80d8
* Use export_as for autolinking frameworksBruno Cardoso Lopes2018-04-161-0/+13
| | | | | | | | | | | | | | | | framework module SomeKitCore { ... export_as SomeKit } Given the module above, while generting autolink information during codegen, clang should to emit '-framework SomeKitCore' only if SomeKit was not imported in the relevant TU, otherwise it should use '-framework SomeKit' instead. rdar://problem/38269782 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@330152 91177308-0d34-0410-b5e6-96231b3b80d8
* Lex: make `clang::Preprocessor::macros` work on MSVCSaleem Abdulrasool2018-04-111-3/+5
| | | | | | | | | | | | | | The order of argument construction is reversed on MS ABI on Windows. When `macros` was invoked, the `end` call is made prior to `begin`. In such a case, the DenseMap (`ModuleMap`) is populated after the `end` iterator is constructed. This reversal results in the invalidation of the end iterator, resulting in a failure at runtime (assertion failure in `DenseMap<T>::operator!=` that "handles are not in sync!"). Ensure that the end iterator is constructed after the begin iterator. This fixes the use of `macros(bool)`, which symptomized as an assertion failure in the swift compiler in the clang importer. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@329866 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r329684 (and follow-ups 329693, 329714). See discussion on ↵Nico Weber2018-04-101-5/+1
| | | | | | https://reviews.llvm.org/D43578. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@329739 91177308-0d34-0410-b5e6-96231b3b80d8
* -ftime-report switch support in Clang.Andrew V. Tischenko2018-04-101-1/+5
| | | | | | | | | | | The current support of the feature produces only 2 lines in report: -Some general Code Generation Time; -Total time of Backend Consumer actions. This patch extends Clang time report with new lines related to Preprocessor, Include Filea Search, Parsing, etc. Differential Revision: https://reviews.llvm.org/D43578 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@329684 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix typos in clangAlexander Kornienko2018-04-063-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Found via codespell -q 3 -I ../clang-whitelist.txt Where whitelist consists of: archtype cas classs checkk compres definit frome iff inteval ith lod methode nd optin ot pres statics te thru Patch by luzpaz! (This is a subset of D44188 that applies cleanly with a few files that have dubious fixes reverted.) Differential revision: https://reviews.llvm.org/D44188 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@329399 91177308-0d34-0410-b5e6-96231b3b80d8
* [Lexer] Support adding working directory to relative search dir for #include ↵Eric Liu2018-01-291-1/+10
| | | | | | | | | | | | shortening in HeaderSearch. Reviewers: bkramer Subscribers: mgorny, hintonda, cfe-commits Differential Revision: https://reviews.llvm.org/D42577 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@323647 91177308-0d34-0410-b5e6-96231b3b80d8
* [NFC] fix trivial typos in comments and documentsHiroshi Inoue2018-01-262-2/+2
| | | | | | | | "in in" -> "in", "on on" -> "on" etc. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@323509 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix typos of occurred and occurrenceMalcolm Parsons2018-01-241-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@323316 91177308-0d34-0410-b5e6-96231b3b80d8
* [PCH] Serialize skipped preprocessor rangesCameron Desrochers2018-01-151-1/+17
| | | | | | | | The skipped preprocessor ranges are now serialized in the AST PCH file. This fixes, for example, libclang's clang_getSkippedRanges() returning zero ranges after reparsing a translation unit. Differential Revision: https://reviews.llvm.org/D20124 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@322503 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove outdated doxygen comment [-Wdocumentation]Benjamin Kramer2018-01-071-4/+0
| | | | | | No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@321960 91177308-0d34-0410-b5e6-96231b3b80d8
* Track shadow modules with a generation counter.Bruno Cardoso Lopes2018-01-052-16/+23
| | | | | | | | | | This is a follow up to r321855, closing the gap between our internal shadow modules implementation and upstream. It has been tested for longer and provides a better approach for tracking shadow modules. Mostly NFCI. rdar://problem/23612102 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@321906 91177308-0d34-0410-b5e6-96231b3b80d8
* Reapply r321781: [Modules] Allow modules specified by -fmodule-map-file to ↵Bruno Cardoso Lopes2018-01-052-5/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | shadow implicitly found ones When modules come from module map files explicitly specified by -fmodule-map-file= arguments, allow those to override/shadow modules with the same name that are found implicitly by header search. If such a module is looked up by name (e.g. @import), we will always find the one from -fmodule-map-file. If we try to use a shadowed module by including one of its headers report an error. This enables developers to force use of a specific copy of their module to be used if there are multiple copies that would otherwise be visible, for example if they develop modules that are installed in the default search paths. Patch originally by Ben Langmuir, http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20151116/143425.html Based on cfe-dev discussion: http://lists.llvm.org/pipermail/cfe-dev/2015-November/046164.html Differential Revision: https://reviews.llvm.org/D31269 rdar://problem/23612102 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@321855 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "[Modules] Allow modules specified by -fmodule-map-file to shadow ↵Bruno Cardoso Lopes2018-01-042-29/+5
| | | | | | | | | | | implicitly found ones" This reverts r321781 until I fix the leaks pointed out by bots: http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fast/builds/12146 http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-bootstrap/builds/3741 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@321786 91177308-0d34-0410-b5e6-96231b3b80d8