summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
* Lex: Don't call getIdentifierInfo on annotation tokensDavid Majnemer2015-03-181-1/+1
| | | | | | | | These calls are usually guarded by checks for isAnnotation() but it looks like we missed a spot. This would cause the included test to crash clang. llvm-svn: 232616
* MS ABI: Define _HAS_CHAR16_T_LANGUAGE_SUPPORT when appropriateDavid Majnemer2015-03-181-0/+3
| | | | | | | If we are in MSVC 2015 compatibility mode and C++11 language conformance is enabled, define _HAS_CHAR16_T_LANGUAGE_SUPPORT to 1. llvm-svn: 232615
* MSVC Compat: Permit char16_t, char32_t and _Atomic when targeting > 2013David Majnemer2015-03-181-3/+4
| | | | | | | | We disabled support for _Atomic because the STL had name conflicts, they've been resolved in 2015. Similarly, reenable char16_t and char32_t. llvm-svn: 232611
* [OPENMP] Fix crash on code emitting if errors are found.Alexey Bataev2015-03-183-0/+7
| | | | | | | Codegen for threadprivate variables (and in some other cases) may cause crash of the compiler if some diagnostic is produced later. This happens because some of the autogenerated globals are not removed from InternalVars StringMap when llvm::Module is reset. Differential Revision: http://reviews.llvm.org/D8360 llvm-svn: 232610
* MS ABI: Empty pack expansions had their mangling changed in 2013->2015David Majnemer2015-03-181-1/+5
| | | | | | | | | | We used to support the 2013 mangling and changed it to the more reasonable 2015 mangling. Let's make the mangling conditional on what version of MSVC is targeted. This fixes PR21888. llvm-svn: 232609
* Make module files passed to a module build via -fmodule-file= available toRichard Smith2015-03-184-9/+66
| | | | | | | | | consumers of that module. Previously, such a file would only be available if the module happened to actually import something from that module. llvm-svn: 232583
* Fix the LLVM type used when lowering initializer list reference temporaries ↵Nick Lewycky2015-03-181-2/+5
| | | | | | to global variables. Reapplies r232454 with fix for PR22940. llvm-svn: 232579
* Basic: Update clang to reflect changes made to LLVM datalayoutDavid Majnemer2015-03-171-7/+9
| | | | | | | We now give x86-64 COFF targets a different mangling code, update clang to use it. llvm-svn: 232571
* Fix a crash when the size of an 'auto' is needed and its initalizerKaelyn Takata2015-03-171-0/+14
| | | | | | | | contained a typo correction (the auto decl was being marked as dependent unnecessarily, which triggered an assertion in cases where the size of the type is needed). llvm-svn: 232568
* MS ABI: Fix a couple of -Winconsistent-missing-override warningsJustin Bogner2015-03-172-3/+3
| | | | llvm-svn: 232559
* Imply linker arguments from '-fveclib' option.Michael Zolotukhin2015-03-171-0/+10
| | | | | | | | | | Summary: As discussed in D8097, we should provide corresponding linking flags when 'fveclib' is specified. Reviewers: hfinkel Differential Revision: http://reviews.llvm.org/D8362 llvm-svn: 232556
* MS ABI: Build C++ default argument exprs for exported template classesReid Kleckner2015-03-174-4/+11
| | | | | | This was an omission from r232229. llvm-svn: 232554
* MS ABI: Emit HandlerMap entries for C++ catchDavid Majnemer2015-03-177-12/+85
| | | | | | | | | | | | | The HandlerMap describes, to the runtime, what sort of catches surround the try. In principle, this structure has to be emitted by the backend because only it knows the layout of the stack (the runtime needs to know where on the stack the destination of a copy lives, etc.) but there is some C++ specific information that the backend can't reason about. Stick this information in special LLVM globals with the relevant "const", "volatile", "reference" info mangled into the name. llvm-svn: 232538
* WIPDavid Majnemer2015-03-176-23/+30
| | | | llvm-svn: 232537
* Add fveclib option.Michael Zolotukhin2015-03-173-0/+20
| | | | | Review: http://reviews.llvm.org/D8097 llvm-svn: 232533
* MS ABI: Delay default constructor closure checking until the outermost class ↵Reid Kleckner2015-03-174-27/+45
| | | | | | | | | | | | | | | | | scope ends Previously, we would error out on this code because the default argument wasn't parsed until the end of Outer: struct __declspec(dllexport) Outer { struct __declspec(dllexport) Inner { Inner(void *p = 0); }; }; Now we do the checking on the closing brace of Outer instead of Inner. llvm-svn: 232519
* Comment parsing: move a diagnostic to the correct group.Dmitri Gribenko2015-03-171-2/+5
| | | | | | Based on a patch by LE GARREC Vincent. llvm-svn: 232511
* Revert r232454 and r232456: "Fix the LLVM type used when lowering ↵Hans Wennborg2015-03-171-5/+2
| | | | | | | | initializer list reference temporaries to global variables." This caused PR22940. llvm-svn: 232496
* [ARM] Add support for ARMV6K subtarget (Clang)Renato Golin2015-03-172-5/+7
| | | | | | | | | | | | | | | | | | | | | ARMv6K is another layer between ARMV6 and ARMV6T2. This is the Clang side of the changes. ARMV6 family LLVM implementation. +-------------------------------------+ | ARMV6 | +----------------+--------------------+ | ARMV6M (thumb) | ARMV6K (arm,thumb) | <- From ARMV6K and ARMV6M processors +----------------+--------------------+ have support for hint instructions | ARMV6T2 (arm,thumb,thumb2) | (SEV/WFE/WFI/NOP/YIELD). They can +-------------------------------------+ be either real or default to NOP. | ARMV7 (arm,thumb,thumb2) | The two processors also use +-------------------------------------+ different encoding for them. Patch by Vinicius Tinti. llvm-svn: 232469
* Teach Twine to support SmallString.Yaron Keren2015-03-171-10/+7
| | | | | | | | Enable removing .str() member calls for these frequent cases. http://reviews.llvm.org/D6372 llvm-svn: 232465
* [modules] Fix bug where an anonymous namespace could cause the containingRichard Smith2015-03-171-9/+18
| | | | | | | | | | | | | | | | namespace to not merge properly. We have an invariant here: after a declaration reads its canonical declaration, it can assume the canonical declaration is fully merged. This invariant can be violated if deserializing some declaration triggers the deserialization of a later declaration, because that later declaration can in turn deserialize a redeclaration of that first declaration before it is fully merged. The anonymous namespace for a namespace gets stored with the first declaration of that namespace, which may be before its parent namespace, so defer loading it until after we've finished merging the surrounding namespace. llvm-svn: 232455
* Fix the LLVM type used when lowering initializer list reference temporaries ↵Nick Lewycky2015-03-171-2/+5
| | | | | | to global variables. llvm-svn: 232454
* GCOV: Expose the -coverage-exit-block-before-body flag in clang -cc1Justin Bogner2015-03-162-0/+3
| | | | | | | | | This exposes the optional exit block placement logic from r232438 as a clang -cc1 option. There is a test on the llvm side, but there isn't really a way to inspect the gcov options from clang to test it here as well. llvm-svn: 232439
* Take the non-reference type when constructing a dummy expression.Richard Trieu2015-03-161-2/+2
| | | | | | Otherwise, Expr will assert during construction with a reference type. llvm-svn: 232425
* [modules] If we find more formerly-canonical declarations of an entity whileRichard Smith2015-03-161-1/+1
| | | | | | | | | | | building its redecl chains, make sure we pull in the redeclarations of those canonical declarations. It's pretty difficult to reach a situation where we can find more canonical declarations of an entity while building its redecl chains; I think the provided testcase (4 modules and 7 declarations) cannot be reduced further. llvm-svn: 232411
* Lambdaify some helper functions. No functionality change.Richard Smith2015-03-161-33/+27
| | | | llvm-svn: 232407
* Global inline assembler blocks are merged before parsing, so no specificJoerg Sonnenberger2015-03-161-14/+25
| | | | | | | | | | | | | location data is available. If pragma handling wants to look up the position, it finds the LLVM buffer and wants to compare it with the special built-in buffer, failing badly. Extend to the special handling of the built-in buffer to also check for the inline asm buffer. Expect only a single asm buffer. Sort it between the built-in buffers and the normal file buffers. Fixes the assert part of PR 22576. llvm-svn: 232389
* [clang] Replacing asserts with static_asserts where appropriateGabor Horvath2015-03-161-3/+4
| | | | | | | | | | | | | | Summary: This patch consists of the suggestions of clang-tidy/misc-static-assert check. Reviewers: alexfh Subscribers: dblaikie, xazax.hun, cfe-commits Differential Revision: http://reviews.llvm.org/D8344 Patch by Szabolcs Sipos! llvm-svn: 232367
* [OPENMP] Enable codegen of the ‘private’ clause for ‘omp simd’ directiveAlexander Musman2015-03-161-3/+7
| | | | llvm-svn: 232353
* Implement PreprocessingRecord's and LazyVector's iterators on top of ↵Benjamin Kramer2015-03-151-1/+1
| | | | | | | | | | | | | iterator_adaptor_base This basically creates a wrapper around an 'int' that poses as an iterator. While that looks a bit counter-intuitive it works just fine because iterator operations and basic integer arithmetic works in exactly the same way. Remove the manual integer wrapping code and reduce the reliance on iterator internals in the implementation. No functionality change intended. llvm-svn: 232322
* clang-format: [JS] support cast syntax and type arguments.Daniel Jasper2015-03-151-0/+7
| | | | | | | | | Casts in TS syntax (foo = <type>bar;) should not be followed by whitespace. Patch by Martin Probst. Thank you. llvm-svn: 232321
* clang-format: [JS] more precisely detect enums.Daniel Jasper2015-03-151-1/+7
| | | | | | | | | | | | The current enum detection is overly aggressive. As NestingLevel only applies per line (?) it classifies many if not most object literals as enum declarations and adds superfluous line breaks into them. This change narrows the heuristic by requiring an assignment just before the open brace and requiring the line to start with an identifier. Patch by Martin Probst. Thank you. llvm-svn: 232320
* MS ABI: Don't use qualified pointee types for 'catch' EH TypeDescriptorsDavid Majnemer2015-03-154-32/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Qualifiers are located next to the TypeDescriptor in order to properly ensure that a pointer type can only be caught by a more qualified catch handler. This means that a catch handler of type 'const int *' requires an RTTI object for 'int *'. We got this correct for 'throw' but not for 'catch'. N.B. We don't currently have the means to store the qualifiers because LLVM's EH strategy is tailored to the Itanium scheme. The Itanium ABI stores qualifiers inside the type descriptor in such a way that the manner of qualification is stored in addition to the pointee type's descriptor. Perhaps the best way of modeling this for the MS ABI is using an aggregate type to bundle the qualifiers with the descriptor? This is tricky because we want to make it clear to the optimization passes which catch handlers invalidate other handlers. My current thoughts on a design for this is along the lines of: { { TypeDescriptor* TD, i32 QualifierFlags }, i32 MiscFlags } The idea is that the inner most aggregate is all that is needed to communicate that one catch handler might supercede another. The 'MiscFlags' field would be used to hold the bitpattern for the notion that the 'catch' handler does not need to invoke a copy-constructor because we are catching by reference. llvm-svn: 232318
* -Wempty-body: fix false negative triggered by macrosDmitri Gribenko2015-03-151-1/+1
| | | | | | | | | | | | | When if statement condition ended in a macro: if (ptr == NULL); the check used to consider the definition location of NULL, instead of the current line. Patch by Manasij Mukherjee. llvm-svn: 232295
* MS ABI: Tidy up references to the ASTContextDavid Majnemer2015-03-141-20/+21
| | | | | | | CGCXXABI has a handy getContext() method. Use that instead of explicitly going through the CodeGenModule. llvm-svn: 232289
* CodeGen: Correctly initialize bitfields with non-constant initializersDavid Majnemer2015-03-141-3/+8
| | | | | | | | It is possible to construct an initializer for a bitfield which is not constant. Instead of emitting code to initialize the field before the execution of main, clang would crash. llvm-svn: 232285
* Sort ObjCProtocolDecls with array_pod_sort.Benjamin Kramer2015-03-141-5/+5
| | | | | | The predicate is essentially a string comparison. NFC. llvm-svn: 232264
* [analyzer] Sort path diagnostics with array_pod_sort.Benjamin Kramer2015-03-141-5/+9
| | | | | | | | | | | | | | | They're expensive to compare and we won't sort many of them so std::sort doesn't give any benefits and causes code bloat. Func fact: clang -O3 didn't even bother to inline libc++'s std::sort here. While there validate the predicate a bit harder, the sort is unstable and we don't want to introduce any non-determinism. I had to spell out the function pointer type because GCC 4.7 still fails to convert the lambda to a function pointer :( No intended functionality change. llvm-svn: 232263
* MS ABI: Mangle virtual member pointer thunks with the correct CCDavid Majnemer2015-03-141-1/+1
| | | | | | | | | | Virtual member pointers are implemented using a thunk. We assumed that the calling convention for this thunk was always __thiscall for 32-bit targets and __cdecl for 64-bit targets. However, this is not the case. Mangle in whichever calling convention is appropriate for this member function thunk. llvm-svn: 232254
* [modules] Teach the AST reader to handle the case of importing a moduleChandler Carruth2015-03-143-54/+58
| | | | | | | | | | | | | | | | | | | with a subset of the existing target CPU features or mismatched CPU names. While we can't check that the CPU name used to build the module will end up being able to codegen correctly for the translation unit, we actually check that the imported features are a subset of the existing features. While here, rewrite the code to use std::set_difference and have it diagnose all of the differences found. Test case added which walks the set relationships and ensures we diagnose all the right cases and accept the others. No functional change for implicit modules here, just better diagnostics. llvm-svn: 232248
* Implement bad cast checks using control flow integrity information.Peter Collingbourne2015-03-145-3/+120
| | | | | | | | | | | This scheme checks that pointer and lvalue casts are made to an object of the correct dynamic type; that is, the dynamic type of the object must be a derived class of the pointee type of the cast. The checks are currently only introduced where the class being casted to is a polymorphic class. Differential Revision: http://reviews.llvm.org/D8312 llvm-svn: 232241
* MS ABI: Generate default constructor closuresDavid Majnemer2015-03-135-27/+81
| | | | | | | | | | | | | | | | | | | | The MS ABI utilizes a compiler generated function called the "vector constructor iterator" to construct arrays of objects with non-trivial constructors/destructors. For this to work, the constructor must follow a specific calling convention. A thunk must be created if the default constructor has default arguments, is variadic or is otherwise incompatible. This thunk is called the default constructor closure. N.B. Default constructor closures are only generated if the default constructor is exported because clang itself does not utilize vector constructor iterators. Failing to export the default constructor closure will result in link/load failure if a translation unit compiled with MSVC is on the import side. Differential Revision: http://reviews.llvm.org/D8331 llvm-svn: 232229
* MS ABI: Implement __GetExceptionInfo for std::make_exception_ptrDavid Majnemer2015-03-137-47/+77
| | | | | | | | | std::make_exception_ptr calls std::__GetExceptionInfo in order to figure out how to properly copy the exception object. Differential Revision: http://reviews.llvm.org/D8280 llvm-svn: 232188
* Sema: Replace the SetVector/DenseMap/std::sort combination with a simple ↵Benjamin Kramer2015-03-131-21/+1
| | | | | | | | | | | | std::map This guarantees the order and doesn't increase malloc counts a lot as there are typically very few elements int the map. Provide a little iterator adapter to keep the same interface as we had with the flat sorted list. No functional change intended. llvm-svn: 232173
* When building a module, all headers of submodules can be used.Daniel Jasper2015-03-131-1/+2
| | | | | | This extends r232159. llvm-svn: 232168
* clang-format: Don't corrupt macros with open braces.Daniel Jasper2015-03-131-5/+8
| | | | | | | | | | | | | | | | | | | | | | | | Formatting: #define A { { #define B } } Before: #define A \ { \ { #define B } \ } After: #define A \ { \ { #define B \ } \ } This fixes llvm.org/PR22884. llvm-svn: 232166
* [OPENMP] Additional sema analysis for 'omp atomic[ update]'.Alexey Bataev2015-03-134-8/+237
| | | | | | Adds additional semantic analysis + generation of helper expressions for proper codegen. llvm-svn: 232164
* Make a module "use" also count as use of all its submodulesDaniel Jasper2015-03-131-3/+5
| | | | llvm-svn: 232159
* [OPENMP] Re-factor __kmpc_for_static_init_* routine generation.Alexander Musman2015-03-132-93/+32
| | | | llvm-svn: 232154
* [Modules] Teach Clang to survive ambiguous macros which come from systemChandler Carruth2015-03-131-7/+5
| | | | | | | | | | | | | | | | | | | | | headers even if they arrived when merging non-system modules. The idea of this code is that we don't want to warn the user about macros defined multiple times by their system headers with slightly different definitions. We should have this behavior if either the macro comes from a system module, or the definition within the module comes from a system header. Previously, we would warn on ambiguous macros being merged when they came from a users modules even though they only showed up via system headers. By surviving this we can handle common system header macro differences like differing 'const' qualification of pointers due to some headers predating 'const' being valid in C code, even when those systems headers are pre-built into a system module. Differential Revision: http://reviews.llvm.org/D8310 llvm-svn: 232149
OpenPOWER on IntegriCloud