summaryrefslogtreecommitdiffstats
path: root/clang/test/Modules
Commit message (Collapse)AuthorAgeFilesLines
...
* Revert r240335.Richard Smith2015-11-122-3/+6
| | | | | | | | | | | | | | | This failed to solve the problem it was aimed at, and introduced just as many issues as it resolved. Realistically, we need to deal with the possibility that multiple modules might define different internal linkage symbols with the same name, and this isn't a problem unless two such symbols are simultaneously visible. The case where two modules define equivalent internal linkage symbols is handled by r252063: if lookup finds multiple sufficiently-similar entities from different modules, we just pick one of them as an extension (but we keep them separate). llvm-svn: 252957
* Allow use of private headers in different sub-modules.Manuel Klimek2015-11-053-0/+53
| | | | llvm-svn: 252170
* [modules] Don't merge an anonymous enum definition into a named enum definition.Richard Smith2015-11-051-1/+16
| | | | llvm-svn: 252125
* [modules] If we're given a module file, via -fmodule-file=, for a module, butRichard Smith2015-11-051-0/+4
| | | | | | | | | we can't load that file due to a configuration mismatch, and implicit module building is disabled, and the user turns off the error-by-default warning for that situation, then fall back to textual inclusion for the module rather than giving an error if any of its headers are included. llvm-svn: 252114
* [modules] Generalize the workaround for multiple ambiguous definitions ofRichard Smith2015-11-043-1/+9
| | | | | | | | | | | | | internal linkage entities in different modules from r250884 to apply to all names, not just function names. This is really awkward: we don't want to merge internal-linkage symbols from separate modules, because they might not actually be defining the same entity. But we don't want to reject programs that use such an ambiguous symbol if those internal-linkage symbols are in fact equivalent. For now, we're resolving the ambiguity by picking one of the equivalent definitions as an extension. llvm-svn: 252063
* Introduce module file extensions to piggy-back data onto module files.Douglas Gregor2015-11-033-0/+49
| | | | | | | | | | | | | | | | | | | | | Introduce the notion of a module file extension, which introduces additional information into a module file at the time it is built that can then be queried when the module file is read. Module file extensions are identified by a block name (which must be unique to the extension) and can write any bitstream records into their own extension block within the module file. When a module file is loaded, any extension blocks are matched up with module file extension readers, that are per-module-file and are given access to the input bitstream. Note that module file extensions can only be introduced by programmatic clients that have access to the CompilerInvocation. There is only one such extension at the moment, which is used for testing the module file extension harness. As a future direction, one could imagine allowing the plugin mechanism to introduce new module file extensions. llvm-svn: 251955
* [modules] Rationalize the behavior of Decl::declarationReplaces, and inRichard Smith2015-11-036-0/+30
| | | | | | | | | particular don't assume that two declarations of the same kind in the same context are declaring the same entity. That's not true when the same name is declared multiple times as internal-linkage symbols within a module. (getCanonicalDecl is cheap now, so we can just use it here.) llvm-svn: 251898
* Stop back-patching 'readonly' Objective-C properties with 'readwrite' ones.Douglas Gregor2015-11-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | A 'readonly' Objective-C property declared in the primary class can effectively be shadowed by a 'readwrite' property declared within an extension of that class, so long as the types and attributes of the two property declarations are compatible. Previously, this functionality was implemented by back-patching the original 'readonly' property to make it 'readwrite', destroying source information and causing some hideously redundant, incorrect code. Simplify the implementation to express how this should actually be modeled: as a separate property declaration in the extension that shadows (via the name lookup rules) the declaration in the primary class. While here, correct some broken Fix-Its, eliminate a pile of redundant code, clean up the ARC migrator's handling of properties declared in extensions, and fix debug info's naming of methods that come from categories. A wonderous side effect of doing this write is that it eliminates the "AddedObjCPropertyInClassExtension" method from the AST mutation listener, which in turn eliminates the last place where we rewrite entire declarations in a chained PCH file or a module file. This change (which fixes rdar://problem/18475765) will allow us to eliminate the rewritten-decls logic from the serialization library, and fixes a crash (rdar://problem/23247794) illustrated by the test/PCH/chain-categories.m example. llvm-svn: 251874
* Support watchOS and tvOS driver optionsTim Northover2015-10-301-0/+0
| | | | | | | | This patch should add support for almost all command-line options and driver tinkering necessary to produce a correct "clang -cc1" invocation for watchOS and tvOS. llvm-svn: 251706
* Fix missing builtin identifier infos with PCH+modulesBen Langmuir2015-10-283-0/+11
| | | | | | | | | | | | | | Use the *current* state of "is-moduleness" rather than the state at serialization time so that if we read a builtin identifier from a module that wasn't "interesting" to that module, we will still write it out to a PCH that imports that module. Otherwise, we would get mysterious "unknown builtin" errors when using PCH+modules. rdar://problem/23287656 llvm-svn: 251565
* Fixup this testcase after r251120.Adrian Prantl2015-10-231-3/+5
| | | | | | I accidentally tested r251120 with assertions disabled. llvm-svn: 251126
* Module Debugging: Emit module debug info for types inside of Objective-CAdrian Prantl2015-10-233-0/+15
| | | | | | | | containers. rdar://problem/23196170 llvm-svn: 251120
* [modules] libstdc++ defines some static inline functions in its internalRichard Smith2015-10-216-0/+28
| | | | | | | | | | | headers. If those headers end up being textually included twice into the same module, we get ambiguity errors. Work around this by downgrading the ambiguity error to a warning if multiple identical internal-linkage functions appear in an overload set, and just pick one of those functions as the lookup result. llvm-svn: 250884
* [modules] Allow the error when explicitly loading an incompatible module fileRichard Smith2015-10-161-3/+2
| | | | | | | | | via -fmodule-file= to be turned off; in that case, just include the relevant files textually. This allows module files to be unconditionally passed to all compile actions via CXXFLAGS, and to be ignored for rules that specify custom incompatible flags. llvm-svn: 250577
* [modules] Allow the error on importing a C++ module within an extern "C"Richard Smith2015-10-131-6/+8
| | | | | | | | | context (but otherwise at the top level) to be disabled, to support use of C++ standard library implementations that (legitimately) mark their <blah.h> headers as being C++ headers from C libraries that wrap things in 'extern "C"' a bit too enthusiastically. llvm-svn: 250137
* [modules] Fix merging of __va_list_tag's implicit special member functions.Richard Smith2015-10-135-0/+26
| | | | | | | | | | | We model predefined declarations as not being from AST files, but in most ways they act as if they come from some implicit prebuilt module file imported before all others. Therefore, if we see an update to the predefined 'struct __va_list_tag' declaration (and we've already loaded any modules), it needs a corresponding update record, even though it didn't technically come from an AST file. llvm-svn: 250134
* Update tests touched by r249656David Majnemer2015-10-081-1/+1
| | | | | | | | | These test updates almost exclusively around the change in behavior around enum: enums without a definition are considered incomplete except when targeting MSVC ABIs. Since these tests are interested in the 'incomplete-enum' behavior, restrict them to %itanium_abi_triple. llvm-svn: 249660
* Stop messing with the 'g' group of options in CompilerInvocation.Douglas Katzman2015-10-088-12/+12
| | | | | | | | | | | | | | | | With this change, most 'g' options are rejected by CompilerInvocation. They remain only as Driver options. The new way to request debug info from cc1 is with "-debug-info-kind={line-tables-only|limited|standalone}" and "-dwarf-version={2|3|4}". In the absence of a command-line option to specify Dwarf version, the Toolchain decides it, rather than placing Toolchain-specific logic in CompilerInvocation. Also fix a bug in the Windows compatibility argument parsing in which the "rightmost argument wins" principle failed. Differential Revision: http://reviews.llvm.org/D13221 llvm-svn: 249655
* Module Debugging: Emit (ObjC) function declarations in the module scopeAdrian Prantl2015-10-041-0/+2
| | | | | | when building a module. llvm-svn: 249282
* Module debugging: Don't emit forward declarations in module scopes.Adrian Prantl2015-10-022-0/+4
| | | | | | A forward declaration inside a module header does not belong to the module. llvm-svn: 249157
* Break long lines for readability.Adrian Prantl2015-10-021-2/+7
| | | | llvm-svn: 249156
* Module debugging: Also emit Objective-C interfaces forward declarationsAdrian Prantl2015-10-012-1/+8
| | | | | | in their module scope when building a clang module. llvm-svn: 249031
* Module debugging: Emit Objective-C interfaces in their module scope whenAdrian Prantl2015-10-011-1/+8
| | | | | | building a clang module. llvm-svn: 248974
* Module Debugging: Emit submodules as nested DW_TAG_modules.Adrian Prantl2015-09-242-5/+22
| | | | llvm-svn: 248511
* Module Debugging: Use the clang module signature as the module's dwo_idAdrian Prantl2015-09-223-5/+13
| | | | | | | | | | | when building a module. Clang already records the module signature when building a skeleton CU to reference a clang module. Matching the id in the skeleton with the one in the module allows a DWARF consumer to verify that they found the correct version of the module without them needing to know about the clang module format. llvm-svn: 248345
* Add a belated testcase for the skeleton CU behavior in r248062.Adrian Prantl2015-09-211-2/+20
| | | | llvm-svn: 248185
* Debug Info: When building a module, emit skeleton CUs for imported modules.Adrian Prantl2015-09-211-0/+15
| | | | llvm-svn: 248184
* clang/test/Modules/DebugInfoSubmodules.c REQUIRES asserts due to -debug-only.NAKAMURA Takumi2015-09-211-0/+1
| | | | llvm-svn: 248142
* Module debugging: Support submodules in the PCM/PCH debug info.Adrian Prantl2015-09-204-0/+32
| | | | llvm-svn: 248127
* [Modules] More descriptive diagnostics for misplaced import directiveSerge Pavlov2015-09-1911-12/+49
| | | | | | | | | | If an import directive was put into wrong context, the error message was obscure, complaining on misbalanced braces. To get more descriptive messages, annotation tokens related to modules are processed where they must not be seen. Differential Revision: http://reviews.llvm.org/D11844 llvm-svn: 248085
* [modules] Fix a corner case in the macro override rules: properly handle ↵Richard Smith2015-09-161-1/+5
| | | | | | overridden leaf module macros. llvm-svn: 247765
* [modules] Make sure we make hidden UsingShadowDecls visible to redeclarationRichard Smith2015-09-153-0/+8
| | | | | | lookup for the UsingShadowDecls themselves. llvm-svn: 247714
* [modules] A using-declaration doesn't introduce a new entity, just a new nameRichard Smith2015-09-152-2/+100
| | | | | | | for an existing entity, and as such a using-declaration doesn't need to conflict with a hidden entity (nor vice versa). llvm-svn: 247654
* Revert "Always_inline codegen rewrite" and 2 follow-ups.Evgeniy Stepanov2015-09-141-2/+2
| | | | | | | | | | Revert "Update cxx-irgen.cpp test to allow signext in alwaysinline functions." Revert "[CodeGen] Remove wrapper-free always_inline functions from COMDATs" Revert "Always_inline codegen rewrite." Reason for revert: PR24793. llvm-svn: 247620
* Update cxx-irgen.cpp test to allow signext in alwaysinline functions.Samuel Antao2015-09-141-1/+1
| | | | | | This was causing an error in Power8 targets. llvm-svn: 247584
* Always_inline codegen rewrite.Evgeniy Stepanov2015-09-121-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Current implementation may end up emitting an undefined reference for an "inline __attribute__((always_inline))" function by generating an "available_externally alwaysinline" IR function for it and then failing to inline all the calls. This happens when a call to such function is in dead code. As the inliner is an SCC pass, it does not process dead code. Libc++ relies on the compiler never emitting such undefined reference. With this patch, we emit a pair of 1. internal alwaysinline definition (called F.alwaysinline) 2a. A stub F() { musttail call F.alwaysinline } -- or, depending on the linkage -- 2b. A declaration of F. The frontend ensures that F.inlinefunction is only used for direct calls, and the stub is used for everything else (taking the address of the function, really). Declaration (2b) is emitted in the case when "inline" is meant for inlining only (like __gnu_inline__ and some other cases). This approach, among other nice properties, ensures that alwaysinline functions are always internal, making it impossible for a direct call to such function to produce an undefined symbol reference. This patch is based on ideas by Chandler Carruth and Richard Smith. llvm-svn: 247494
* Revert "Specify target triple in alwaysinline tests."Evgeniy Stepanov2015-09-111-2/+2
| | | | | | | | | Revert "Always_inline codegen rewrite." Breaks gdb & lldb tests. Breaks on Fedora 22 x86_64. llvm-svn: 247491
* Add new test file missing from r247486.Richard Smith2015-09-111-0/+6
| | | | llvm-svn: 247488
* [modules] When picking one of two template declarations as a lookup result,Richard Smith2015-09-113-0/+9
| | | | | | | | it's not sufficient to prefer the declaration with more default arguments, or the one that's visible; they might both be visible, but one of them might have a visible default argument where the other has a hidden default argument. llvm-svn: 247486
* Always_inline codegen rewrite.Evgeniy Stepanov2015-09-111-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Current implementation may end up emitting an undefined reference for an "inline __attribute__((always_inline))" function by generating an "available_externally alwaysinline" IR function for it and then failing to inline all the calls. This happens when a call to such function is in dead code. As the inliner is an SCC pass, it does not process dead code. Libc++ relies on the compiler never emitting such undefined reference. With this patch, we emit a pair of 1. internal alwaysinline definition (called F.alwaysinline) 2a. A stub F() { musttail call F.alwaysinline } -- or, depending on the linkage -- 2b. A declaration of F. The frontend ensures that F.inlinefunction is only used for direct calls, and the stub is used for everything else (taking the address of the function, really). Declaration (2b) is emitted in the case when "inline" is meant for inlining only (like __gnu_inline__ and some other cases). This approach, among other nice properties, ensures that alwaysinline functions are always internal, making it impossible for a direct call to such function to produce an undefined symbol reference. This patch is based on ideas by Chandler Carruth and Richard Smith. llvm-svn: 247465
* Fix a typo and make this test stricter.Adrian Prantl2015-09-111-2/+5
| | | | llvm-svn: 247449
* Use Itanium C++ ABI triple for new modules+debug testReid Kleckner2015-09-111-1/+4
| | | | llvm-svn: 247438
* Module Debugging: Emit forward declarations for types that are defined inAdrian Prantl2015-09-112-0/+98
| | | | | | | | | clang modules, if -dwarf-ext-refs (DebugTypesExtRefs) is specified. This reimplements r247369 in about a third of the amount of code. Thanks to David Blaikie pointing this out in post-commit review! llvm-svn: 247432
* Revert "Module Debugging: Emit forward declarations for types that are ↵Adrian Prantl2015-09-112-106/+0
| | | | | | | | defined in" This reverts commit r247369 to facilitate reviewing of the following patch. llvm-svn: 247431
* clang/test/Modules/ExtDebugInfo.cpp: Use %itanium_abi_triple.NAKAMURA Takumi2015-09-111-0/+3
| | | | llvm-svn: 247397
* clang/test/Modules/ExtDebugInfo.cpp: Use [[@LINE]].NAKAMURA Takumi2015-09-111-1/+1
| | | | llvm-svn: 247396
* Module Debugging: Emit forward declarations for types that are defined inAdrian Prantl2015-09-112-0/+103
| | | | | | clang modules, if -dwarf-ext-refs (DebugTypesExtRefs) is specified. llvm-svn: 247369
* Debug Info: Remove an unnecessary debug type visitor.Adrian Prantl2015-09-101-3/+4
| | | | | | Thanks to dblaikie for spotting this. llvm-svn: 247303
* clang/test/Modules/ModuleDebugInfo.cpp: Add -triple %itanium to appease ↵NAKAMURA Takumi2015-09-081-2/+2
| | | | | | | | ms-targeted builds. I think DebugInfo tests may avoid MS stuff for now. llvm-svn: 247093
* Module Debugging: Emit debug type information into clang ObjC modules.Adrian Prantl2015-09-085-7/+44
| | | | | | | | | | When -fmodule-format is set to "obj", emit debug info for all types declared in a module or referenced by a declaration into the module's object file container. This patch adds support for Objective-C types and methods. llvm-svn: 247068
OpenPOWER on IntegriCloud