llvm-project/clang/lib/Lex
John Brawn 4d79ec7fe8 Reapply r276973 "Adjust Registry interface to not require plugins to export a registry"
This differs from the previous version by being more careful about template
instantiation/specialization in order to prevent errors when building with
clang -Werror. Specifically:
 * begin is not defined in the template and is instead instantiated when Head
   is. I think the warning when we don't do that is wrong (PR28815) but for now
   at least do it this way to avoid the warning.
 * Instead of performing template specializations in LLVM_INSTANTIATE_REGISTRY
   instead provide a template definition then do explicit instantiation. No
   compiler I've tried has problems with doing it the other way, but strictly
   speaking it's not permitted by the C++ standard so better safe than sorry.

Original commit message:

Currently the Registry class contains the vestiges of a previous attempt to
allow plugins to be used on Windows without using BUILD_SHARED_LIBS, where a
plugin would have its own copy of a registry and export it to be imported by
the tool that's loading the plugin. This only works if the plugin is entirely
self-contained with the only interface between the plugin and tool being the
registry, and in particular this conflicts with how IR pass plugins work.

This patch changes things so that instead the add_node function of the registry
is exported by the tool and then imported by the plugin, which solves this
problem and also means that instead of every plugin having to export every
registry they use instead LLVM only has to export the add_node functions. This
allows plugins that use a registry to work on Windows if
LLVM_EXPORT_SYMBOLS_FOR_PLUGINS is used.

llvm-svn: 277806
2016-08-05 11:01:08 +00:00
..
CMakeLists.txt [CMake] Use LINK_LIBS instead of target_link_libraries(). 2014-02-26 06:41:29 +00:00
HeaderMap.cpp Lex: Return "" when HeaderMap::lookupFilename fails 2016-02-23 00:48:16 +00:00
HeaderSearch.cpp [NFC] Header cleanup 2016-07-18 19:02:11 +00:00
Lexer.cpp Implement filtering for code completion of identifiers. 2016-07-27 14:56:59 +00:00
LiteralSupport.cpp [NFC] Header cleanup 2016-07-18 19:02:11 +00:00
MacroArgs.cpp [modules] Stop trying to fake up a linear MacroDirective history. 2015-04-29 23:20:19 +00:00
MacroInfo.cpp Annotate dump() methods with LLVM_DUMP_METHOD, addressing Richard Smith r259192 post commit comment. 2016-01-29 19:38:18 +00:00
ModuleMap.cpp [Lex] inferModuleFromLocation should do no work if there are no modules 2016-05-16 20:30:03 +00:00
PPCaching.cpp [Parser] Update CachedTokens while parsing ObjectiveC template argument list 2016-01-31 00:47:51 +00:00
PPCallbacks.cpp
PPConditionalDirectiveRecord.cpp Switch PPCallbacks to take the new MacroDefinition instead of MacroDirective*, in order to preserve full information on module macro expansion. 2015-05-04 03:15:40 +00:00
PPDirectives.cpp [NFC] Header cleanup 2016-07-18 19:02:11 +00:00
PPExpressions.cpp Improve diagnostic for the case when a non-defined function-like macro is used 2016-04-16 00:07:09 +00:00
PPLexerChange.cpp PR24667: fix quadratic runtime if textually-included modular headers define large numbers of macros. 2016-02-23 23:20:51 +00:00
PPMacroExpansion.cpp [NFC] Header cleanup 2016-07-18 19:02:11 +00:00
PTHLexer.cpp [NFC] Header cleanup 2016-07-18 19:02:11 +00:00
Pragma.cpp Support '#pragma once' in headers when using PCH 2016-07-25 17:17:06 +00:00
PreprocessingRecord.cpp Roll-back r250822. 2015-10-20 13:23:58 +00:00
Preprocessor.cpp Reapply r276973 "Adjust Registry interface to not require plugins to export a registry" 2016-08-05 11:01:08 +00:00
PreprocessorLexer.cpp
ScratchBuffer.cpp MSan told me that we actually dump the entire scratch buffer into PCH files, initialize it. 2015-04-06 20:01:49 +00:00
TokenConcatenation.cpp [clang] Refactoring of conditions so they use isOneOf() instead of multiple is(). 2015-06-18 10:59:26 +00:00
TokenLexer.cpp [Lex] Speed up updateConsecutiveMacroArgTokens (NFC) 2016-07-07 22:38:29 +00:00
UnicodeCharSets.h Header guard canonicalization, clang part. 2014-08-13 16:25:19 +00:00