Граф коммитов

16475 Коммитов

Автор SHA1 Сообщение Дата
Will Dietz ad95481b27 [ubsan] Add flag to enable recovery from checks when possible.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169114 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-02 19:50:33 +00:00
Simon Atanasyan bda07ace55 [MIPS] Add -mxgot/-mno-xgot command line options
to enable/disable support of GOT larger than 64k.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169098 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-01 18:27:21 +00:00
Eli Bendersky ac5586591a Fix a test that was redefining FileCheck variables while referencing old ones.
In preparation for the FileCheck enhancement to support backreferences.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169090 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-01 13:50:51 +00:00
Joey Gouly 4247d9c396 Switch to using -### as mentioned by chandlerc.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169089 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-01 13:07:22 +00:00
Joey Gouly acb860f8f8 Add -emit-llvm to test/Driver/fsanitize.c to stop this failing on the ARM bot. Approved by d0k.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169088 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-01 12:15:28 +00:00
Eli Friedman 19c8ce0cf5 Try to make the source location information for token pastes a bit more consistent.
Fixes a crash printing diagnostics on the gcc testsuite, and also makes
diagnostic range printing print nicer results for token pastes.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169068 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-01 01:15:54 +00:00
Richard Smith 0565037864 Remove restriction on combining ubsan with asan or tsan. This has worked for a while.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169066 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-01 01:02:45 +00:00
Douglas Gregor 464a01a67c Fix the determination of whether a capture refers to an enclosing
scope when dealing with nested blocks. Fixes <rdar://problem/12778708>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169065 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-01 01:01:09 +00:00
Bill Wendling 6e6330c07a Don't emit a warning with an input/output parameter. We assume the user knows what they're doing here.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169059 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-30 23:46:56 +00:00
Douglas Gregor 5a98f1da0e Fix test for Windows path separators
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169058 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-30 23:40:49 +00:00
Douglas Gregor 14afab36c7 Teach the serialized diagnostic writer to clone() itself, sharing
state so that all of the various clones end up rendering their
diagnostics into the same serialized-diagnostics file. This is
important when we actually want failures during module build to be
reported back to the translation unit that tried to import the
not-yet-built or out-of-date module. <rdar://problem/12565727>


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169057 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-30 23:32:31 +00:00
Bill Wendling e2dbaa9f78 Don't warn if the input size is less than the register size. Also don't warn if
the output size is greater than the register size. No truncation occurs with
those. Reword warning to make it clearer what's the problem is.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169054 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-30 23:18:12 +00:00
Eli Friedman d87de7bdbc Make -Wtautological-constant-out-of-range-compare behave sanely for enums with a signed fixed type.
<rdar://problem/12780159>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169051 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-30 23:09:29 +00:00
Douglas Gregor 6c3254316d When we're emitting a diagnostic with a source location in an imported
module, provide a module import stack similar to what we would get for
an include stack, e.g.,

In module 'DependsOnModule' imported from build-fail-notes.m:4:
In module 'Module' imported from DependsOnModule.framework/Headers/DependsOnModule.h:1:
Inputs/Module.framework/Headers/Module.h:15:12: note: previous definition is here
@interface Module

<rdar://problem/12696425>


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169042 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-30 21:58:49 +00:00
Aaron Ballman fafd101e6b Support for #pragma region/endregion for MSVC compatibility. Patch thanks to pravic!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169028 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-30 19:52:30 +00:00
Douglas Gregor 830ea5b7c7 When an error occurs while building a module on demand, provide "While
building module 'Foo' imported from..." notes (the same we we provide
"In file included from..." notes) in the diagnostic, so that we know
how this module got included in the first place. This is part of
<rdar://problem/12696425>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169021 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-30 18:38:50 +00:00
Eli Friedman ecdc8d3e0f Fix the computation of highlight ranges so we produce something sane when
the beginning and end of the range are in different macro arguments.
PR14399.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168984 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-30 06:19:40 +00:00
Quentin Colombet e5965df287 Add a test case for the new cortex-a5 switch
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168968 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-30 01:34:36 +00:00
Douglas Gregor 463d90986e Keep track of modules that have failed to build. If we encounter an
import of that module elsewhere, don't try to build the module again:
it won't work, and the experience is quite dreadful. We track this
information somewhat globally, shared among all of the related
CompilerInvocations used to build modules on-the-fly, so that a
particular Clang instance will only try to build a given module once.

Fixes <rdar://problem/12552849>.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168961 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-29 23:55:25 +00:00
Eli Friedman db748a380a Fix a small calling-convention bug for x86-32. PR14453.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168959 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-29 23:21:04 +00:00
Alexey Samsonov 4d1a6e41e1 This patch exposes to Clang users three more sanitizers are experimental features of ASan:
1) init-order sanitizer: initialization-order checker.
Status: usable, but may produce false positives w/o proper blacklisting.
2) use-after-return sanitizer
Status: implemented, but heavily understed.
Should be optional, as it significanlty slows program down.
3) use-after-scope sanitizer
Status: in progress.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168950 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-29 22:36:21 +00:00
Eli Bendersky 2ec5f551cc Make the test less sensitive to DWARF emission implementation details.
Note: the ":" goes into the regex because FileCheck wrongly complains about
unbalanced brackets otherwise.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168934 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-29 20:01:14 +00:00
Eric Christopher 6716d9443d Make sure that we put the rest of the sanitizer libraries on the link line
before libstdc++ like we do with ubsan.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168918 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-29 18:51:05 +00:00
Eric Christopher 1fadc0e17a Use newer command line option here.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168908 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-29 18:08:24 +00:00
Eric Christopher 4f000c34db Remove duplicate test run lines.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168907 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-29 18:08:22 +00:00
Rafael Espindola 8b8a09e496 Merge function types in C.
Among other differences, GCC accepts

  typedef int IA[];
  typedef int A10[10];
  static A10 *f(void);
  static IA  *f(void);
  void g(void) {
    (void)sizeof(*f());
  }

but clang used to reject it with:

  invalid application of 'sizeof' to an incomplete type 'IA' (aka 'int []')

The intention of c99's 6.2.7 seems to be that we should use the composite type
and accept as gcc does.

Doing the type merging required some extra fixes:
  * Use the type from the function type in initializations, even if an parameter
    is available.
  * Fix the merging of the noreturn attribute in function types.
  * Make CodeGen  handle the fact that an parameter type can be different from
    the corresponding type in the function type.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168895 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-29 16:09:03 +00:00
Timur Iskhodzhanov 53c61c5c0c [-cxx-abi microsoft] Also spill the argument-back-references context when mangling templates
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168862 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-29 08:58:47 +00:00
Richard Smith 8426890494 Reject uses of __int128 on platforms that don't support it. Also move the ugly
'getPointerWidth(0) >= 64' test to be a method on TargetInfo, ready to be
properly cleaned up.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168856 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-29 05:41:51 +00:00
Eli Friedman a70779f6b9 Fix crash-on-invalid. <rdar://problem/12765391>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168851 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-29 03:13:49 +00:00
Richard Smith afb49189d6 The declaration of a special member can require overload resolution to be
performed, to determine whether that special member is deleted or constexpr.
That overload resolution process can in turn trigger the instantiation of a
template, which can do anything, including triggering the declaration of that
very same special member function. When this happens, do not try to recursively
declare the special member -- that's impossible. Instead, only try to realise
the truth. There is no special member.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168847 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-29 01:34:07 +00:00
Ted Kremenek 9c0466603f Correctly handle IntegralToBool casts in C++ in the static analyzer. Fixes <rdar://problem/12759044>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168843 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-29 00:50:20 +00:00
Chad Rosier 586a061ad9 [driver] -mkernel implies -mstrict-align; don't add the redundant option.
rdar://12771737

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168841 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-29 00:42:06 +00:00
Michael Han 52b501cd72 Implement C++11 [dcl.attr.grammar] p4: If an attribute-specifier-seq appertains to a friend declaration, that declaration shall be a definition.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168826 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-28 23:17:40 +00:00
Fariborz Jahanian b15c8984ea objective-C blocks: Make sure that identical logic is used
in deciding a copy/dispose field is needed in a byref structure
and when generating the copy/dispose helpers. In certain
cases, these fields were being added but no copy/dispose was
being generated. This was uncovered in ARC, but not in MRR.
// rdar://12759433


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168825 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-28 23:12:17 +00:00
Richard Smith a70c3f8738 Per C++11 [except.spec]p2, rvalue references are not permitted in exception specifications.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168824 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-28 22:52:42 +00:00
Richard Smith 21173b1080 PR14388: An array or function type in an exception specification should be
decayed to a pointer type. Patch by WenHan Gu, with a little tweaking and
additional testcases by me.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168822 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-28 22:33:28 +00:00
Manman Ren 060f34d6d1 ABI: comments from Eli on r168820.
rdar://12723368


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168821 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-28 22:29:41 +00:00
Manman Ren f51c61c78e ABI: modify CreateCoercedLoad and CreateCoercedStore to not use load or store of
the original parameter or return type.

Since we do not accurately represent the data fields of a union, we should not
directly load or store a union type.

As an exmple, if we have i8,i8, i32, i32 as one field type and i32,i32 as
another field type, the first field type will be chosen to represent the union.
If we load with the union's type, the 3rd byte and the 4th byte will be skipped.

rdar://12723368


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168820 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-28 22:08:52 +00:00
Richard Smith f641166066 PR13098: If we're instantiating an overloaded binary operator and we could
determine which member function would be the callee from within the template
definition, don't pass that function as a "non-member function" to
CreateOverloadedBinOp. Instead, just rely on it to select the member function
for itself.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168818 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-28 21:47:39 +00:00
Alexey Samsonov 3325b1617f Refactor -fsanitize, -f*-sanitizer arguments parsing. Provide a more careful diagnostic for invalid sets of sanitizers
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168794 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-28 17:34:24 +00:00
Richard Smith 30cddaec99 Teach Lexer::getSpelling about raw string literals. Specifically, if a raw
string literal needs cleaning (because it contains line-splicing in the
encoding prefix or in the ud-suffix), do not clean the section between the
double-quotes -- that's the "raw" bit!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168776 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-28 07:29:00 +00:00
Richard Smith acf796b479 Store on the CXXRecordDecl whether the class has, or would have, a copy
constructor/assignment operator with a const-qualified parameter type. The
prior method for determining this incorrectly used overload resolution.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168775 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-28 06:23:12 +00:00
Richard Smith b8abff66a8 C++ core issue 1344, PR10618: promote "addition of default argument makes this
a special member" diagnostic from warning to error, and fix the cases where it
produced diagnostics with incorrect wording.

We don't support this as an extension, and we ban it even in C++98 mode. This
breaks too much (for instance, the ABI-specified calling convention for a type
can change if it acquires a copy constructor through the addition of a default
argument).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168769 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-28 03:45:24 +00:00
Ted Kremenek 1994e3993e Fix another false positive due to a CXX temporary object appearing in a C initializer.
The stop-gap here is to just drop such objects when processing the InitListExpr.
We still need a better solution.

Fixes <rdar://problem/12755044>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168757 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-28 01:49:01 +00:00
Ted Kremenek bd8a11e224 Provide stop-gap solution to crash reported in PR 14436.
This was also covered by <rdar://problem/12753384>.  The static analyzer
evaluates a CXXConstructExpr within an initializer expression and
RegionStore doesn't know how to handle the resulting CXXTempObjectRegion
that gets created.  We need a better solution than just dropping the
value, but we need to better understand how to implement the right
semantics here.

Thanks to Jordan for his help diagnosing the behavior here.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168741 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-27 23:05:37 +00:00
Fariborz Jahanian 82c458ea76 objective-C arc: load of a __weak object happens via call to
objc_loadWeak. This retains and autorelease the weakly-refereced
object. This hidden autorelease sometimes makes __weak variable alive even
after the weak reference is erased, because the object is still referenced
by an autorelease pool. This patch overcomes this behavior by loading a 
weak object via call to objc_loadWeakRetained(), followng it by objc_release
at appropriate place, thereby removing the hidden autorelease. // rdar://10849570


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168740 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-27 23:02:53 +00:00
Will Dietz b85403658a Add -fsanitize=integer for reporting suspicious integer behaviors.
Introduces new sanitizer "unsigned-integer-overflow".


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168701 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-27 15:01:55 +00:00
Timur Iskhodzhanov 5e7b43ed30 Remove outdated FIXME; should have removed that in r160782
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168698 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-27 12:55:47 +00:00
NAKAMURA Takumi 93308b9aa4 clang/test/lit.cfg: Disable dev-fd-fs on cygwin for now.
open("/dev/fd/1-foobar") fails with EEXIST on cygwin.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168676 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-27 05:25:41 +00:00
Eli Friedman 55f6c336b1 Test for r168674.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168675 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-27 02:58:49 +00:00