summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* [modules] Allow the error on importing a C++ module within an extern "C"Richard Smith2015-10-131-6/+9
| | | | | | | | | 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-131-6/+31
| | | | | | | | | | | 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
* Add decayedType and hasDecayedType AST matchersMatthias Gehre2015-10-121-0/+2
| | | | | | | | | | | | Summary: Add decayedType and hasDecayedType AST matchers Reviewers: klimek Subscribers: klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D13639 llvm-svn: 250114
* Parse and ignore #pragma runtime_checks in MS extensions mode (PR25138)Hans Wennborg2015-10-122-1/+9
| | | | | | We already silently ignore the /RTC, which controls the same functionality. llvm-svn: 250099
* Support Debug Info path remappingSaleem Abdulrasool2015-10-124-8/+37
| | | | | | | | | | | | | | | | Add support for the `-fdebug-prefix-map=` option as in GCC. The syntax is `-fdebug-prefix-map=OLD=NEW`. When compiling files from a path beginning with OLD, change the debug info to indicate the path as start with NEW. This is particularly helpful if you are preprocessing in one path and compiling in another (e.g. for a build cluster with distcc). Note that the linearity of the implementation is not as terrible as it may seem. This is normally done once per file with an expectation that the map will be small (1-2) entries, making this roughly linear in the number of input paths. Addresses PR24619. llvm-svn: 250094
* [Sema] Make `&function_with_enable_if_attrs` an errorGeorge Burgess IV2015-10-124-15/+67
| | | | | | | | | | | | | | | | | | This fixes a bug where one can take the address of a conditionally enabled function to drop its enable_if guards. For example: int foo(int a) __attribute__((enable_if(a > 0, ""))); int (*p)(int) = &foo; int result = p(-1); // compilation succeeds; calls foo(-1) Overloading logic has been updated to reflect this change, as well. Functions with enable_if attributes that are always true are still allowed to have their address taken. Differential Revision: http://reviews.llvm.org/D13607 llvm-svn: 250090
* [Sema] Don't emit multiple diags for one errorGeorge Burgess IV2015-10-121-5/+13
| | | | | | | | | Fixed a bug where we'd emit multiple diagnostics if there was a problem taking the address of an overloaded template function. Differential Revision: http://reviews.llvm.org/D13664 llvm-svn: 250078
* [VFS] Let the user decide if they want path normalization.Benjamin Kramer2015-10-121-16/+30
| | | | | | | | | | | | | | This is a more principled version of what I did earlier. Path normalization is generally a good thing, but may break users in strange environments, e. g. using lots of symlinks. Let the user choose and default it to on. This also changes adding a duplicated file into returning an error if the file contents are different instead of an assertion failure. Differential Revision: http://reviews.llvm.org/D13658 llvm-svn: 250060
* [Driver] Remove `else` after `return`Simon Atanasyan2015-10-121-3/+2
| | | | llvm-svn: 250043
* [VFS] Don't try to be heroic with '.' in paths.Benjamin Kramer2015-10-121-8/+11
| | | | | | | Actually the only special path we have to handle is ./foo, the rest is tricky to get right so do the same thing as the existing YAML vfs here. llvm-svn: 250036
* [VFS] remove handling of '..' for now.Benjamin Kramer2015-10-121-2/+2
| | | | | | | | | This can fail badly if we're overlaying a real file system and there are symlinks there. Just keep the path as-is for now. This essentially reverts r249830. llvm-svn: 250021
* [ATTR] Automatic line feed after pragma-like attribute.Alexey Bataev2015-10-121-4/+42
| | | | | | | Automatically insert line feed after pretty printing of all pragma-like attributes + fix printing of pragma-like pragmas on declarations. Differential Revision: http://reviews.llvm.org/D13546 llvm-svn: 250017
* clang-format: Fixed typecast getting put on a separate line from theDaniel Jasper2015-10-121-1/+3
| | | | | | | | | | key in Obj-C dictionary literals This fixes: https://llvm.org/PR22647 Patch by Kent Sutherland. Thank you. llvm-svn: 250010
* clang-format: [JS] handle character classes in regexes.Daniel Jasper2015-10-121-1/+12
| | | | | | | | | Slashes in regular expressions do not need to be escaped and do not terminate the regular expression even without a preceding backslash. Patch by Martin Probst. Thank you. llvm-svn: 250009
* Fix warning caused by r249995George Burgess IV2015-10-111-0/+1
| | | | llvm-svn: 249997
* [Sema] Allow C conversions in C overload logicGeorge Burgess IV2015-10-112-30/+63
| | | | | | | | | | C allows for some implicit conversions that C++ does not, e.g. void* -> char*. This patch teaches clang that these conversions are okay when dealing with overloads in C. Differential Revision: http://reviews.llvm.org/D13604 llvm-svn: 249995
* Keep the IfStmt node even if the condition is invalidOlivier Goffart2015-10-111-17/+11
| | | | | | | This is important to keep the information in IDE or other tools even if the code contains a few errors llvm-svn: 249982
* Fix inference of _Nullable for weak Objective-C properties.Douglas Gregor2015-10-092-11/+9
| | | | | | | | | | | | | | | | | | | | The inference of _Nullable for weak Objective-C properties was broken in several ways: * It was back-patching the type information very late in the process of checking the attributes for an Objective-C property, which is just wrong. * It was using ad hoc checks to try to suppress the warning about missing nullability specifiers (-Wnullability-completeness), which didn't actual work in all cases (rdar://problem/22985457) * It was inferring _Nullable even outside of assumes-nonnull regions, which is wrong. Putting the inference of _Nullable for weak Objective-C properties in the same place as all of the other inference logic fixes all of these ills. llvm-svn: 249896
* [Myriad]: put libstdc++ and libc in the right orderDouglas Katzman2015-10-091-2/+2
| | | | llvm-svn: 249893
* Fix whitespace, 80-column violations, embedded tabs for theEric Christopher2015-10-092-25/+28
| | | | | | TargetInfo class. llvm-svn: 249872
* constify the feature vector going into initFeatureMap as it shouldn'tEric Christopher2015-10-092-27/+33
| | | | | | change the set of features. llvm-svn: 249871
* Amending r249721 to properly handle pathological attribute-related names ↵Aaron Ballman2015-10-091-2/+2
| | | | | | | | like __ and ____. Patch by Adrian Zgorzalek! llvm-svn: 249833
* [VFS] Rename RedirectingFS internals to avoid collisions with public clang ↵Benjamin Kramer2015-10-091-24/+29
| | | | | | | | classes Hopefully fixes the MSVC build. NFC intended. llvm-svn: 249832
* [VFS] Wire up driver VFS through tooling.Benjamin Kramer2015-10-091-4/+5
| | | | | | | | Sadly I don't currently have a way to tests this as the driver is always initialized with the default triple and finding system headers is system specific. llvm-svn: 249831
* [VFS] Just normalize away .. and . in paths for in-memory file systems.Benjamin Kramer2015-10-091-17/+10
| | | | | | This simplifies the code and gets us support for .. for free. llvm-svn: 249830
* [VFS] Wire up multilib toolchain code to the VFS.Benjamin Kramer2015-10-091-10/+13
| | | | | | This lets a VFSified driver actually validate the GCC paths. llvm-svn: 249829
* [VFS] Port tooling to use the in-memory file system.Benjamin Kramer2015-10-091-20/+52
| | | | | | | | | | This means file remappings can now be managed by ClangTool (or a ToolInvocation user) instead of by ToolInvocation itself. The ToolInvocation remapping is still in place so users can migrate. Differential Revision: http://reviews.llvm.org/D13474 llvm-svn: 249815
* [Sema] Add "Ty" suffix to QualType variables for clarity (NFC)Vedant Kumar2015-10-091-5/+5
| | | | llvm-svn: 249801
* Skip NonNull sema checks in unevaluated contexts.Eric Fiselier2015-10-091-1/+2
| | | | | | | | | | | | | | Summary: Currently when a function annotated with __attribute__((nonnull)) is called in an unevaluated context with a null argument a -Wnonnull warning is emitted. This warning seems like a false positive unless the call expression is potentially evaluated. Change this behavior so that the non-null warnings use DiagRuntimeBehavior so they wont emit when they won't be evaluated. Reviewers: majnemer, rsmith Subscribers: mclow.lists, cfe-commits Differential Revision: http://reviews.llvm.org/D13408 llvm-svn: 249787
* Use Triple.isAndroid() where possible.Evgeniy Stepanov2015-10-085-23/+17
| | | | llvm-svn: 249751
* [WinEH] Push cleanupendpad scopes around exceptional cleanupsReid Kleckner2015-10-082-41/+37
| | | | | | | We were only doing this for SEH as a special case. Generalize it to all cleanups. llvm-svn: 249748
* [CodeGen] [CodeGen] Attach function attributes to functions created inAkira Hatanaka2015-10-083-12/+24
| | | | | | | | | | | | | | | | | | CGBlocks.cpp. This commit fixes a bug in clang's code-gen where it creates the following functions but doesn't attach function attributes to them: __copy_helper_block_ __destroy_helper_block_ __Block_byref_object_copy_ __Block_byref_object_dispose_ rdar://problem/20828324 Differential Revision: http://reviews.llvm.org/D13525 llvm-svn: 249735
* Handle sse turning on mmx, but no -mmx not turning off SSE.Eric Christopher2015-10-081-11/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rationale : // sse3 __m128d test_mm_addsub_pd(__m128d A, __m128d B) { return _mm_addsub_pd(A, B); } // mmx void shift(__m64 a, __m64 b, int c) { _mm_slli_pi16(a, c); _mm_slli_pi32(a, c); _mm_slli_si64(a, c); _mm_srli_pi16(a, c); _mm_srli_pi32(a, c); _mm_srli_si64(a, c); _mm_srai_pi16(a, c); _mm_srai_pi32(a, c); } clang -msse3 -mno-mmx file.c -c For this code we should be able to explicitly turn off MMX without affecting the compilation of the SSE3 function and then diagnose and error on compiling the MMX function. This is a preparatory patch to the actual diagnosis code which is coming in a future patch. This sets us up to have the correct information where we need it and verifies that it's being emitted for the backend to handle. llvm-svn: 249733
* Migrate most feature map inclusion to initFeatureMap for the x86 target soEric Christopher2015-10-081-17/+21
| | | | | | | | that we can build up an accurate set of features rather than relying on TargetInfo initialization via handleTargetFeatures to munge the list of features. llvm-svn: 249732
* [CodeGen] Check if the Decl pointer passed is null, and if so, returnAkira Hatanaka2015-10-081-7/+15
| | | | | | | | | | | early. This is needed in a patch I plan to commit later, in which a null Decl pointer is passed to SetLLVMFunctionAttributesForDefinition. Relevant discussion is in http://reviews.llvm.org/D13525. llvm-svn: 249722
* When mapping no_sanitize_* attributes to no_sanitize attributes, handle ↵Aaron Ballman2015-10-081-11/+17
| | | | | | | | GNU-style formatting that involves prefix and suffix underscores. Cleans up other usages of similar functionality. Patch by Adrian Zgorzalek! llvm-svn: 249721
* [clang-cl] Make /EHs turn on C++ EH once againReid Kleckner2015-10-081-4/+0
| | | | | | | | | | | C++ exceptions are still off by default, which is similar to how C++ cleanups are off by default in MSVC. If you use clang instead of clang-cl, exceptions are also still off by default. In the future, when C++ EH is proven to be stable, we may flip the default for that driver to be consistent with other platforms. llvm-svn: 249704
* Simplify DefaultCPU in ARMTargetInfoRenato Golin2015-10-081-19/+11
| | | | | | | | | | | | | | | | | | Simplifying the convoluted CPU handling in ARMTargetInfo. The default base CPU on ARM is ARM7TDMI, arch ARMv4T, and ARMTargetInfo had a different one. This wasn't visible from Clang because the driver selects the defaults and sets the Arch/CPU features directly, but the constructor depended on the CPU, which was never used. This patch corrects the mistake and greatly simplifies how CPU is dealt with (essentially by removing the duplicated DefaultCPU field). Tests updated. llvm-svn: 249699
* CGStmtOpenMP.cpp: Prune redundant \param. [-Wdocumentation]NAKAMURA Takumi2015-10-081-1/+0
| | | | llvm-svn: 249698
* [Myriad]: default the Dwarf version to 2Douglas Katzman2015-10-081-0/+1
| | | | llvm-svn: 249692
* [Driver] Use Twine instead of itostr. NFC.Benjamin Kramer2015-10-081-1/+1
| | | | | | No need to construct temporary std::strings here. llvm-svn: 249676
* [MSVC Compat] Try to treat an implicit, fixed enum as an unfixed enumDavid Majnemer2015-10-082-5/+13
| | | | | | | | | | | | | | | | | | consider the following: enum E *p; enum E { e }; The above snippet is not ANSI C because 'enum E' has not bee defined when we are processing the declaration of 'p'; however, it is a popular extension to make the above work. This would fail using the Microsoft enum semantics because the definition of 'E' would implicitly have a fixed underlying type of 'int' which would trigger diagnostic messages about a mismatch between the declaration and the definition. Instead, treat fixed underlying types as not fixed for the purposes of the diagnostic. llvm-svn: 249674
* [OPENMP 4.1] Codegen for array sections/subscripts in 'reduction' clause.Alexey Bataev2015-10-089-185/+602
| | | | | | OpenMP 4.1 adds support for array sections/subscripts in 'reduction' clause. Patch adds codegen for this feature. llvm-svn: 249672
* [Sema] Tweak incomplete enum types on MSVC ABI targetsDavid Majnemer2015-10-081-2/+4
| | | | | | | | | Enums without an explicit, fixed, underlying type are implicitly given a fixed 'int' type for ABI compatibility with MSVC. However, we can enforce the standard-mandated rules on these types as-if we didn't know this fact if the tag is not part of a definition. llvm-svn: 249667
* Use itostr(), not std::to_string() because of Android.Douglas Katzman2015-10-081-1/+1
| | | | llvm-svn: 249658
* [MSVC Compat] Enable ABI impacting non-conforming behavior independently of ↵David Majnemer2015-10-085-9/+14
| | | | | | | | | | -fms-compatibility No ABI for C++ currently makes it possible to implement the standard 100% perfectly. We wrongly hid some of our compatible behavior behind -fms-compatibility instead of tying it to the compiler ABI. llvm-svn: 249656
* Stop messing with the 'g' group of options in CompilerInvocation.Douglas Katzman2015-10-084-72/+139
| | | | | | | | | | | | | | | | 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
* [WinEH] Remove NewMSEH and enable its behavior by defaultReid Kleckner2015-10-085-77/+44
| | | | | | | Testing has shown that it is at least as reliable as the old landingpad pattern matching code. llvm-svn: 249647
* When pretty-printing a C++11 literal operator, don't insert whitespace betweenRichard Smith2015-10-083-3/+3
| | | | | | | the "" and the suffix; that breaks names such as 'operator""if'. For symmetry, also remove the space between the 'operator' and the '""'. llvm-svn: 249641
* Don't emit exceptional stackrestore cleanups around inalloca functionsReid Kleckner2015-10-082-18/+2
| | | | | | | | The backend restores the stack pointer after recovering from an exception. This is similar to r245879, but it doesn't try to use the normal cleanup mechanism, so hopefully it won't cause the same breakage. llvm-svn: 249640
OpenPOWER on IntegriCloud