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

42888 Коммитов

Автор SHA1 Сообщение Дата
Dmitri Gribenko 151b2ac8c8 warn-documentation.cpp: reorganize tests
Tests are ordered by command in this file.  It is nice to keep it that way.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176445 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-04 19:39:33 +00:00
Fariborz Jahanian 66f6c24146 comment parsing. Missed a case of referring
to original command in diagnostic. // rdar://13066276


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176444 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-04 18:53:41 +00:00
Edwin Vane aec89ac22e hasQualifer() matcher should return false if there's no qualifier
Instead of passing NULL on to sub-matcher, just return false. Updated tests and
regenerated docs.

Author: Tareq A Siraj <tareq.a.siraj@intel.com>


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176441 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-04 17:51:00 +00:00
Tom Stellard fd07591ea5 R600: Use the GPU type to determine the correct DataLayout v2
v2:
  - Add R600_DOUBLE_OPS for RV670
  - s/CPU/GPU/

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176440 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-04 17:40:53 +00:00
Daniel Jasper 1eee6c4269 Format a line if a range in its leading whitespace was selected.
With [] marking the selected range, clang-format invoked on

    [  ]   int a;

Would so far not reformat anything. With this patch, it formats a
line if its leading whitespace is touched.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176435 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-04 13:43:19 +00:00
Manuel Klimek e3a2b81429 Make the tutorial easier to compile by adding in some of the details.
Patch by Béatrice Creusillet.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176434 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-04 11:31:46 +00:00
John McCall 2f8845fa59 Correction to r176432: the bug actually fixed was <rdar://13025708>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176433 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-04 07:35:41 +00:00
John McCall 48f904271e Centralize and refine the __unknown_anytype argument rules
and be sure to apply them whether or not the debugger gave
us a method declaration.

rdar://12565338

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176432 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-04 07:34:02 +00:00
John McCall 0353a7b2df Fix the emission of the copy-initialization of a block capture
from a lambda capture when the capture is not trivially-copyable.

rdar://13295759

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176431 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-04 06:32:36 +00:00
Chandler Carruth 68f94dbbd2 Check for warnings in a bunch of the linker invocations, and add one
with both -static-libgcc and -static on the commandline.

Fix a warning in the latter case due to a backwards short circuiting ||
operator in the driver. No real functionality changed here, just allows
the driver to properly consume -static-libgcc when -static is also
specified.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176429 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-04 02:07:55 +00:00
John McCall 7a534b9413 Perform non-overload placeholder conversions on the operands
to a subscript operator.

rdar://13332183

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176428 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-04 01:30:55 +00:00
Chandler Carruth 0074d38bee Beef up the testing of our 'ld' invocation on linux to cover static
linking. About to fix a bug here and there was no good test case.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176427 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-04 01:27:49 +00:00
Dmitri Gribenko d0d6f64aee Add an idea for a cpp11-migrate tool: TR1 migration
Idea by Marshall Clow.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176423 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-03 17:54:36 +00:00
David Chisnall b00150a17a Remove unused check from test.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176422 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-03 17:50:06 +00:00
Sean Silva 7298c0b14c [docs] Spelling
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176421 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-03 17:07:35 +00:00
David Chisnall 72c1dba494 Improve C11 atomics support:
- Generate atomicrmw operations in most of the cases when it's sensible to do
  so.
- Don't crash in several common cases (and hopefully don't crash in more of
  them).
- Add some better tests.

We now generate significantly better code for things like:
_Atomic(int) x;
...
x++;

On MIPS, this now generates a 4-instruction ll/sc loop, where previously it
generated about 30 instructions in two nested loops.  On x86-64, we generate a
single lock incl, instead of a lock cmpxchgl loop (one instruction instead of
ten).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176420 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-03 16:02:42 +00:00
David Chisnall 5b9f5cc7c4 Default to enabling default-synthesized ivars on all platforms
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176419 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-03 15:36:10 +00:00
Sean Silva e7259ae90d [docs] Use vim code-block instead of console.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176418 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-03 15:17:35 +00:00
Rafael Espindola 65611bf036 Process #pragma weak only after we know the linkage of the function or variable
we are looking at.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176414 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-02 21:41:48 +00:00
Peter Collingbourne b88d9480e0 CommandLineArgumentParser: handle single quotes.
Differential Revision: http://llvm-reviews.chandlerc.com/D482

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176404 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-02 06:00:16 +00:00
Anna Zaks cc5dbdae70 [analyzer] Simple inline defensive checks suppression
Inlining brought a few "null pointer use" false positives, which occur because
the callee defensively checks if a pointer is NULL, whereas the caller knows
that the pointer cannot be NULL in the context of the given call.

This is a first attempt to silence these warnings by tracking the symbolic value
along the execution path in the BugReporter. The new visitor finds the node
in which the symbol was first constrained to NULL. If the node belongs to
a function on the active stack, the warning is reported, otherwise, it is
suppressed.

There are several areas for follow up work, for example:
 - How do we differentiate the cases where the first check is followed by
another one, which does happen on the active stack?

Also, this only silences a fraction of null pointer use warnings. For example, it
does not do anything for the cases where NULL was assigned inside a callee.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176402 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-02 03:20:52 +00:00
Fariborz Jahanian 8536fa14ee Some refactoring in my patch on document
command source fidelity. // rdar://13066276



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176401 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-02 02:39:57 +00:00
Peter Collingbourne 15e05e932c LLVM API changes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176398 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-02 01:20:22 +00:00
Jordan Rose 549a292b54 CMake: -Wno-nested-anon-types for Clang.
In LLVM, -pedantic is not set unless LLVM_ENABLE_PEDANTIC is set.
However, Clang's CMakeLists.txt unilaterally adds -pedantic to the run
line, so we need to disable -Wnested-anon-types explicitly.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176393 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-02 00:49:47 +00:00
Jordan Rose 067e9684ac [analyzer] Update open source checker build to checker-272.
See http://clang-analyzer.llvm.org/release_notes.html for what's new
in this build.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176389 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-01 23:26:05 +00:00
Jordan Rose d764e20189 [analyzer] Special-case bitfields when finding sub-region bindings.
Previously we were assuming that we'd never ask for the sub-region bindings
of a bitfield, since a bitfield cannot have subregions. However,
unification of code paths has made that assumption invalid. While we could
take advantage of this by just checking for the single possible binding,
it's probably better to do the right thing, so that if/when we someday
support unions we'll do the right thing there, too.

This fixes a handful of false positives in analyzing LLVM.

<rdar://problem/13325522>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176388 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-01 23:03:17 +00:00
Fariborz Jahanian c98e9130bc comment parsing. Keep the original command format
in AST for source fidelity and use it in diagnostics 
to refer to the original format. // rdar://13066276


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176387 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-01 22:51:30 +00:00
Stefanus Du Toit fc09336a59 Fix typos: [Dd]iagnosic -> [Dd]iagnostic
These all appear in comments or (ironically) diagnostics output.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176383 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-01 21:41:22 +00:00
Jordan Rose 9abf1b4577 [analyzer] Suppress paths involving a reference whose rvalue is null.
Most map types have an operator[] that inserts a new element if the key
isn't found, then returns a reference to the value slot so that you can
assign into it. However, if the value type is a pointer, it will be
initialized to null. This is usually no problem.

However, if the user /knows/ the map contains a value for a particular key,
they may just use it immediately:

   // From ClangSACheckersEmitter.cpp
   recordGroupMap[group]->Checkers

In this case the analyzer reports a null dereference on the path where the
key is not in the map, even though the user knows that path is impossible
here. They could silence the warning by adding an assertion, but that means
splitting up the expression and introducing a local variable. (Note that
the analyzer has no way of knowing that recordGroupMap[group] will return
the same reference if called twice in a row!)

We already have logic that says a null dereference has a high chance of
being a false positive if the null came from an inlined function. This
patch simply extends that to references whose rvalues are null as well,
silencing several false positives in LLVM.

<rdar://problem/13239854>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176371 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-01 19:45:10 +00:00
Daniel Jasper 516fb31d05 Remove whitespace at end of file.
This fixes the rest of llvm.org/PR15062.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176361 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-01 18:11:39 +00:00
Daniel Jasper 8a5d7cd100 Correctly format arrays of pointers and function types.
Before:
void f(Type(*parameter)[10]) {}
int(*func)(void *);

After:
void f(Type (*parameter)[10]) {}
int (*func)(void *);

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176356 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-01 17:13:29 +00:00
Argyrios Kyrtzidis 9b5b65957c [PCH] Remove building a SmallPtrSet that is not actually used for anything.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176354 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-01 17:01:31 +00:00
Daniel Jasper 248497199b Normal indent for last element of builder-type call.
In builder type call, we indent to the laster function calls.
However, for the last element of such a call, we don't need to do
so, as that normally just wastes space and does not increase
readability.

Before:
aaaaaa->aaaaaa->aaaaaa( // break
                  aaaaaa);
aaaaaaaaaaaaaaaaaaaaa->aaaaaaaaaaaaaaaaaaaaaa
    ->aaaaaaaaaaaaaaaaaaaaaaaaaa(
        aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa);

After:
aaaaaa->aaaaaa->aaaaaa( // break
    aaaaaa);
aaaaaaaaaaaaaaaaaaaaa->aaaaaaaaaaaaaaaaaaaaaa->aaaaaaaaaaaaaaaaaaaaaaaaaa(
    aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa);

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176352 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-01 16:48:32 +00:00
Daniel Jasper 812c045e59 Remove trailing whitespace of line comments.
This fixed llvm.org/PR15378.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176351 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-01 16:45:59 +00:00
Manuel Klimek bc30c71d20 Implements breaking string literals at slashes.
We now break at a slash if we do not find a space to break on.

Also fixes a bug where we would go over the limit when breaking the
second line.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176350 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-01 13:29:19 +00:00
Manuel Klimek af31fd7021 Implement fallback split point for string literals.
If we don't find a natural split point (currently space) in a string
literal protruding over the line, we just split at the last possible
point.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176349 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-01 13:14:08 +00:00
John McCall 2fbe92cc24 Perform the receiver-expression transformations regardless of
whether we already have a method.  Fixes a bug where we were
failing to properly contextually convert a message receiver
during template instantiation.

As a side-effect, we now actually perform correct method lookup
after adjusting a message-send to integral or non-ObjC pointer
types (legal outside of ARC).

rdar://13305374

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176339 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-01 09:20:14 +00:00
John McCall b2381b1c91 Attempt to not place ownership qualifiers on the result type
of block declarators.  Document the rule we use.

Also document the rule that Doug implemented a few weeks ago
which drops ownership qualifiers on function result types.

rdar://10127067

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176336 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-01 07:58:16 +00:00
Anna Zaks df539194a0 [analyzer] Reword FAQ
Reword the FAQ to stress more that the assert should be used only in case
the developer is sure that the issue is a false positive.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176335 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-01 06:38:16 +00:00
Argyrios Kyrtzidis 838a920fda Add one more sanity check in SourceManager::getFileIDLoaded().
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176333 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-01 03:43:33 +00:00
Argyrios Kyrtzidis 8504b7b810 [PCH] Enhance InputFile to also include whether the file is out-of-date.
Previously we would return null for an out-of-date file. This inhibited ASTReader::ReadSLocEntry
from creating a FileID to recover gracefully in such a case.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176332 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-01 03:26:04 +00:00
Argyrios Kyrtzidis 7db4bb9226 In SourceManager::getFileIDLoaded(), add some sanity checks to make sure we don't enter an infinite loop.
rdar://13120919

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176331 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-01 03:26:00 +00:00
John McCall 4a68c7bc86 Restore order to placate test. I had no real reason to switch them.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176328 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-01 01:38:54 +00:00
John McCall ed383135bc Re-use bit from superclass and extract stuff into a local
function.  Serves a patch we're kicking around out-of-tree.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176327 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-01 01:24:35 +00:00
Fariborz Jahanian d1084f6dd1 Fix warning text of my last patch.
// rdar://13158394


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176308 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-28 23:16:39 +00:00
Bill Wendling be9e8bfef6 Add more of the command line options as attribute flags.
These can be easily queried by the back-end.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176304 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-28 22:49:57 +00:00
Fariborz Jahanian ced0e6570a objective-C: clang, following gcc, warns on
use of stand-alone protocol as type and uses
id<proto>. Modify warning to say what compiler 
is doing. // rdar//13158394


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176303 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-28 22:36:31 +00:00
John McCall bd7370a786 Use the actual ABI-determined C calling convention for runtime
calls and declarations.

LLVM has a default CC determined by the target triple.  This is
not always the actual default CC for the ABI we've been asked to
target, and so we sometimes find ourselves annotating all user
functions with an explicit calling convention.  Since these
calling conventions usually agree for the simple set of argument
types passed to most runtime functions, using the LLVM-default CC
in principle has no effect.  However, the LLVM optimizer goes
into histrionics if it sees this kind of formal CC mismatch,
since it has no concept of CC compatibility.  Therefore, if this
module happens to define the "runtime" function, or got LTO'ed
with such a definition, we can miscompile;  so it's quite
important to get this right.

Defining runtime functions locally is quite common in embedded
applications.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176286 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-28 19:01:20 +00:00
Hans Wennborg 280b956c8e ClangFormat.rst: Fix two small typos
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176276 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-28 18:16:24 +00:00
Manuel Klimek 8ddfb0b72d Fix a problem where 'clang' is ambiguous in MSVC builds.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176275 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-28 18:12:44 +00:00