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

13809 Коммитов

Автор SHA1 Сообщение Дата
Fariborz Jahanian 5bdaef55d4 Objective-C: Tighten the rules when warning
is issused for on overriding 'readwrite'
property which is not auto-synthesized.
Buttom line is that if hueristics determine
that there will be a user implemented setter,
no warning will be issued. // rdar://13388503


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177662 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-21 20:50:53 +00:00
Bob Wilson 222b4eacd6 Fix a typo.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177626 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-21 06:09:09 +00:00
Douglas Gregor cdf2808c4e <rdar://problem/13037793> Allow the names of modules to differ from the name of their subdirectory in the include path.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177621 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-21 01:08:50 +00:00
James Dennett 81ba9d1160 Documentation cleanup for MacroInfo.
* Clarify what MacroInfo::isBuiltinMacro means, as it really means something
  more like "isMagicalMacro" or "requiresProcessingBeforeExpansion" -- the
  macros defined in "<built-in>" are not considered built-in by this function;
* Escape __LINE__ as \__LINE__ in Doxygen comments so that the underscores
  don't get replaced by *bold* output;
* Turn comments in MacroInfo.cpp into non-Doxygen comments, so that they
  don't result in duplicated/badly formatted Doxygen output;
* Clean up a bunch of \brief formatting, and add a \file comment for
  MacroInfo.h.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177581 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-20 21:30:03 +00:00
Douglas Gregor 906d66acc5 <rdar://problem/12368093> Extend module maps with a 'conflict' declaration, and warn when a newly-imported module conflicts with an already-imported module.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177577 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-20 21:10:35 +00:00
Jordan Rose f8ddc09898 [analyzer] Invalidate regions indirectly accessible through const pointers.
In this case, the value of 'x' may be changed after the call to indirectAccess:

  struct Wrapper {
    int *ptr;
  };

  void indirectAccess(const Wrapper &w);

  void test() {
    int x = 42;
    Wrapper w = { x };

    clang_analyzer_eval(x == 42); // TRUE
    indirectAccess(w);
    clang_analyzer_eval(x == 42); // UNKNOWN
  }

This is important for modelling return-by-value objects in C++, to show
that the contents of the struct are escaping in the return copy-constructor.

<rdar://problem/13239826>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177570 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-20 20:35:53 +00:00
Fariborz Jahanian 4cc0cf1a54 Objective-C [qoi] more gracefull recovery when
'}' is missing for the ivar declarations.
// rdar://6854840


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177549 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-20 18:09:33 +00:00
Rafael Espindola f48b93cb20 Remove the Tools DensMap from the toolchain.
Each toolchain has a set of tools, but they are all of known types. It can
have a linker, an assembler, a "clang" (compile, analyze, ...) a non-clang
compiler, etc.

Instead of keeping a map, just have member variable for each type of tool.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177479 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-20 03:05:54 +00:00
Nick Lewycky 83c546afef The flag "-coverage-function-names-in-data" is actually backwards -- we do
emit function names in .gcda files by default, and the flag turns that off!
Rename the flag to make it match what it actually does. This keeps the default
format compatible with gcc 4.2.

Also add a test for this flag.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177475 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-20 02:14:38 +00:00
Nick Lewycky f2b5e07072 Make clang emit linkage names in debug info for subprograms when coverage info
is enabled. Also add a new -test-coverage cc1 flag which makes testing coverage
possible and add our first clang-side coverage test.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177470 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-20 01:38:16 +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
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
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
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
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 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
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
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
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
Rafael Espindola d532018436 Remove unused argument.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177287 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-18 15:33:26 +00:00
Benjamin Kramer 74c8b794be ObjCDictionaryElements are pod-like.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177282 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-18 12:41:25 +00:00
Jordan Rose a8d937e4bd [analyzer] Model trivial copy/move assignment operators with a bind as well.
r175234 allowed the analyzer to model trivial copy/move constructors as
an aggregate bind. This commit extends that to trivial assignment
operators as well. Like the last commit, one of the motivating factors here
is not warning when the right-hand object is partially-initialized, which
can have legitimate uses.

<rdar://problem/13405162>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177220 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-16 02:14:06 +00:00
Argyrios Kyrtzidis 6aa240c03d Remove -Wspellcheck and replace it with a diagnostic option.
Thanks to Richard S. for pointing out that the warning would show up
with -Weverything.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177218 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-16 01:40:35 +00:00
Jordan Rose c996313273 [analyzer] Eliminate InterExplodedGraphMap class and NodeBackMap typedef.
...in favor of this typedef:

  typedef llvm::DenseMap<const ExplodedNode *, const ExplodedNode *>
          InterExplodedGraphMap;

Use this everywhere the previous class and typedef were used.

Took the opportunity to ArrayRef-ize ExplodedGraph::trim while I'm at it.

No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177215 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-16 01:07:53 +00:00
Douglas Gregor 4a18c3b25a <rdar://problem/13426257> Introduce SDKSettings.plist as an input file dependency for PCH/modules.
When we're building a precompiled header or module against an SDK on
Darwin, there will be a file SDKSettings.plist in the sysroot. Since
stat()'ing every system header on which a module or PCH file depends
is performance suicide, we instead stat() just SDKSettings.plist. This
hack works well on Darwin; it's unclear how we want to handle this on
other platforms. If there is a canonical file, we should use it; if
not, we either have to take the performance hit of stat()'ing system
headers repeatedly or roll the dice by not checking anything.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177194 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-15 22:15:07 +00:00
Eric Christopher e462c60ac3 Silence anonymous type in anonymous union warnings.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177133 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-15 00:32:52 +00:00
Argyrios Kyrtzidis 57f8da506a Don't try to typo-correct 'super' in an objc method.
This created 2 issues:

1) Performance issue, since typo-correction with PCH/modules is rather expensive.
2) Correctness issue, since if it managed to "correct" 'super' then bogus compiler errors would
be emitted, like this:

3.m:8:3: error: unknown type name 'super'; did you mean 'super1'?
  super.x = 0;
  ^~~~~
  super1
t3.m:5:13: note: 'super1' declared here
typedef int super1;
            ^
t3.m:8:8: error: expected identifier or '('
  super.x = 0;
       ^

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177126 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-14 22:56:43 +00:00
Anna Zaks a4bb4f6ca8 [analyzer] Change the way in which IDC Visitor decides to kick in and make sure it attaches in the given edge case
In the test case below, the value V is not constrained to 0 in ErrorNode but it is in node N.
So we used to fail to register the Suppression visitor.

We also need to change the way we determine that the Visitor should kick in because the node N belongs to
the ExplodedGraph and might not be on the BugReporter path that the visitor sees. Instead of trying to match the node,
turn on the visitor when we see the last node in which the symbol is ‘0’.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177121 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-14 22:31:56 +00:00
Chandler Carruth 8f0d1f053f Fix an unused variable warning from Clang by sinking a dyn_cast into an
isa and a cast inside the assert. The efficiency concern isn't really
important here. The code should likely be cleaned up a bit more,
especially getting a message into the assert.

Please review Rafael.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177053 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-14 11:17:20 +00:00
Joey Gouly 96cead5137 Add support for the 'endian' attribute for OpenCL.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177035 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-14 09:54:43 +00:00
Rafael Espindola 2d1b09641e Avoid computing the linkage too early. Don't invalidate it.
Before this patch we would compute the linkage lazily and cache it. When the
AST was modified in ways that could change the value, we would invalidate the
cache.

That was fairly brittle, since any code could ask for the a linkage before
the correct value was available.

We should change the API to one where the linkage is computed explicitly and
trying to get it when it is not available asserts.

This patch is a first step in that direction. We still compute the linkage
lazily, but instead of invalidating a cache, we assert that the AST
modifications didn't change the result.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176999 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-14 03:07:35 +00:00
Argyrios Kyrtzidis 55ea75bf61 [Modules] Don't eagerly load and associate all the module header files.
In a module-enabled Cocoa PCH file, we spend a lot of time stat'ing the headers
in order to associate the FileEntries with their modules and support implicit
module import.

Use a more lazy scheme by enhancing HeaderInfoTable to store extra info about
the module that a header belongs to, and associate it with its module only when
there is a request for loading the header info for a particular file.

Part of rdar://13391765

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176976 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-13 21:13:51 +00:00
Argyrios Kyrtzidis c1d2239362 [Modules] Resolve top-headers of modules lazily.
This allows resolving top-header filenames of modules to FileEntries when
we need them, not eagerly.

Note that that this breaks ABI for libclang functions
clang_Module_getTopLevelHeader / clang_Module_getNumTopLevelHeaders
but this is fine because they are experimental and not widely used yet.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176975 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-13 21:13:43 +00:00
Bob Wilson 327a6d9cbe Revert "Revert r166370 and r166540 now that Xcode 4.6 has been available for a while."
This reverts commit 176887.  Nico asked for more time to move to Xcode 4.6.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176892 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-12 20:00:34 +00:00
Fariborz Jahanian 6114a3c9ba Objective-C: Issue warning in couple of obscure cases
when property autosynthesis does not synthesize a property.
When property is declared 'readonly' in a super class and
is redeclared 'readwrite' in a subclass. When a property
autosynthesis causes it to share 'ivar' with another property.
// rdar://13388503


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176889 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-12 19:46:17 +00:00
Bob Wilson a29e0fafe7 Revert r166370 and r166540 now that Xcode 4.6 has been available for a while.
Those changes were added as a temporary workaround for Xcode 4.5 passing the
-Wno-arc-abi option.  Xcode 4.6 does not pass that option so this should no
longer be necessary.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176887 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-12 19:39:19 +00:00
Ted Kremenek c06fcdfacc Revert "Disallow using -fmodules with -no-integrated-as."
Per comment from Benjamin Kramer, this isn't portable (yet).  I'll come up
with a better fix.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176876 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-12 17:02:12 +00:00
Ted Kremenek ebf0f43f07 Disallow using -fmodules with -no-integrated-as.
Modules enables features such as auto-linking, and we simply do not want to
support a matrix of subtly enabled/disabled features depending on whether or
not a user is using the integrated assembler.

It isn't clear if this is the best place to do this check.  For one thing,
these kind of errors are not caught by the serialized diagnostics.

Fixes <rdar://problem/13289240>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176826 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-11 20:51:52 +00:00
Richard Smith d4bf760d05 Add -Wc99-compat warning for C11 unicode string and character literals.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176817 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-11 18:01:42 +00:00
Richard Smith 0b91cc47a5 Handle _Pragma on a u8, u, or U string literal per the C11 specification. Also
handle raw string literals here. C++11 doesn't yet specify how they will
behave, but discussion on core suggests that we should just strip off
everything but the r-char-sequence.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176779 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-09 23:30:15 +00:00
Benjamin Kramer 7cb583d13f Remove unused diagnostic.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176774 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-09 18:44:47 +00:00