summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
...
* [modules] Add support for #include_next.Richard Smith2014-10-2015-32/+117
| | | | | | | | | | | | #include_next interacts poorly with modules: it depends on where in the list of include paths the current file was found. Files covered by module maps are not found in include search paths when building the module (and are not found in include search paths when @importing the module either), so this isn't really meaningful. Instead, we fake up the result that #include_next *should* have given: find the first path that would have resulted in the given file being picked, and search from there onwards. llvm-svn: 220177
* CodeGen: ConstStructBuilder must verify packed constraints after paddingDavid Majnemer2014-10-196-25/+62
| | | | | | | | | | | | | | | | | | This reverts commit r220169 which reverted r220153. However, it also contains additional changes: - We may need to add padding *after* we've packed the struct. This occurs when the aligned next field offset is greater than the new field's offset. When this occurs, we make the struct packed. *However*, once packed the next field offset might be less than the new feild's offset. It is in this case that we might further pad the struct. - We would pad structs which were perfectly sized! This behavior is immensely old. This behavior came from blindly subtracting NextFieldOffsetInChars from RecordSize. This doesn't take into account the fact that the struct might have a greater overall alignment than the last field. llvm-svn: 220175
* Preprocessor.h: Suppress a warning in SkipMainFilePreamble. [-Wsign-compare]NAKAMURA Takumi2014-10-191-1/+1
| | | | llvm-svn: 220170
* Revert r220153: "CodeGen: ConstStructBuilder must verify packed constraints ↵Chandler Carruth2014-10-192-21/+9
| | | | | | | | | | after padding" This commit caused two tests in LNT to regress. I'm able to reproduce on any platform and will send reproduction steps to the original commit log. This should restore the LNT bots that have been failing. llvm-svn: 220169
* [complex] Teach the complex math IR gen to emit direct math andChandler Carruth2014-10-192-21/+127
| | | | | | | | | | | | | | | | | | | | | | | | | | a NaN-test prior to the call to the library function. This should automatically make fastmath (including just non-NaNs) able to avoid the expensive libcalls and also open the door to more advanced folding in LLVM based on the rules for complex math. Two important notes to remember: first is that this isn't yet a proper limited range mode, it's still just improving the unlimited range mode. Also, it isn't really perfecet w.r.t. what an unlimited range mode should be doing because it isn't quite handling the flags produced by all the operations in the way desirable for that mode, but then neither is compiler-rt's libcall. When the compiler-rt libcall is improved to carefully manage flags, the code emitted here should be improved correspondingly. And it is still a long-term desirable thing to add a limited range mode to Clang that would be able to use direct math without library calls here. Special thanks to Steve Canon for the careful review on this patch and teaching me about these issues. =D Differential Revision: http://reviews.llvm.org/D5756 llvm-svn: 220167
* clang/test/Layout/itanium-union-bitfield.cpp: Appease i686.NAKAMURA Takumi2014-10-191-3/+2
| | | | llvm-svn: 220166
* [analyzer] Tweak MallocSizeOfChecker to not warn when using sizeof(void*) to ↵Ted Kremenek2014-10-192-0/+30
| | | | | | | | | | | allocate a bunch of any pointer type. This suppresses a common false positive when analyzing libc++. Along the way, introduce some tests to show this checker actually works with C++ static_cast<>. llvm-svn: 220160
* Use the triple's isiOS() method instead of checking the value directly. NFC.Bob Wilson2014-10-191-1/+1
| | | | llvm-svn: 220158
* CodeGen: ConstStructBuilder must verify packed constraints after paddingDavid Majnemer2014-10-192-9/+21
| | | | | | | | | | | | Before, ConstStructBuilder::AppendBytes would check packed constraints prior to padding being added before the field's offset. However, adding this padding might force our struct to be packed. Because we wouldn't check *after* adding padding, ConstStructBuilder would be in an inconsistent state leading to a crash. This fixes PR21300. llvm-svn: 220153
* New round of fixes for "Always compile debuginfo-tests for the host triple"Filipe Cabecinhas2014-10-181-1/+7
| | | | | | | | clang tests were breaking, at least when compiling clang only, from an installed llvm. Make the lit.cfg script deal with the case when we don't have a host_triple available. llvm-svn: 220148
* Use non-member begin/end for a slight readability improvement.Benjamin Kramer2014-10-181-125/+67
| | | | llvm-svn: 220140
* [libclang] If the code-completion point is inside the preamble, adjust the ↵Argyrios Kyrtzidis2014-10-182-0/+13
| | | | | | | | | position at the beginning of the file after the preamble. Otherwise we will not hit the code-completion point. llvm-svn: 220136
* [libclang] Allow code-completion when pointing at the end-of-file.Argyrios Kyrtzidis2014-10-183-15/+22
| | | | llvm-svn: 220135
* PR21305: Typedefs in non-type template parameters in member data pointers.David Blaikie2014-10-182-2/+4
| | | | | | Patch by Stephen Crane! llvm-svn: 220122
* Append the %itanium_abi_host_triple substitution unconditionallyFilipe Cabecinhas2014-10-181-2/+1
| | | | | | We will fail if it's not set, even if we don't substitute. llvm-svn: 220114
* Fix makefile for debuginfo-tests execution.Filipe Cabecinhas2014-10-171-0/+1
| | | | llvm-svn: 220112
* SemaDeclCXX.cpp: UninitializedFieldVisitor: Avoid member initializers to ↵NAKAMURA Takumi2014-10-171-4/+5
| | | | | | appease msc17. llvm-svn: 220111
* Fix typo in comment.Nick Lewycky2014-10-171-1/+1
| | | | llvm-svn: 220098
* [ASan] Improve blacklisting of global variables.Alexey Samsonov2014-10-179-44/+78
| | | | | | | | | | | | | | | | | | | | | | | | | This commit changes the way we blacklist global variables in ASan. Now the global is excluded from instrumentation (either regular bounds checking, or initialization-order checking) if: 1) Global is explicitly blacklisted by its mangled name. This part is left unchanged. 2) SourceLocation of a global is in blacklisted source file. This changes the old behavior, where instead of looking at the SourceLocation of a variable we simply considered llvm::Module identifier. This was wrong, as identifier may not correspond to the file name, and we incorrectly disabled instrumentation for globals coming from #include'd files. 3) Global is blacklisted by type. Now we build the type of a global variable using Clang machinery (QualType::getAsString()), instead of llvm::StructType::getName(). After this commit, the active users of ASan blacklist files may have to revisit them (this is a backwards-incompatible change). llvm-svn: 220097
* fix -fsanitize-address-field-padding for the cases with virtual base classesKostya Serebryany2014-10-172-3/+27
| | | | | | | | | | | | | | | | Summary: Correctly compute the non-virtual size of a class. Test Plan: Build SPEC 2016 with -fsanitize-address-field-padding Reviewers: rsmith Reviewed By: rsmith Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D5848 llvm-svn: 220089
* Fix the rest of PR21289: a pack expansion that we can't expand yet makes aRichard Smith2014-10-173-36/+30
| | | | | | | template specialization type dependent, even if it has no dependent template arguments. I've filed a corresponding bug against the C++ standard. llvm-svn: 220088
* Add support for initializer lists on field initializers for -WuninitializedRichard Trieu2014-10-172-13/+199
| | | | llvm-svn: 220087
* Try to fix parse-progname.c test on DarwinHans Wennborg2014-10-171-5/+7
| | | | llvm-svn: 220086
* Don't forget to substitute into the qualifier when instantiating the definitionRichard Smith2014-10-172-19/+59
| | | | | | | of a member function of a class template that is defined outside the template. This substitution can actually fail in some weird cases. llvm-svn: 220085
* Move test/CodeGen/sections.c to CodeGenCXX/sections.cppHans Wennborg2014-10-171-5/+2
| | | | | | The test was running with -xc++. Seems it wants to be a C++ file. llvm-svn: 220069
* Rename TemplateArgument::getTypeForDecl to getParamTypeForDecl for clarityDavid Blaikie2014-10-177-15/+12
| | | | | | Code review feedback from Richard Smith on r219900. llvm-svn: 220060
* Sema: address post-commit review commentSaleem Abdulrasool2014-10-171-2/+2
| | | | | | | Hoist the IgnoreParens so that we ignore it around attributes as well in order to future-proof the code. Addresses Richard's comments for SVN r219974. llvm-svn: 220053
* Driver: support detecting driver mode when clang has a version suffix ↵Hans Wennborg2014-10-172-76/+137
| | | | | | | | | | | | | | without dash (PR21094) Clang would previously not get into C++ mode when invoked as 'clang++3.6' (though clang++-3.6 would work). I found the previous loop logic in this function confusing; hopefully this makes it a little clearer. Differential Revision: http://reviews.llvm.org/D5833 llvm-svn: 220052
* clang-format: Prefer breaking before trailing return arrows.Daniel Jasper2014-10-173-2/+5
| | | | | | | | | | | | Before: auto SomeFunction( A aaaaaaaaaaaaaaaaaaaaa) const -> decltype(f(aaaaaaaaaaaaaaaaaaaaa)) {} After: auto SomeFunction(A aaaaaaaaaaaaaaaaaaaaa) const -> decltype(f(aaaaaaaaaaaaaaaaaaaaa)) {} llvm-svn: 220043
* clang-format: [Java] Don't break immediately after "throws".Daniel Jasper2014-10-172-6/+11
| | | | | | | | | | | | Before: public void doSooooooooooooooooooooooooooomething() throws LooooooooooooooooooooooooooooongException {} After: public void doSooooooooooooooooooooooooooomething() throws LooooooooooooooooooooooooooooongException {} llvm-svn: 220041
* Revert r219977, "Re-commit r217995 and follow-up patches (r217997, r218011, ↵NAKAMURA Takumi2014-10-1715-422/+241
| | | | | | | | | | | | | r218053). These were" It broke some builders. I guess it'd be reproducible with --vg. Failing Tests (3): Clang :: CXX/except/except.spec/p1.cpp Clang :: SemaTemplate/instantiate-exception-spec-cxx11.cpp Clang :: SemaTemplate/instantiate-exception-spec.cpp llvm-svn: 220038
* Add explicit triple to ↵NAKAMURA Takumi2014-10-171-2/+2
| | | | | | clang/test/CodeGen/sanitize-address-field-padding.cpp, for now. It's incompatible to ms mangling. llvm-svn: 220037
* complex long double support for PowerPCJoerg Sonnenberger2014-10-172-0/+17
| | | | llvm-svn: 220034
* Optimize Type::isStructureOrClassType() by reusing RT->getDecl().Yaron Keren2014-10-171-3/+4
| | | | | | | | | | | RecordType->getDecl() which maps to TagType::getDecl() is not a simple accessor but a loop on redecls in getInterestingTagDecl. isStructureOrClassType() was calling getDecl() three times performing three times the work actually required. It is optimized by calling RT->getDecl() once and reusing the result three times. llvm-svn: 220033
* D5775: The new test case was missing from the preceding commit.Artyom Skrobov2014-10-171-0/+29
| | | | llvm-svn: 220032
* D5775: Fix of assertion failure in case of non-POD unions with bitfields. ↵Artyom Skrobov2014-10-171-4/+14
| | | | | | Patch by Evgeny Astigeevich! llvm-svn: 220031
* User c-tor name to fix the sanitizer testRenato Golin2014-10-171-1/+1
| | | | llvm-svn: 220030
* Trying to fix failing Clang sanitizer test on ARM botsRenato Golin2014-10-171-1/+1
| | | | llvm-svn: 220029
* Towards PR21289: don't lose track of unexpanded parameter packs withRichard Smith2014-10-173-34/+37
| | | | | | | non-dependent types, in CXXScalarValueInitExprs and in the nested-name-specifier or template arguments of a DeclRefExpr in particular. llvm-svn: 220028
* Remove incorrect usage of JoinedOrSeparate.Richard Smith2014-10-172-3/+3
| | | | llvm-svn: 220023
* PR21215: Support -fmodule-map-file being specified multiple times. SupportRichard Smith2014-10-178-22/+39
| | | | | | loading multiple module map files from the same directory. llvm-svn: 220020
* Switch to range-based for loop. No functionality change.Richard Smith2014-10-171-9/+3
| | | | llvm-svn: 220014
* Per comments on PR12350, move DR244 back from 'done' to 'partial' and add ↵Richard Smith2014-10-172-2/+24
| | | | | | tests showing what we get wrong. llvm-svn: 220009
* CodeGen: Kill FillInNullDataMemberPointersDavid Majnemer2014-10-171-106/+3
| | | | | | | It exists to handle the case where base subobjects are character arrays. This never happens. llvm-svn: 220006
* AST: Remove dead code from RecordLayoutBuilderDavid Majnemer2014-10-171-11/+0
| | | | | | No functionality change intended. llvm-svn: 220005
* trying to fix the new test again, this time for the clang-cmake-armv7-a15 botKostya Serebryany2014-10-171-16/+3
| | | | llvm-svn: 220002
* SanitizerBlacklist: blacklist functions by their source location.Alexey Samsonov2014-10-1711-44/+83
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit changes the way we blacklist functions in ASan, TSan, MSan and UBSan. We used to treat function as "blacklisted" and turned off instrumentation in it in two cases: 1) Function is explicitly blacklisted by its mangled name. This part is not changed. 2) Function is located in llvm::Module, whose identifier is contained in the list of blacklisted sources. This is completely wrong, as llvm::Module may not correspond to the actual source file function is defined in. Also, function can be defined in a header, in which case user had to blacklist the .cpp file this header was #include'd into, not the header itself. Such functions could cause other problems - for instance, if the header was included in multiple source files, compiled separately and linked into a single executable, we could end up with both instrumented and non-instrumented version of the same function participating in the same link. After this change we will make blacklisting decision based on the SourceLocation of a function definition. If a function is not explicitly defined in the source file, (for example, the function is compiler-generated and responsible for initialization/destruction of a global variable), then it will be blacklisted if the corresponding global variable is defined in blacklisted source file, and will be instrumented otherwise. After this commit, the active users of blacklist files may have to revisit them. This is a backwards-incompatible change, but I don't think it's possible or makes sense to support the old incorrect behavior. I plan to make similar change for blacklisting GlobalVariables (which is ASan-specific). llvm-svn: 219997
* Appease the buildbots with the special case for non-set variablesFilipe Cabecinhas2014-10-161-1/+2
| | | | llvm-svn: 219994
* Teach SanitizerBlacklist to blacklist by SourceLocation. NFC.Alexey Samsonov2014-10-164-8/+18
| | | | llvm-svn: 219993
* Added %itanium_abi_host_triple to fix debuginfo-tests when clang is a ↵Filipe Cabecinhas2014-10-161-0/+1
| | | | | | cross-compiler by default llvm-svn: 219989
OpenPOWER on IntegriCloud