summaryrefslogtreecommitdiffstats
path: root/clang/lib/Lex
Commit message (Collapse)AuthorAgeFilesLines
...
* Added -Wdisabled-macro-expansion warning.Abramo Bagnara2012-01-011-2/+5
| | | | llvm-svn: 147418
* Implement support for module requirements, which indicate the languageDouglas Gregor2011-12-313-18/+150
| | | | | | | | | features needed for a particular module to be available. This allows mixed-language modules, where certain headers only work under some language variants (e.g., in C++, std.tuple might only be available in C++11 mode). llvm-svn: 147387
* Mass rename C1x references to C11. The name hasn't proliferated like "C++0x" ↵Benjamin Kramer2011-12-231-5/+5
| | | | | | | | so this patch is surprisingly small. Also drop -Wc1x-extensions in favor of -Wc11-extensions. I don't think we need to keep this around for compatibility. llvm-svn: 147221
* Remove spurious, but now legal, typenameDouglas Gregor2011-12-231-1/+1
| | | | llvm-svn: 147208
* When building a module with an umbrella header, warn about any headersDouglas Gregor2011-12-231-0/+67
| | | | | | | | found within that umbrella directory that were not actually included by the umbrella header. They should either be referenced in the module map or included by the umbrella header. llvm-svn: 147207
* remove unneeded config.h includesDylan Noblesmith2011-12-221-1/+1
| | | | llvm-svn: 147195
* In Lexer::getCharAndSizeSlow[NoWarn] if we come up againstArgyrios Kyrtzidis2011-12-221-12/+10
| | | | | | | | | | \<newline><newline> don't consume the second newline. Thanks to David Blaikie for pointing out the crash! llvm-svn: 147138
* In Lexer::getCharAndSizeSlow[NoWarn] make sure we don't go over the end of ↵Argyrios Kyrtzidis2011-12-211-0/+7
| | | | | | | | | | the buffer when the end of the buffer is immediately after an escaped newline. Fixes http://llvm.org/PR10153. llvm-svn: 147091
* Update the CMake build for r146959's new files.Chandler Carruth2011-12-201-0/+1
| | | | llvm-svn: 146967
* Unweaken vtables as per ↵David Blaikie2011-12-203-0/+18
| | | | | | http://llvm.org/docs/CodingStandards.html#ll_virtual_anch llvm-svn: 146959
* Detect when mapping a #include/#import over to a submodule ends upDouglas Gregor2011-12-201-3/+4
| | | | | | | | | | | | | hitting a submodule that was never actually created, e.g., because that header wasn't parsed. In such cases, complain (because the module's umbrella headers don't cover everything) and fall back to including the header. Later, we'll add a warning at module-build time to catch all such cases. However, this fallback is important to eliminate assertions in the ASTWriter when this happens. llvm-svn: 146933
* [PCH] Fix bug where we failed to update an identifier for a single tokenArgyrios Kyrtzidis2011-12-171-0/+5
| | | | | | | | macro expansion. rdar://10588825 llvm-svn: 146818
* Don't allow #include (and its friends #import, #include_next andRichard Smith2011-12-161-2/+18
| | | | | | | | #__include_macros) in the arguments of a function-style macro. Directives in the arguments of such macros have undefined behaviour, and GCC does not correctly support these cases. In some situations, this can lead to better diagnostics. llvm-svn: 146765
* Set umbrella directory correctly when we infer a framework moduleDouglas Gregor2011-12-121-1/+1
| | | | llvm-svn: 146451
* Don't mark include guard macros as implicitly private. This isn'tDouglas Gregor2011-12-121-21/+1
| | | | | | | actually a terribly good heuristic, and the world is too horrible for it to work. llvm-svn: 146393
* When performing subframework header lookup, don't search forDouglas Gregor2011-12-091-3/+7
| | | | | | | ".framework/" in the path name, because it could be ".framework\" on Windows. This whole function needs to be rewritten with PathV2. llvm-svn: 146261
* Implement the notion of umbrella directories, which implicity coverDouglas Gregor2011-12-091-67/+33
| | | | | | | | | | | | | all of the headers below that particular directory. Use umbrella directories as a clean way to deal with (1) directories/frameworks that don't have an umbrella header, but don't want to enumerate all of their headers, and (2) PrivateHeaders, which we never want to enumerate and want to keep separate from the main umbrella header. This also eliminates a little more of the "magic" for private headers, and frameworks in general. llvm-svn: 146235
* Move a free function from the Frontend library into the Lex library asChandler Carruth2011-12-091-0/+23
| | | | | | | | part of HeaderSearch. This function just normalizes filenames for use inside of a synthetic include directive, but it is used in both the Frontend and Serialization libraries so it needs a common home. llvm-svn: 146227
* Implement umbrella directories for modules, which are similar toDouglas Gregor2011-12-081-10/+73
| | | | | | | | | | | | | | | umbrella headers in the sense that all of the headers within that directory (and eventually its subdirectories) are considered to be part of the module with that umbrella directory. However, unlike umbrella headers, which are expected to include all of the headers within their subdirectories, Clang will automatically include all of the headers it finds in the named subdirectory. The intent here is to allow a module map to trivially turn a subdirectory into a module, where the module's structure can mimic the directory structure. llvm-svn: 146165
* Tweak the syntax of umbrella headers, so that "umbrella" is treated asDouglas Gregor2011-12-081-101/+36
| | | | | | | | | | | a modifier for a header declarartion, e.g., umbrella header "headername" Collapse the umbrella-handling code in the parser into the header-handling code, so we don't duplicate the header-search logic. llvm-svn: 146159
* Within the module representation, generalize the notion of an umbrellaDouglas Gregor2011-12-081-7/+7
| | | | | | | | | | header to also support umbrella directories. The umbrella directory for an umbrella header is the directory in which the umbrella header resides. No functionality change yet, but it's coming. llvm-svn: 146158
* Keep track of import dependencies between submodules within the moduleDouglas Gregor2011-12-082-20/+24
| | | | | | | that's currently being built. This is important for supporting transitive dependencies ("export *" in the module map) completely. llvm-svn: 146156
* Convert paths to native format before constructing aDouglas Gregor2011-12-081-5/+12
| | | | | | directory_iterator for them. llvm-svn: 146154
* Implement inference for the "Private" submodule corresponding toDouglas Gregor2011-12-071-5/+51
| | | | | | private headers in a framework. llvm-svn: 146082
* Make sure we pick up module_private.map when loading a module.map file.Douglas Gregor2011-12-071-1/+10
| | | | llvm-svn: 146074
* Implement basic support for private headers in frameworks. In essence,Douglas Gregor2011-12-072-25/+131
| | | | | | | | | when we load a module map (module.map) from a directory, also load a private module map (module_private.map) for that directory, if present. That private module map can inject a new submodule that captures private headers. llvm-svn: 146012
* Remove misleading error messageDouglas Gregor2011-12-061-2/+1
| | | | llvm-svn: 145958
* When inferring a module map for a framework, infer subframeworkDouglas Gregor2011-12-062-10/+34
| | | | | | modules for each of its subframeworks. llvm-svn: 145957
* Allow inferred submodules for any (sub)module that has an umbrella headerDouglas Gregor2011-12-061-9/+8
| | | | llvm-svn: 145945
* When suggesting a module import for a #include or #import, suggest theDouglas Gregor2011-12-061-6/+3
| | | | | | | | most specific (sub)module based on the actual file we find, rather than always importing the top-level module. This means that #include'ing <Foo/Blah.h> should give us the submodule Foo.Blah. llvm-svn: 145942
* Implement modules support for subframeworks (aka embeddedDouglas Gregor2011-12-061-19/+39
| | | | | | | | frameworks). A submodule can now be labeled as a "framework", and header search will look into the appropriate Headers/PrivateHeaders subdirectories for named headers. llvm-svn: 145941
* Minor tweak to prepare for submodules with umbrella headers. No actualDouglas Gregor2011-12-061-7/+13
| | | | | | functionality change yet. llvm-svn: 145938
* Implement inferred submodules support, which (when requested)Douglas Gregor2011-12-061-30/+92
| | | | | | | implicitly generates submodules corresponding to the headers that fall within a module. llvm-svn: 145887
* Parse inferred submodules in module maps, track their contents inDouglas Gregor2011-12-051-1/+103
| | | | | | | Module, and (de-)serialize this information. Semantics of inferred submodules to follow. llvm-svn: 145864
* Inferred framework modules automatically export anything they importDouglas Gregor2011-12-051-0/+5
| | | | | | (i.e., 'export *'), to better match the semantics of headers. llvm-svn: 145813
* Implement support for wildcard exports in modules, allowing a moduleDouglas Gregor2011-12-051-1/+8
| | | | | | | | to re-export anything that it imports. This opt-in feature makes a module behave more like a header, because it can be used to re-export the transitive closure of a (sub)module's dependencies. llvm-svn: 145811
* When writing a module file, keep track of the set of (sub)modules thatDouglas Gregor2011-12-051-0/+20
| | | | | | | it imports, establishing dependencies at the (sub)module granularity. This is not a user-visible change (yet). llvm-svn: 145808
* Implement support for the __is_final type trait, to determine whetherDouglas Gregor2011-12-031-0/+1
| | | | | | | a class is marked 'final', from Alberto Ganesh Barbati! Fixes PR11462. llvm-svn: 145775
* When we treat an #include or #import as a module import, create anDouglas Gregor2011-12-022-2/+4
| | | | | | | implicit ImportDecl in the translation unit to record the presence of the import. llvm-svn: 145727
* Implementing parsing and resolution of module export declarationsDouglas Gregor2011-12-022-2/+143
| | | | | | | | within module maps, which will (eventually) be used to re-export a module from another module. There are still some pieces missing, however. llvm-svn: 145665
* Introduce the notion of name visibility into modules. For a givenDouglas Gregor2011-12-012-3/+6
| | | | | | | | | | | | | | (sub)module, all of the names may be hidden, just the macro names may be exposed (for example, after the preprocessor has seen the import of the module but the parser has not), or all of the names may be exposed. Importing a module makes its names, and the names in any of its non-explicit submodules, visible to name lookup (transitively). This commit only introduces the notion of name visible and marks modules and submodules as visible when they are imported. The actual name-hiding logic in the AST reader will follow (along with test cases). llvm-svn: 145586
* Unbreak build with GCC. Clang is too lame to diagnose this particular ↵Douglas Gregor2011-11-301-2/+0
| | | | | | ill-formedness llvm-svn: 145539
* Promote ModuleMap::Module to a namespace-scope class in the BasicDouglas Gregor2011-11-303-103/+23
| | | | | | | | | library, since modules cut across all of the libraries. Rename serialization::Module to serialization::ModuleFile to side-step the annoying naming conflict. Prune a bunch of ModuleMap.h includes that are no longer needed (most files only needed the Module type). llvm-svn: 145538
* Note that we'll need to handle __include_macros specially in the module loaderDouglas Gregor2011-11-301-0/+1
| | | | llvm-svn: 145514
* Move the module auto-import logic after the logic that allows aDouglas Gregor2011-11-301-29/+29
| | | | | | | | | | callback client to suggest an alternative search path and after we complain when the included file can't be found. The former can't be tested in isolation, the latter doesn't actually matter (because we won't make a module suggestion if no header is available). However, the flow is better this way. llvm-svn: 145502
* Trivial indentation fix for the code I just committedDouglas Gregor2011-11-301-3/+3
| | | | llvm-svn: 145501
* Introduce an opt-in warning indicating when the compiler is treatingDouglas Gregor2011-11-301-0/+42
| | | | | | an #include/#import as a module import. llvm-svn: 145500
* Implement (de-)serialization of the description of a module and itsDouglas Gregor2011-11-301-0/+17
| | | | | | | | | submodules. This information will eventually be used for name hiding when dealing with submodules. For now, we only use it to ensure that the module "key" returned when loading a module will always be a module (rather than occasionally being a FileEntry). llvm-svn: 145497
* Use raw_ostream::indent.Benjamin Kramer2011-11-301-8/+4
| | | | llvm-svn: 145492
* Switch the module map printer over toDouglas Gregor2011-11-301-27/+2
| | | | | | raw_ostream::write_escaped. Thanks, Benjamin! llvm-svn: 145491
OpenPOWER on IntegriCloud