summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
* [SEH] Add 32-bit lowering for SEH __tryReid Kleckner2015-07-019-237/+447
| | | | | | | | | | | | | | | | | | | This re-lands r236052 and adds support for __exception_code(). In 32-bit SEH, the exception code is not available in eax. It is only available in the filter function, and now we arrange to load it and store it into an escaped variable in the parent frame. As a consequence, we have to disable the "catch i8* null" optimization on 32-bit and always generate a filter function. We can re-enable the optimization if we detect an __except block that doesn't use the exception code, but this probably isn't worth optimizing. Reviewers: majnemer Differential Revision: http://reviews.llvm.org/D10852 llvm-svn: 241171
* [DebugInfo] Fix debug info generation for function static variables, ↵Michael Kuperstein2015-07-017-7/+122
| | | | | | | | | | | | | | | typedefs, and records Function static variables, typedefs and records (class, struct or union) declared inside a lexical scope were associated with the function as their parent scope, rather than the lexical scope they are defined or declared in. This fixes PR19238 Patch by: amjad.aboud@intel.com Differential Revision: http://reviews.llvm.org/D9760 llvm-svn: 241154
* [modules] Don't require the 'inline' specifier when merging an inline function;Richard Smith2015-07-012-1/+7
| | | | | | any source of the inline nature is sufficient. llvm-svn: 241146
* [OPENMP 4.0] Initial support for 'omp cancellation point' construct.Alexey Bataev2015-07-0126-32/+446
| | | | | | Add parsing and sema analysis for 'omp cancellation point' directive. llvm-svn: 241145
* Fix a couple of unused variables in no-assertsJustin Bogner2015-07-011-0/+2
| | | | llvm-svn: 241144
* -frewrite-includes: Prefer insert to emplaceJustin Bogner2015-07-011-3/+4
| | | | | | Some bots didn't like r241140. llvm-svn: 241141
* -frewrite-includes: Rework how includes and modules are differentiatedJustin Bogner2015-07-011-39/+50
| | | | | | | | | | | | | | | | | | | | The map of FileChange structs here was storing two disjoint types of information: 1. A pointer to the Module that an #include directive implicitly imported 2. A FileID and FileType for an included file. These would be left uninitialized in the Module case. This change splits these two kinds of information into their own maps, which both simplifies how we access either and avoids the undefined behaviour we were hitting due to the uninitialized fields in the included file case. Mostly NFC, but fixes some errors found by self-host with ubsan. llvm-svn: 241140
* [modules] Before checking whether the controlling macro of a header is defined,Richard Smith2015-07-0111-27/+36
| | | | | | | | | | | update the identifier in case we've imported a definition of the macro (and thus the contents of the header) from a module. Also fold ExternalIdentifierLookup into ExternalPreprocessorSource; it no longer makes sense to keep these separate now that the only user of the former also needs the latter. llvm-svn: 241137
* CodeGen: Do not give local-linkage functions externally available linkage, ↵Peter Collingbourne2015-07-012-1/+2
| | | | | | | | | | | | | | | | even temporarily. When an internal-linkage thunk is code gen'd, CodeGenVTables::emitThunk will first be called with ForVTable=true (which incorrectly set the thunk's linkage to available_externally under the Itanium ABI) and later with ForVTable=false (which reset it to internal). Because we will always see a call with ForVTable=false, this incorrect linkage never ended up in the final IR. However, the temporary presence of this linkage caused us to give such functions a comdat as a result of code introduced in r241102. To avoid this, check that the thunk is externally visible before giving it available_externally linkage. llvm-svn: 241136
* [modules] Make the include guard optimization fire a bit more when consideringRichard Smith2015-07-013-4/+9
| | | | | | | | | | | re-entering a modular header. When we do the include guard check, we're in the visibility state for the file with the #include; the include guard may not be visible there, but we don't actually need it to be: if we've already parsed the submodule we're considering entering, it's always safe to skip it. llvm-svn: 241135
* Use a stable sort to guarantee target feature ordering in the IREric Christopher2015-07-014-7/+8
| | | | | | | in order to make testing somewhat more feasible. Has the advantage of making it easier to find target features as well. llvm-svn: 241134
* CodeGen: Resize LifetimeExtendedCleanupHeader to avoid alignment issuesJustin Bogner2015-07-011-4/+6
| | | | | | | | | | | | | The LifetimeExtendedCleanupHeader is carefully fit into 32 bytes, meaning that cleanups on the LifetimeExtendedCleanupStack are *always* allocated at a misaligned address and cause undefined behaviour. There are two ways to solve this - add padding after the header when we allocated our cleanups, or just simplify the header and let it use 64 bits in the first place. I've opted for the latter, and added a static assert to avoid the issue in the future. llvm-svn: 241133
* [Sema] Don't crash when deduction fails for decltype(auto)David Majnemer2015-07-012-0/+6
| | | | | | | | | We didn't check the return result of BuildDecltypeType, resulting in us crashing when we tried to grab the canonical version of the type. This fixes PR23995. llvm-svn: 241131
* Fix sse4 for target attribute feature additions.Eric Christopher2015-07-012-1/+17
| | | | | | | | | | This reinstates part of the hack removed in r233223, by special casing sse4 as part of the feature additions. The notable change here is that we consider it only as part of setting the SSE level and not as part of the actual target features set which handles setting the rest of the masks. llvm-svn: 241130
* Fix a TODO dealing with canonicalizing attributes on functions byEric Christopher2015-07-013-12/+24
| | | | | | | | using a string map to canonicalize. Fix up a couple of testcases that needed changing since we are no longer simply appending features to the list, but all of their mask dependencies as well. llvm-svn: 241129
* Fix use-after-free.Peter Collingbourne2015-06-302-5/+9
| | | | llvm-svn: 241121
* [modules] Make sure macros get made visible in the top-level file if we've gotRichard Smith2015-06-305-3/+38
| | | | | | | local submodule visibility enabled; that top-level file might not actually be the module includes buffer if use of prebuilt modules is disabled. llvm-svn: 241120
* [MS ABI] Stick constructor closures in an IR COMDAT groupDavid Majnemer2015-06-302-6/+8
| | | | | | | We no-longer stick linkonce_odr entities in COMDATs in the backend. Instead, we rely on the IR COMDAT mechanism. llvm-svn: 241117
* More range-based-for-loopification. NFCDouglas Katzman2015-06-301-13/+8
| | | | llvm-svn: 241106
* CodeGen: Assign an appropriate comdat to thunks.Peter Collingbourne2015-06-302-12/+10
| | | | | | | | | | | | Previously we were not assigning a comdat to thunks in the Microsoft ABI, which would have required us to emit these functions outside of a comdat. (Due to an inconsistency in how we were emitting objects, we were getting this right most of the time, but only when compiling with function sections.) This code generator change causes us to create a comdat for each thunk. Differential Revision: http://reviews.llvm.org/D10829 llvm-svn: 241102
* Update testcases: DICompileUnits are now created distinct by DIBuilder.Adrian Prantl2015-06-305-6/+6
| | | | llvm-svn: 241098
* Relax this test so it also works on platforms that use characters otherAdrian Prantl2015-06-301-1/+1
| | | | | | than forward slashes as path separators. llvm-svn: 241090
* Use an early exit to improve readability. (NFC)Adrian Prantl2015-06-301-34/+32
| | | | llvm-svn: 241088
* Debug Info: Emit debug info for @import declarations.Adrian Prantl2015-06-306-0/+79
| | | | | | | | | This allows a module-aware debugger such as LLDB to import the currently visible modules before dropping into the expression evaluator. rdar://problem/20965932 llvm-svn: 241084
* Add a function to ExternalASTSource that returns a descriptor thatAdrian Prantl2015-06-306-1/+65
| | | | | | | abstracts the commonalities between modules and PCH files that are needed to emit debug info for a module or precompiled header. llvm-svn: 241083
* [clang-cl] Use /arch: to set the base target CPUReid Kleckner2015-06-302-2/+31
| | | | | | | | | | | | The main effect of this change is that /arch:IA32 will use i386 as the CPU, while clang-cl will continue to default to pentium4 (aka SSE2 plus the usual other features). /arch:AVX and /arch:AVX2 will also now enable the other features available in sandybridge and haswell respectively, which is consistent with MSDN. llvm-svn: 241077
* [Static Analyzer] Minor improvements to SATest.Gabor Horvath2015-06-302-20/+41
| | | | | | Differential Revision: http://reviews.llvm.org/D10812 llvm-svn: 241073
* [X86] Rename DEFAULT_FN_ATTR macro to __DEFAULT_FN_ATTRMichael Kuperstein2015-06-3033-2013/+2013
| | | | llvm-svn: 241065
* [CONCEPTS] Parsing of concept keywordHubert Tong2015-06-305-1/+67
| | | | | | | | | | | | | | | | | | Summary: This change adds parsing for the concept keyword in a declaration and tracks the location. Diagnostic testing added for invalid use of concept keyword. Reviewers: faisalv, fraggamuffin, rsmith, hubert.reinterpretcast Reviewed By: rsmith, hubert.reinterpretcast Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D10528 Patch by Nathan Wilson! llvm-svn: 241060
* clang-format: Properly parse parenthesis in braced lists.Daniel Jasper2015-06-302-3/+4
| | | | | | | | | | | Among other things, this makes clang-format understand arbitrary blocks embedded in them, such as: SomeFunction({MACRO({ return output; }), b}); where MACRO could e.g. expand to a lambda. llvm-svn: 241059
* [X86] Add missing undef of DEFAULT_FN_ATTRS in FXSR intrinsicsMichael Kuperstein2015-06-301-0/+2
| | | | llvm-svn: 241055
* [X86] Add FXSR intrinsicsMichael Kuperstein2015-06-306-4/+66
| | | | | | | | | Add intrinsics for the FXSR instructions (FXSAVE/FXSAVE64/FXRSTOR/FXRSTOR64) These were previously declared in Intrin.h for MSVC compatibility, but now that we have them implemented, these declarations can be removed. llvm-svn: 241053
* Fix a couple of tests in clang/test to match "x86_thiscallcc" introduced in ↵NAKAMURA Takumi2015-06-302-3/+3
| | | | | | r240971. llvm-svn: 241047
* Unbreak the Visual C++ 2013 build after r241032.Yaron Keren2015-06-301-1/+1
| | | | | | clang\lib\Parse\ParseDeclCXX.cpp(2396): error C3486: a parameter for a lambda cannot have a default argument llvm-svn: 241046
* [CodeGen] Tweak isTriviallyRecursive furtherDavid Majnemer2015-06-302-6/+8
| | | | | | | | | | | | | | | | isTriviallyRecursive is a hack used to bridge a gap between the expectations that source code assumes and the semantics that LLVM IR can provide. Specifically, asm labels on functions are treated as an explicit name for a GlobalObject in Clang but treated like an output-processing step in GCC. Tweak this hack a little further to emit calls to library functions instead of emitting an incorrect definition. The definition in question would have available_externally linkage (this is OK) but result in a call to itself which will either result in an infinite loop or stack overflow. This fixes PR23964. llvm-svn: 241043
* [MS ABI] Workaround corner-case bug in the ABI for operator deleteDavid Majnemer2015-06-302-1/+12
| | | | | | | | | | | | | | | MSVC only genreates array cookies if the class has a destructor. This is problematic when having to call T::operator delete[](void *, size_t) because the second argument's argument is impossible to synthesize correctly if the class has no destructor (because there will be no array cookie). Instead, MSVC passes the size of the class. Do the same, for compatibility, instead of crashing. This fixes PR23990. llvm-svn: 241038
* Sphinx-based clang man pagesAndrew Wilkins2015-06-309-992/+540
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This diff introduces .rst files, Sphinx config, and a CMake target for building clang man pages. This will deprecate the existing .pod- based man page, and will integrate nicely with CMake. This diff does not remove the existing man page; that will be done in a follow-up once packagers have had a chance to react to the change. For now, only clang(1) has been done; others can be added over time by dropping additional files into the docs/CommandGuide directory. The index page for CommandGuide has been copied from LLVM's docs/CommandGuide. The man page itself is mostly the same, with a few minor cosmetic changes. The only major change is the SYNOPSIS section. I was unable to get .rst/Sphinx produce the same style as in the existing man page. Instead, I changed it to match the LLVM tools' relatively simple style. To build the man pages, use the "docs-clang-man" target if building with CMake. Otherwise, use "make -f Makefile.sphinx man". Reviewers: cmatthews, silvas Subscribers: dim, gaeke, beanz, cfe-commits Differential Revision: http://reviews.llvm.org/D10562 llvm-svn: 241037
* Add two missing arguments.Adrian Prantl2015-06-301-0/+2
| | | | | | I forgot to add this file to r241035. llvm-svn: 241036
* Pass HeaderSearchOptions and PreprocessorOptions into CodeGenModule.Adrian Prantl2015-06-307-25/+65
| | | | | | | In order to produce debug info for clang modules CGDebugInfo it needs access to macros passed on the command line and the isysroot. llvm-svn: 241035
* Rework parsing of pure-specifiers. Perform the grammar matching andRichard Smith2015-06-308-72/+90
| | | | | | disambiguation in the parser rather than trying to do it in Sema. llvm-svn: 241032
* PR23942: a pure-specifier's integer literal must be spelled '0'Richard Smith2015-06-292-3/+28
| | | | llvm-svn: 241019
* Add support for the x86 builtin __builtin_cpu_supports.Eric Christopher2015-06-299-0/+174
| | | | | | | | | | | | | | | | | | | | This matches the implementation of the gcc support for the same feature, including checking the values set up by libgcc at runtime. The structure looks like this: unsigned int __cpu_vendor; unsigned int __cpu_type; unsigned int __cpu_subtype; unsigned int __cpu_features[1]; with a set of enums to match various fields that are field out after parsing the output of the cpuid instruction. This also adds a set of errors checking for valid input (and cpu). compiler-rt support for this and the other builtins in this family (__builtin_cpu_init and __builtin_cpu_is) are forthcoming. llvm-svn: 240994
* [CodeGen] Remove atomic sugar from record types in isSafeToConvertDavid Majnemer2015-06-292-7/+25
| | | | | | | | | | We failed to see that we should have deferred the creation of a type which references a type currently under construction because of atomic sugar. This fixes PR23985. llvm-svn: 240989
* More range-based for loops. NFCDouglas Katzman2015-06-291-7/+5
| | | | llvm-svn: 240984
* Comment fixes. NFC.Douglas Katzman2015-06-292-2/+3
| | | | | | | | | - Hexagon options were physically next to to ones that had a preceding comment saying "Double dash options", which they aren't. - The 'ld' tool classes are named Linker, not Link. llvm-svn: 240980
* Fix a test case broken by my previous commit.Douglas Gregor2015-06-291-2/+2
| | | | llvm-svn: 240977
* Make __has_feature(nullability) and __has_extension(nullability) always true.Douglas Gregor2015-06-292-4/+7
| | | | | | | These are _Underbar_capital-prefixed additions to the language that shouldn't depend on language standard. llvm-svn: 240976
* Instantiation of local class members.Serge Pavlov2015-06-294-9/+87
| | | | | | | | | | | | If a function containing a local class is instantiated, instantiate all of local class member, including default arguments and exception specifications. This change fixes PR21332 and thus implements DR1484. Differential Revision: http://reviews.llvm.org/D9990 llvm-svn: 240974
* Account for calling convention specifiers in function definitions in IR test ↵David Blaikie2015-06-2981-366/+366
| | | | | | | | | | | | | cases Several tests wouldn't pass when executed on an armv7a_pc_linux triple due to the non-default arm_aapcs calling convention produced on the function definitions in the IR output. Account for this with the application of a little regex. Patch by Ying Yi. llvm-svn: 240971
* Make __has_extension(assume_nonnull) always true.Douglas Gregor2015-06-292-0/+5
| | | | llvm-svn: 240969
OpenPOWER on IntegriCloud