Commit Graph

23530 Commits

Author SHA1 Message Date
Evgeny Astigeevich b7bff16a19 Test case B: fixed check rule
llvm-svn: 220272
2014-10-21 08:16:42 +00:00
Evgeny Astigeevich ca5bd8294b Test case B is updated to work for 32-bit and 64-bit platforms
llvm-svn: 220271
2014-10-21 08:01:37 +00:00
Justin Bogner 581a5adfcf Driver: Tighten up crash report tests
These tests were a little bit too flexible in terms of filenames.

llvm-svn: 220265
2014-10-21 05:13:09 +00:00
Alexey Bataev 03b340a3a5 [OPENMP] Codegen for 'private' clause in 'parallel' directive.
This patch generates some helper variables which used as a private copies of the corresponding original variables inside an OpenMP 'parallel' directive. These generated variables are initialized by default (with the default constructor, if any). In outlined function references to original variables are replaced by the references to these private helper variables. At the end of the initialization of the private variables and implicit barier is set by calling __kmpc_barrier(...) runtime function to be sure that all threads were initialized using original values of the variables.
Differential Revision: http://reviews.llvm.org/D4752

llvm-svn: 220262
2014-10-21 03:16:40 +00:00
Jiangning Liu 2bafc2d5ae Remove including <complex.h> in test case, and change to use _Complex instead.
llvm-svn: 220258
2014-10-21 02:19:58 +00:00
Jiangning Liu 444822bbcf Lower compound assignment for the missing type llvm::Type::FP128TyID.
llvm-svn: 220257
2014-10-21 01:34:34 +00:00
Richard Smith ab506adf7d Switch C compilations to C11 by default.
This is long-since overdue, and matches GCC 5.0. This should also be
backwards-compatible, because we already supported all of C11 as an extension
in C99 mode.

llvm-svn: 220244
2014-10-20 23:26:58 +00:00
David Blaikie 1a83db4f5e PR21312: Fix a regression in non-type template parameters of function type that are static member functions.
llvm-svn: 220221
2014-10-20 18:56:54 +00:00
Artyom Skrobov 6701327758 D5823: Fix typo in Clang test arm-cortex-cpus.c; patch by Gabor Ballabas!
llvm-svn: 220201
2014-10-20 13:48:19 +00:00
Evgeny Astigeevich d7c9cf8f8d Commit to test commit access
llvm-svn: 220189
2014-10-20 09:15:05 +00:00
Richard Smith 25d50758f3 [modules] Add support for #include_next.
#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
2014-10-20 00:15:49 +00:00
David Majnemer 8e133965c8 CodeGen: ConstStructBuilder must verify packed constraints after padding
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
2014-10-19 23:40:06 +00:00
Chandler Carruth bf972bb2e0 Revert r220153: "CodeGen: ConstStructBuilder must verify packed constraints 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
2014-10-19 19:41:46 +00:00
Chandler Carruth 0c4b230b32 [complex] Teach the complex math IR gen to emit direct math and
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
2014-10-19 19:13:49 +00:00
NAKAMURA Takumi 25d2496cd2 clang/test/Layout/itanium-union-bitfield.cpp: Appease i686.
llvm-svn: 220166
2014-10-19 18:45:13 +00:00
Ted Kremenek 0c28bc20da [analyzer] Tweak MallocSizeOfChecker to not warn when using sizeof(void*) to 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
2014-10-19 07:30:55 +00:00
David Majnemer afefe97e1c CodeGen: ConstStructBuilder must verify packed constraints after padding
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
2014-10-19 00:03:10 +00:00
Filipe Cabecinhas aa363024a6 New round of fixes for "Always compile debuginfo-tests for the host triple"
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
2014-10-18 23:36:12 +00:00
Argyrios Kyrtzidis ee301f941c [libclang] If the code-completion point is inside the preamble, adjust the position at the beginning of the file after the preamble.
Otherwise we will not hit the code-completion point.

llvm-svn: 220136
2014-10-18 06:23:50 +00:00
Argyrios Kyrtzidis e62d682a27 [libclang] Allow code-completion when pointing at the end-of-file.
llvm-svn: 220135
2014-10-18 06:19:36 +00:00
David Blaikie b5c7e6a71d PR21305: Typedefs in non-type template parameters in member data pointers.
Patch by Stephen Crane!

llvm-svn: 220122
2014-10-18 02:21:26 +00:00
Filipe Cabecinhas 0f5735965d Append the %itanium_abi_host_triple substitution unconditionally
We will fail if it's not set, even if we don't substitute.

llvm-svn: 220114
2014-10-18 00:05:26 +00:00
Filipe Cabecinhas 9b3d7366d4 Fix makefile for debuginfo-tests execution.
llvm-svn: 220112
2014-10-17 23:50:47 +00:00
Alexey Samsonov a0ac3c2bf0 [ASan] Improve blacklisting of global variables.
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
2014-10-17 22:37:33 +00:00
Kostya Serebryany 644492139f fix -fsanitize-address-field-padding for the cases with virtual base classes
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
2014-10-17 21:02:13 +00:00
Richard Smith bc2e971803 Fix the rest of PR21289: a pack expansion that we can't expand yet makes a
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
2014-10-17 20:56:14 +00:00
Richard Trieu fa1d0a7dbf Add support for initializer lists on field initializers for -Wuninitialized
llvm-svn: 220087
2014-10-17 20:56:10 +00:00
Hans Wennborg a6af1e87c8 Try to fix parse-progname.c test on Darwin
llvm-svn: 220086
2014-10-17 20:55:54 +00:00
Richard Smith cc92866e0c Don't forget to substitute into the qualifier when instantiating the definition
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
2014-10-17 20:37:29 +00:00
Hans Wennborg 0b603cc4e9 Move test/CodeGen/sections.c to CodeGenCXX/sections.cpp
The test was running with -xc++. Seems it wants to be a C++ file.

llvm-svn: 220069
2014-10-17 18:13:21 +00:00
Hans Wennborg 1a27e04af9 Driver: support detecting driver mode when clang has a version suffix 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
2014-10-17 17:07:59 +00:00
NAKAMURA Takumi 23224155e1 Revert r219977, "Re-commit r217995 and follow-up patches (r217997, r218011, 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
2014-10-17 12:48:37 +00:00
NAKAMURA Takumi e316722f4d Add explicit triple to clang/test/CodeGen/sanitize-address-field-padding.cpp, for now. It's incompatible to ms mangling.
llvm-svn: 220037
2014-10-17 12:48:01 +00:00
Joerg Sonnenberger aa3e9f5a0f complex long double support for PowerPC
llvm-svn: 220034
2014-10-17 11:51:19 +00:00
Artyom Skrobov 32ba173587 D5775: The new test case was missing from the preceding commit.
llvm-svn: 220032
2014-10-17 10:25:09 +00:00
Renato Golin 031e817630 User c-tor name to fix the sanitizer test
llvm-svn: 220030
2014-10-17 10:09:25 +00:00
Renato Golin de44aec0e6 Trying to fix failing Clang sanitizer test on ARM bots
llvm-svn: 220029
2014-10-17 09:40:21 +00:00
Richard Smith cfaa5a3244 Towards PR21289: don't lose track of unexpanded parameter packs with
non-dependent types, in CXXScalarValueInitExprs and in the
nested-name-specifier or template arguments of a DeclRefExpr in particular.

llvm-svn: 220028
2014-10-17 02:46:42 +00:00
Richard Smith 93a13de304 Remove incorrect usage of JoinedOrSeparate.
llvm-svn: 220023
2014-10-17 01:52:48 +00:00
Richard Smith 9887d79af5 PR21215: Support -fmodule-map-file being specified multiple times. Support
loading multiple module map files from the same directory.

llvm-svn: 220020
2014-10-17 01:42:53 +00:00
Richard Smith 0680d8aa68 Per comments on PR12350, move DR244 back from 'done' to 'partial' and add tests showing what we get wrong.
llvm-svn: 220009
2014-10-17 01:03:17 +00:00
Kostya Serebryany 23387754f8 trying to fix the new test again, this time for the clang-cmake-armv7-a15 bot
llvm-svn: 220002
2014-10-17 00:47:30 +00:00
Alexey Samsonov 1444bb9fc8 SanitizerBlacklist: blacklist functions by their source location.
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
2014-10-17 00:20:19 +00:00
Filipe Cabecinhas 3514242a66 Appease the buildbots with the special case for non-set variables
llvm-svn: 219994
2014-10-16 23:54:26 +00:00
Filipe Cabecinhas e02eca7a42 Added %itanium_abi_host_triple to fix debuginfo-tests when clang is a cross-compiler by default
llvm-svn: 219989
2014-10-16 23:41:40 +00:00
Richard Smith 9c04bce1f1 Re-commit r217995 and follow-up patches (r217997, r218011, r218053). These were
reverted in r218058 because they triggered a rejects-valid bug in MSVC.

Original commit message from r217995:

Instantiate exception specifications when instantiating function types (other
than the type of a function declaration). We previously didn't instantiate
these at all! This also covers the pathological case where the only mention of
a parameter pack is within the exception specification; this gives us a second
way (other than alias templates) to reach the horrible state where a type
contains an unexpanded pack, but its canonical type does not.

llvm-svn: 219977
2014-10-16 23:00:46 +00:00
Saleem Abdulrasool 374b5aa170 Sema: handle additional case of qualified types
A second instance of attributed types escaped the previous change, identified
thanks to Richard Smith!  When deducing the void case, we would also assume that
the type would not be attributed.  Furthermore, properly handle multiple
attributes being applied to a single TypeLoc.

Properly handle this case and future-proof a bit by ignoring parenthesis
further.  The test cases do use the additional parenthesis to ensure that this
case remains properly handled.

Addresses post-commit review comments from Richard Smith to SVN r219851.

llvm-svn: 219974
2014-10-16 22:42:53 +00:00
Hans Wennborg 528c926b3c test/CodeGen/sections.c: add triple
llvm-svn: 219969
2014-10-16 21:36:23 +00:00
Kostya Serebryany 330e9f6c5f trying to fix the new test on hexagon-build
llvm-svn: 219965
2014-10-16 21:22:40 +00:00
Kostya Serebryany 293dc9be6e Insert poisoned paddings between fields in C++ classes so that AddressSanitizer can find intra-object-overflow bugs
Summary:
The general approach is to add extra paddings after every field
in AST/RecordLayoutBuilder.cpp, then add code to CTORs/DTORs that poisons the paddings
(CodeGen/CGClass.cpp).

Everything is done under the flag -fsanitize-address-field-padding. 
The blacklist file (-fsanitize-blacklist) allows to avoid the transformation 
for given classes or source files. 

See also https://code.google.com/p/address-sanitizer/wiki/IntraObjectOverflow

Test Plan: run SPEC2006 and some of the Chromium tests with  -fsanitize-address-field-padding

Reviewers: samsonov, rnk, rsmith

Reviewed By: rsmith

Subscribers: majnemer, cfe-commits

Differential Revision: http://reviews.llvm.org/D5687

llvm-svn: 219961
2014-10-16 20:54:52 +00:00