summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
* Wrap clang module files in a Mach-O, ELF, or COFF container.Adrian Prantl2015-02-2012-36/+285
| | | | | | | | | | | | | | This is a necessary prerequisite for debugging with modules. The .pcm files become containers that hold the serialized AST which allows us to store debug information in the module file that can be shared by all object files that were built importing the module. rdar://problem/19104245 This reapplies r230044 with a fixed configure+make build and updated dependencies. llvm-svn: 230067
* Don't try to rebuild modules on umbrella header mismatchBen Langmuir2015-02-201-3/+7
| | | | | | | | | | | | | | | There are two issues here: 1) It's too late to rebuild at this point, because we won't go through removeModules and when we try to reload the new .pcm we'll get the old one instead. We might be able to call removeModules after an OutOfDate here, but I'm not yet confident that it is always safe to do so. 2) In practice, this check fails spuriously when the umbrella header appears to change because of a VFS change that means it maps to a different copy of the same file. Because of this, we just skip the check for now. llvm-svn: 230064
* Fix merging of << at end of input.Jacques Pienaar2015-02-201-20/+13
| | | | | | Commit of review http://reviews.llvm.org/D7766 llvm-svn: 230061
* Implement Control Flow Integrity for virtual calls.Peter Collingbourne2015-02-2010-8/+150
| | | | | | | | | | | | | | | This patch introduces the -fsanitize=cfi-vptr flag, which enables a control flow integrity scheme that checks that virtual calls take place using a vptr of the correct dynamic type. More details in the new docs/ControlFlowIntegrity.rst file. It also introduces the -fsanitize=cfi flag, which is currently a synonym for -fsanitize=cfi-vptr, but will eventually cover all CFI checks implemented in Clang. Differential Revision: http://reviews.llvm.org/D7424 llvm-svn: 230055
* Revert "Wrap clang module files in a Mach-O, ELF, or COFF container."Adrian Prantl2015-02-2012-285/+36
| | | | | | | | | This reverts commit r230044 while dealing with buildbot breakage. Conflicts: test/Modules/module_container.m llvm-svn: 230052
* Wrap clang module files in a Mach-O, ELF, or COFF container.Adrian Prantl2015-02-2012-36/+285
| | | | | | | | | | | This is a necessary prerequisite for debugging with modules. The .pcm files become containers that hold the serialized AST which allows us to store debug information in the module file that can be shared by all object files that were built importing the module. rdar://problem/19104245 llvm-svn: 230044
* Add -funique-section-names and -fno-unique-section-names options.Rafael Espindola2015-02-203-0/+8
| | | | | | | | | For now -funique-section-names is the default, so no change in default behavior. The total .o size in a build of llvm and clang goes from 241687775 to 230649031 bytes if -fno-unique-section-names is used. llvm-svn: 230031
* clang-format: [js] Support template strings.Daniel Jasper2015-02-202-1/+66
| | | | | | | | | Merge template strings (marked by backticks ``). Do not format any contents of template strings. Patch by Martin Probst. Thank you. llvm-svn: 230011
* Add -fno-implicit-modules.Manuel Klimek2015-02-203-0/+13
| | | | | | | If this flag is set, we error out when a module build is required. This is useful in environments where all required modules are passed via -fmodule-file. llvm-svn: 230006
* PR22435: Correctly implement tiebreaker for reference ordering in functionRichard Smith2015-02-201-158/+47
| | | | | | | template partial ordering rules. This rule applies per pair of types being compared, not per pair of function templates being compared. llvm-svn: 229965
* Add -fno-sized-deallocation option for completeness of fix in r229241 in ↵Larisse Voufo2015-02-202-0/+5
| | | | | | documentation in r229818. llvm-svn: 229950
* [analyzer] RetainCountChecker: don't try to track ivars known to be nil.Jordan Rose2015-02-191-2/+4
| | | | | | | | | | | We expect in general that any nil value has no retain count information associated with it; violating this results in unexpected state unification /later/ when we decide to throw the information away. Unexpectedly caching out can lead to an assertion failure or crash. rdar://problem/19862648 llvm-svn: 229934
* Don't dllexport inline methods when targeting MinGW.Hans Wennborg2015-02-191-2/+2
| | | | | | | | | MinGW neither imports nor exports such methods. The import bit was committed earlier, in r221154, and this takes care of the export part. This also partially fixes PR22591. llvm-svn: 229922
* Add support for analyzing FreeBSD kernel printf extensions.Dimitry Andric2015-02-194-7/+97
| | | | | | | | | | | | This adds a new __freebsd_kprintf__ format string type, which enables checking when used in __attribute__((format(...))) attributes. It can check the FreeBSD kernel specific %b, %D, %r and %y specifiers, using existing diagnostic messages. Also adds test cases for all these specifiers. Differential Revision: http://reviews.llvm.org/D7154 llvm-svn: 229921
* [Objective-C Sema]. Don't warn about use of Fariborz Jahanian2015-02-191-2/+6
| | | | | | | property accessors in @selector not implemented because they will be auto-synthesized. rdar://16607480 llvm-svn: 229919
* Itanium ABI: Pack expansions change the arity of expressions to unknownDavid Majnemer2015-02-191-3/+8
| | | | llvm-svn: 229918
* Avoid using a COMDAT for sized delete on MachOReid Kleckner2015-02-191-2/+3
| | | | llvm-svn: 229915
* Put the implicit weak sized deallocation funciton in C++14 in a comdatReid Kleckner2015-02-191-0/+2
| | | | | | Fixes PR22635. llvm-svn: 229913
* Revert "Mangle the IsSystem bit into the .pcm file name"Ben Langmuir2015-02-194-17/+3
| | | | | | | | While I investigate some possible problems with this patch. This reverts commit r228966 llvm-svn: 229910
* [PCH/Modules] Check that the specific module cache path the PCH was built ↵Argyrios Kyrtzidis2015-02-195-17/+74
| | | | | | | | | | | | with, is the same as the one in the current compiler invocation. If they differ reject the PCH. This protects against the badness occurring from getting modules loaded from different module caches (see crashes). rdar://19889860 llvm-svn: 229909
* CodeGen: Weak reference temporaries belong in a COMDATDavid Majnemer2015-02-191-0/+2
| | | | llvm-svn: 229902
* CodeGen: static constexpr data members should have a linkonce_odr initDavid Majnemer2015-02-191-4/+13
| | | | | | | | | Classes can be defined in multiple translation units. This means that the static constexpr data members should have identical initializers in all translation units. Implement this by giving the reference temporary linkonce_odr linkage. llvm-svn: 229900
* Make the _mm256_insert_epi64 definition more consistentFilipe Cabecinhas2015-02-191-1/+1
| | | | | | | | | Use long long for the epi64 argument, like the other intrinsics. NFC since this is only defined in 64-bit mode, not in 32-bit. Fix suggested by H. J. Lu! llvm-svn: 229886
* clang-format: [js] Support ES6 module exports.Daniel Jasper2015-02-193-7/+24
| | | | | | Patch by Martin Probst, thank you! llvm-svn: 229865
* clang-format: [js] Support ES6 module imports.Daniel Jasper2015-02-194-8/+31
| | | | | | Patch by Martin Probst. llvm-svn: 229863
* clang-format: [js] Do not fall through for JS structural elements.Daniel Jasper2015-02-191-1/+2
| | | | | | Patch by Martin Probst. Thank you. llvm-svn: 229862
* FIX PR 18432, default args, friends & late-parsed members.Nathan Sidwell2015-02-193-5/+21
| | | | | | | | | | | | Sema::MergeCXXFunctionDecl: propagate hasUnparsedDefaultArg to new decl. Parser::HandleMemberFunctionDeclDelays: check hasUnparsedDefaultArg flag. Parser::ParseLexedMethodDeclaration: handle inherited unparsed default arg case. llvm-svn: 229852
* [analyzer] Different handling of alloca().Anton Yartsev2015-02-191-30/+78
| | | | | | | | | | + separate bug report for "Free alloca()" error to be able to customize checkers responsible for this error. + Muted "Free alloca()" error for NewDelete checker that is not responsible for c-allocated memory, turned on for unix.MismatchedDeallocator checker. + RefState for alloca() - to be able to detect usage of zero-allocated memory by upcoming ZeroAllocDereference checker. + AF_Alloca family to handle alloca() consistently - keep proper family in RefState, handle 'alloca' by getCheckIfTracked() facility, etc. + extra tests. llvm-svn: 229850
* Spelling correction.Yaron Keren2015-02-191-1/+1
| | | | llvm-svn: 229839
* Mark DR1948 as implementedDavid Majnemer2015-02-191-3/+3
| | | | llvm-svn: 229827
* CXXNameMangler::mangleUnresolvedPrefix(): Prune an obsolete \param, ↵NAKAMURA Takumi2015-02-191-2/+0
| | | | | | according to r229809. [-Wdocumentation] llvm-svn: 229823
* Itanium ABI: Don't pass nullptr to a bool argumentDavid Majnemer2015-02-191-1/+1
| | | | llvm-svn: 229822
* [MSVC] Improved lookup into dependent/non-dependent bases of dependent classAlexey Bataev2015-02-191-32/+72
| | | | | | | | Patch improves lookup into dependendt bases of dependent class and adds lookup into non-dependent bases. Differential Revision: http://reviews.llvm.org/D7173 llvm-svn: 229817
* Revert adding hostname to module hashBen Langmuir2015-02-191-17/+0
| | | | | | | | | | | | I didn't realize how easily the hostname could change - for example just changing wireless networks seems to prompt it in some cases. Users can always set their own local module cache path to avoid this. This reverts commits r228592, 228594, 228601 and 228613. rdar://19287368 llvm-svn: 229815
* InstrProf: Always emit a coverage region for the condition of an ifJustin Bogner2015-02-191-1/+4
| | | | | | | | When tools like llvm-cov show regions, it's much easier to understand what's happening if the condition of an if shows a counter as well as the body. llvm-svn: 229813
* [Headers] Add tests for _mm256_insert_epi64 and fix its definitionFilipe Cabecinhas2015-02-191-1/+1
| | | | | | | | | | | | | | | | Summary: The definition for _mm256_insert_epi64 was taking an int, which would get truncated before being inserted in the vector. Original patch by Joshua Magee! Reviewers: bruno, craig.topper Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D7179 llvm-svn: 229811
* Itanium ABI: Properly qualify the destructor-nameDavid Majnemer2015-02-191-206/+169
| | | | | | | We didn't have enough qualificaiton before the scope specifier and we had too much qualification in the destructor name itself. llvm-svn: 229809
* Improve our handling of rtti/sanitize=vptr/sanitize=undefinedFilipe Cabecinhas2015-02-193-66/+103
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch removes the huge blob of code that is dealing with rtti/exceptions/sanitizers and replaces it with: A ToolChain function which, for a given set of Args, figures out if rtti should be: - enabled - disabled implicitly - disabled explicitly A change in the way SanitizerArgs figures out what sanitizers to enable (or if it should error out, or warn); And a check for exceptions/rtti interaction inside addExceptionArgs. The RTTIMode algorithm is: - If -mkernel, -fapple-kext, or -fno-rtti are passed, rtti was disabled explicitly; - If -frtti was passed or we're not targetting the PS4, rtti is enabled; - If -fexceptions or -fcxx-exceptions was passed and we're targetting the PS4, rtti was enabled implicitly; - If we're targetting the PS4, rtti is disabled implicitly; - Otherwise, rtti is enabled; Since the only flag needed to pass to -cc1 is -fno-rtti if we want to disable it, there's no problem in saying rtti is enabled if we're compiling C code, so we don't look at the input file type. addExceptionArgs now looks at the RTTIMode and warns that rtti is being enabled implicitly if targetting the PS4 and exceptions are on. It also errors out if, targetting the PS4, -fno-rtti was passed, and exceptions were turned on. SanitizerArgs now errors out if rtti was disabled explicitly and the vptr sanitizer was enabled implicitly, but just turns off vptr if rtti is disabled but -fsanitize=undefined was passed. Also fixed tests, removed duplicate name from addExceptionArgs comment, and added one or two surrounding lines when running clang-format. This changes test/Driver/fsanitize.c to make it not expect a warning when passed -fsanitize=undefined -fno-rtti, but expect vptr to not be on. Removed all users and definition of SanitizerArgs::sanitizesVptr(). Reviewers: samsonov Subscribers: llvm-commits, samsonov, rsmith Differential Revision: http://reviews.llvm.org/D7525 llvm-svn: 229801
* PR22566: a conversion from a floating-point type to bool is a narrowing ↵Richard Smith2015-02-191-7/+13
| | | | | | conversion. llvm-svn: 229792
* Allow errors on use of a private module header to be disabled, to better ↵Richard Smith2015-02-191-3/+3
| | | | | | support incremental transition to modules. llvm-svn: 229788
* clang-format: Space and triple angle braces.Jacques Pienaar2015-02-182-35/+82
| | | | | | Committing patch http://reviews.llvm.org/D6800. llvm-svn: 229783
* InstrProf: Rewrite most of coverage mapping generation in a simpler wayJustin Bogner2015-02-181-660/+516
| | | | | | | | | | | | | | | | | | | | | | | The coverage mapping generation code previously generated a large number of redundant coverage regions and then tried to merge similar ones back together. This then relied on some awkward heuristics to prevent combining of regions that were importantly different but happened to have the same count. The end result was inefficient and hard to follow. Now, we more carefully create the regions we actually want. This makes it much easier to create regions at precise locations as well as making the basic approach quite a bit easier to follow. There's still a fair bit of complexity here dealing with included code and macro expansions, but that's pretty hard to avoid without significantly reducing the quality of data we provide. I had to modify quite a few tests where the source ranges became more precise or the old ranges seemed to be wrong anyways, and I've added quite a few new tests since a large number of constructs didn't seem to be tested before. llvm-svn: 229748
* Itanium ABI: Write a character instead of a string literalDavid Majnemer2015-02-181-1/+1
| | | | | | No functional change intended. llvm-svn: 229726
* Itanium ABI: Properly mangle extern "C" template argumentsDavid Majnemer2015-02-181-0/+8
| | | | | | | | | extern "C" declarations should be considered like global declarations for mangling purposes. Differential Revision: http://reviews.llvm.org/D7718 llvm-svn: 229724
* Driver: Fix use of dangling std::string temporaryBenjamin Kramer2015-02-181-1/+2
| | | | | | | | | | | What's going on here is that the ternary operator produces a std::string rvalue that the StringRef points to. I'd hoped bugs like this were a thing of the past with our asan testing but apparently this code path is only used when LLVM is configured with a custom --with-c-include-dirs setting. Unbreaks bootstrapping with GCC5 on Fedora (PR22625), patch by Jonathan Wakely! llvm-svn: 229719
* Sema: Allow 'constexpr' variables in range loopsMeador Inge2015-02-181-2/+0
| | | | | | | | This fixes PR22492, which is in response to CWG issue #1204. Per the CWG issue 'contexpr' variables are now allowed in for range loops. llvm-svn: 229716
* clang-format: [JS] support AtScript style annotations for JS.Daniel Jasper2015-02-181-1/+7
| | | | | | | | Based on Java annotation support and style. Patch by Martin Probst. llvm-svn: 229703
* clang-format: [JS] Support classes.Daniel Jasper2015-02-182-4/+10
| | | | | | | | | | This adds support for JavaScript class definitions (again following TypeScript & AtScript style). This only required support for visibility modifiers in JS, everything else was already working. Patch by Martin Probst, thank you. llvm-svn: 229701
* clang-format: [JS] Support type annotations.Daniel Jasper2015-02-182-7/+16
| | | | | | | | | | This patch adds support for type annotations that follow TypeScript's, Flow's, and AtScript's syntax style. Patch by Martin Probst, thank you. Review: http://reviews.llvm.org/D7721 llvm-svn: 229700
* Change representation of member function pointers for MIPS targetsZoran Jovanovic2015-02-185-1/+10
| | | | | | Differential Revision: http://reviews.llvm.org/D7148 llvm-svn: 229680
OpenPOWER on IntegriCloud