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

43118 Коммитов

Автор SHA1 Сообщение Дата
Jordan Rose 2110350909 [analyzer] Re-apply "Do part of the work to find shortest bug paths up front".
With the assurance that the trimmed graph does not contain cycles,
this patch is safe (with a few tweaks), and provides the performance
boost it was intended to.

Part of performance work for <rdar://problem/13433687>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177469 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-20 00:35:37 +00:00
Jordan Rose f4cf6b10f8 [analyzer] Break cycles (optionally) when trimming an ExplodedGraph.
Having a trimmed graph with no cycles (a DAG) is much more convenient for
trying to find shortest paths, which is exactly what BugReporter needs to do.

Part of the performance work for <rdar://problem/13433687>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177468 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-20 00:35:31 +00:00
Douglas Gregor 63a726870b <rdar://problem/10796651> Introduce configuration macros into module maps.
Configuration macros are macros that are intended to alter how a
module works, such that we need to build different module variants
for different values of these macros. A module can declare its
configuration macros, in which case we will complain if the definition
of a configation macro on the command line (or lack thereof) differs
from the current preprocessor state at the point where the module is
imported. This should eliminate some surprises when enabling modules,
because "#define CONFIG_MACRO ..." followed by "#include
<module/header.h>" would silently ignore the CONFIG_MACRO setting. At
least it will no longer be silent about it.

Configuration macros are eventually intended to help reduce the number
of module variants that need to be built. When the list of
configuration macros for a module is exhaustive, we only need to
consider the settings for those macros when building/finding the
module, which can help isolate modules for various project-specific -D
flags that should never affect how modules are build (but currently do).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177466 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-20 00:22:05 +00:00
David Blaikie 8a40cc6f9c Simplify/generalize some debug info test cases
Mostly, try to depend on the annotation comments more so these tests are more
legible, brief, and agnostic to schema changes in the future (sure, they're not
agnostic to changes to the comment annotations but since they're easier to read
they should be easier to update if that happens).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177457 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-19 23:10:14 +00:00
Jordan Rose 4d25b51d58 [analyzer] Add an integer version of the Circle tests in uninit-vals.m.
A floating-point version is nice for testing unknown values, but it's
good to be able to check all parts of the structure as well.

Test change only, no functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177455 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-19 23:01:57 +00:00
Anna Zaks 9f3495aeaa [analyzer] Do not believe lazy binding when symbolic region types do not match
This fixes a crash when analyzing LLVM that was exposed by r177220 (modeling of
trivial copy/move assignment operators).

When we look up a lazy binding for “Builder”, we see the direct binding of Loc at offset 0.
Previously, we believed the binding, which led to a crash. Now, we do not believe it as
the types do not match.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177453 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-19 22:38:09 +00:00
Jordan Rose 6e65e1047f [analyzer] Add a test case for diagnostic suppression on a graph with cycles.
(see previous commit)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177449 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-19 22:10:44 +00:00
Jordan Rose 239b6e47d2 Revert "[analyzer] Do part of the work to find shortest bug paths up front."
The whole reason we were doing a BFS in the first place is because an
ExplodedGraph can have cycles. Unfortunately, my removeErrorNode "update"
doesn't work at all if there are cycles.

I'd still like to be able to avoid doing the BFS every time, but I'll come
back to it later.

This reverts r177353 / 481fa5071c203bc8ba4f88d929780f8d0f8837ba.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177448 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-19 22:10:35 +00:00
Chad Rosier c7936c9b2b Test case for r177439 and r177440.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177441 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-19 21:12:57 +00:00
Fariborz Jahanian 5bba867123 Objective-C [qoi]: Provide improved parse diagnostics when
closing rbrace is missing in an ObjC class declaration.
Can do beter than this, but it involves addition of
overhead which will be present in correct code.
// rdar://6854840


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177435 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-19 20:27:40 +00:00
Daniel Jasper c30eb51b63 Fix indentation for case: // comment.
Before:
switch (x) {
case 1:
    // Do amazing stuff
    {
  g();
  f();
}
}

After:
switch (x) {
case 1:
  // Do amazing stuff
  {
    g();
    f();
  }
}

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177420 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-19 18:33:58 +00:00
Adrian Prantl fd44d34ab6 Relax test to allow for attributes on other architectures. Caught by powerpc64-unknown-linux-gnu buildbot.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177419 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-19 18:20:35 +00:00
Alexander Kornienko 052685c170 Split long lines in multi-line comments.
Summary: This is implementation for /* */ comments only.

Reviewers: djasper, klimek

Reviewed By: djasper

CC: cfe-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D547

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177415 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-19 17:41:36 +00:00
Chad Rosier 8eecaaa16e Update test for r177413.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177414 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-19 17:32:36 +00:00
Tobias Grosser 11d6cd318d cindex.py: Handle NULL pointers when parsing translation units
The code inside cindex.py was comparing NULL pointer returned by
clang_parseTranslationUnit and clang_createTranslationUnit with None.
However, as illustrated by the two tests I've added, those conditions
were ineffective which resulted in assert triggering later on.

Instead, a pointer is now treated as a boolean value, a NULL pointer being
False.

Contributed-by: Xavier Deguillard <deguilx@gmail.com>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177408 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-19 15:30:48 +00:00
Rafael Espindola 9a2f5d70df Don't try to set attributes in alias, they have none.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177402 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-19 15:03:47 +00:00
Rafael Espindola d8e6d6da90 Revert r177329.
If this should not happen, we should have an assert.
If it should happen, we should have a test and remove the comment.

In no case should we have this self inconsistent code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177399 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-19 14:32:23 +00:00
Rafael Espindola ccc45d2e93 Go back to using the integrated assembler on windows ever when passed
-no-integrated-as. It is the only assembler we have there.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177398 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-19 14:23:00 +00:00
Alexey Samsonov 7d0d85f388 [ASan] Make -fsanitize=address always imply -fsanitize=init-order
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177391 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-19 10:48:37 +00:00
John McCall 7cca821e1a Add a clarifying note when a return statement is rejected because
we expect a related result type.

rdar://12493140

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177378 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-19 07:04:25 +00:00
Douglas Gregor a5a3e01c50 Remove stray semicolon
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177370 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-19 00:41:04 +00:00
Douglas Gregor ac39f135ea Minor optimization to r177367 to treat a module with missing dependencies as out-of-date rather than missing.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177369 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-19 00:38:50 +00:00
Rafael Espindola c0a55d12ca Finish refactoring the tool selection logic.
The general pattern now is that Foobar::constructTool only creates tools
defined in the tools::foobar namespace and then delegates to the parent.

The remaining duplicated code is now in the tools themselves.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177368 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-19 00:36:57 +00:00
Douglas Gregor 677e15ffee <rdar://problem/13363214> Eliminate race condition between module rebuild and the global module index.
The global module index was querying the file manager for each of the
module files it knows about at load time, to prune out any out-of-date
information. The file manager would then cache the results of the
stat() falls used to find that module file.

Later, the same translation unit could end up trying to import one of the
module files that had previously been ignored by the module cache, but
after some other Clang instance rebuilt the module file to bring it
up-to-date. The stale stat() results in the file manager would
trigger a second rebuild of the already-up-to-date module, causing
failures down the line.

The global module index now lazily resolves its module file references
to actual AST reader module files only after the module file has been
loaded, eliminating the stat-caching race. Moreover, the AST reader
can communicate to its caller that a module file is missing (rather
than simply being out-of-date), allowing us to simplify the
module-loading logic and allowing the compiler to recover if a
dependent module file ends up getting deleted.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177367 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-19 00:28:20 +00:00
Richard Smith aa624954c5 PR15383: When -fsanitize=float-cast-overflow checks a float-to-int conversion,
it wasn't taking into account that the float should be truncated *before* the
range check happens. Thus (unsigned)-0.99 and (unsigned char)255.9 have defined
behavior and should not be trapped.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177362 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-19 00:01:12 +00:00
Rafael Espindola 8a1115f382 Centralize the logic for using the integrated assembler.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177360 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-18 23:56:07 +00:00
Argyrios Kyrtzidis 07c5908fa1 [libclang] Modify clang_getCursorType to be able to handle a function template decl.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177359 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-18 23:54:50 +00:00
Fariborz Jahanian 2aa5cf412c documentation comment parsing. Added couple of
top-level HeaderDoc tags @functiongroup and
@methodgroup to doc. tags recognized.
// rdar://12379114 


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177358 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-18 23:45:52 +00:00
Richard Smith 7132be1ef4 Diagnose uses of 'alignof' on functions in -pedantic mode.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177354 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-18 23:37:25 +00:00
Jordan Rose a5f80b2ea6 [analyzer] Do part of the work to find shortest bug paths up front.
Splitting the graph trimming and the path-finding (r177216) already
recovered quite a bit of performance lost to increased suppression.
We can still do better by also performing the reverse BFS up front
(needed for shortest-path-finding) and only walking the shortest path
for each report. This does mean we have to walk back up the path and
invalidate all the BFS numbers if the report turns out to be invalid,
but it's probably still faster than redoing the full BFS every time.

More performance work for <rdar://problem/13433687>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177353 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-18 23:34:37 +00:00
Jordan Rose 85a92cfa52 [analyzer] Replace uses of assume() with isNull() in BR visitors.
Also, replace a std::string with a SmallString.

No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177352 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-18 23:34:32 +00:00
Chad Rosier 2317dc8842 Test case for r177347.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177349 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-18 23:32:33 +00:00
David Blaikie abc0bea57d PR15539: Record "evaluating if/elif condition" flag in the right place
The previous implementation missed the case where the elif condition was
evaluated from the context of an #ifdef that was false causing PR15539.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177345 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-18 23:22:28 +00:00
Bill Wendling e4d6112a4e Update testcase for r177340.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177344 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-18 23:11:54 +00:00
Argyrios Kyrtzidis 62ba4ba485 [frontend] Initialize the diagnostic client before loading an ast file.
Issue reported by Tom Honermann!
http://llvm.org/bugs/show_bug.cgi?id=15377

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177336 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-18 22:55:24 +00:00
Richard Smith c7f811638f Add missing diagnostic for a nested-name-specifier on a free-standing type definition. Bump some related diagnostics from warning to extension in C++, since they're errors there. Add some missing checks for function specifiers on non-function declarations.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177335 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-18 22:52:47 +00:00
Argyrios Kyrtzidis 0378433dcd [PCH] Fix assertion hit related to enum decls inside templated funtions.
Report and suggested fix by Tom Honermann!
http://llvm.org/bugs/show_bug.cgi?id=13020

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177330 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-18 22:23:49 +00:00
Reed Kotler 4882fe02d8 This code works around what appears to be a bug in another part of clang.
I have filed http://llvm.org/bugs/show_bug.cgi?id=15538 against clang.
This code is safer anyway because "cast" assumes you really know that
it's okay to make the cast. In this case isa should not be false and
dyn_cast should not return null as far as I understand. But everything
else is valid so I did not want to revert my previous patch for attributes
mips16/nomips16 or use an llvm_unreachable here which would make a number
of our tests fail for mips.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177329 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-18 22:18:00 +00:00
Richard Smith f72663fc96 Add a linebreak. Linebreaks are cool.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177325 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-18 21:57:52 +00:00
Richard Smith 71434a891d C++11 status: mark 'extended integral types' as N/A, since we don't support
any, and add a note that we cannot treat __int128 as an extended integral type.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177324 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-18 21:44:56 +00:00
Richard Smith 07b0fdcee8 Bring inheriting constructor implementation up-to-date with current defect
reports, and implement implicit definition of inheriting constructors.
Remaining missing features: inheriting constructor templates, implicit
exception specifications for inheriting constructors, inheriting constructors
from dependent bases.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177320 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-18 21:12:30 +00:00
Rafael Espindola 5b22205939 Centralize the recording of which tools have been constructed.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177319 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-18 20:48:54 +00:00
Anna Zaks 4b94f4daa1 [analyzer] Warn when a ‘nil’ object is added to NSArray or NSMutableArray.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177318 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-18 20:46:56 +00:00
Fariborz Jahanian 51be73daa9 Objective-C modern translator. Don't put line info
into the pre-preprocessed file to be passed to
modern translator when compiling in no debug mode.
// rdar://13138170


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177311 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-18 19:41:18 +00:00
Rafael Espindola f3260565f4 Use early returns when checking if we already constructed a tool and when
delegating to Generic_GCC::SelectTool (it already updates the tool map).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177305 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-18 18:50:01 +00:00
Rafael Espindola 26adbe42d1 Remove unused argument.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177303 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-18 18:19:46 +00:00
Rafael Espindola af370e6e05 Pass an ArgList to every toolchain constructor. Remove the useIntegratedAs
argument.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177301 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-18 18:10:27 +00:00
Rafael Espindola 7ce8d82c41 Inline ShouldUseIntegratedAssembler and move the documentation to
useIntegratedAs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177300 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-18 17:58:22 +00:00
Rafael Espindola 5470cd27e4 Refactor a bit of duplicated code to useIntegratedAs.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177299 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-18 17:52:57 +00:00
Rafael Espindola e5dce30887 Remove unused argument.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177293 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-18 17:25:58 +00:00