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

34271 Коммитов

Автор SHA1 Сообщение Дата
Douglas Gregor 5ad2649083 If there's no math.h, then tgmath.h should just be empty
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149209 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-29 22:35:57 +00:00
Douglas Gregor fe225e4aa3 Temporary disable the -verify on this test in the hope of getting some useful output from the buildbots
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149208 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-29 22:30:38 +00:00
Douglas Gregor 3e80d8ac92 Introduce a module map for (some of) the compiler-supplied
headers. The remaining headers require more sophisticated
requirements; they'll be handled separately. Part of
<rdar://problem/10710060>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149206 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-29 20:52:14 +00:00
Fariborz Jahanian 4e1524babb revert r149184
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149205 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-29 20:27:13 +00:00
Douglas Gregor 52f127297c Switch over to LLVM's file-level locking facility
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149204 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-29 20:15:24 +00:00
Douglas Gregor c6d626b0e3 Update line numbers. Sigh
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149202 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-29 20:05:18 +00:00
Douglas Gregor a007431cd4 Also require a proper shell
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149201 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-29 20:04:46 +00:00
Douglas Gregor 85ae12db3b Ensure that we clean up after a failed module build and cope with the
results in libclang.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149200 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-29 19:57:03 +00:00
Douglas Gregor c5b2e58840 Implement code completion support for module import declarations, e.g.,
@import <complete with module names here>

or

  @import std.<complete with submodule names here>

Addresses <rdar://problem/10710117>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149199 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-29 18:15:03 +00:00
Douglas Gregor e434ec71fc Rework HeaderSearch's interface for getting a module from a name and
for getting the name of the module file, unifying the code for
searching for a module with a given name (into lookupModule()) and
separating out the mapping to a module file (into
getModuleFileName()). No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149197 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-29 17:08:11 +00:00
Douglas Gregor 8f95cb328a Test module lookup within a subdirectory of a normal include directory.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149196 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-29 16:43:46 +00:00
John McCall 77fe6cd58f When emitting an ARC epilogue that looks like a return of 'self',
kill the retain from the return site.

This has the workaround nature.  It's badness all around.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149193 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-29 07:46:59 +00:00
John McCall f48f79636d Get a little bit smarter about killing off the ReturnValue alloca
in the presence of straight-line cleanups.  This is a simple but
important case, particularly for ARC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149190 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-29 02:35:02 +00:00
John McCall 4188760f6b Complain about attempts to use 'protected' visibility on targets
like Darwin that don't support it.  We should also complain about
invalid -fvisibility=protected, but that information doesn't seem
to exist at the most appropriate time, so I've left a FIXME behind.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149186 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-29 01:20:30 +00:00
Fariborz Jahanian de2fdc249e objc-arc: Perform null check on receiver before sending methods which
consume one or more of their arguments. If not done, this will cause a leak
as method will not consume the argument when receiver is null.
// rdar://10444474


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149184 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-28 18:46:31 +00:00
Benjamin Kramer a49a283926 Make the __builtin_c[lt]zs builtins target independent.
There is really no reason to have these only available on x86. It's
just __builtin_c[tl]z for shorts.

Modernize the test while at it.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149183 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-28 18:42:57 +00:00
Bob Wilson 9f1c49c57d Use defined-at-zero behavior for CLZ/CTZ builtins on PowerPC.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149181 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-28 18:02:29 +00:00
Benjamin Kramer c35fb7d67d StaticAnalyzer: Move ObjC- and CXX-specific methods out of line so checkers that don't care about the language don't have to pull in all the headers.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149178 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-28 12:06:22 +00:00
Abramo Bagnara bd2b6f0e57 Added tests for template keyword presence.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149177 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-28 11:04:22 +00:00
Argyrios Kyrtzidis 82e6411d00 DiagnosticsEngine::setMappingToAllDiagnostics() does not need to return bool,
caught by Chad.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149173 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-28 04:35:52 +00:00
Douglas Gregor 394f7b650a Allow the external AST source to provide a layout without specifying
the alignment (because it's not encoded in DWARF). In this case, make
an educated guess at the alignment.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149161 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-28 00:53:29 +00:00
Jean-Daniel Dupas 5faf5d31fa Remove the "C" in "implicitly declaring C library function" diagnostic
because all functions are not C functions (i.e. NSLog).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149150 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-27 23:21:02 +00:00
Douglas Gregor a1f1fad8b6 Introduce module attributes into the module map grammar, along with a
single attribute ("system") that allows us to mark a module as being a
"system" module. Each of the headers that makes up a system module is
considered to be a system header, so that we (for example) suppress
warnings there.

If a module is being inferred for a framework, and that framework
directory is within a system frameworks directory, infer it as a
system framework.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149143 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-27 19:52:33 +00:00
Abramo Bagnara e4b92761b4 Added source location for the template keyword in AST template-id expressions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149127 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-27 09:46:47 +00:00
Jean-Daniel Dupas 69d53845c6 Remove redundant checks.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149125 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-27 09:14:17 +00:00
Abramo Bagnara fad03b75e0 Avoid redundant NNS qualification in constructor/destructor names.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149124 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-27 08:46:19 +00:00
Argyrios Kyrtzidis 8b4f2b754e Add test for -Wno-everything.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149123 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-27 07:10:14 +00:00
Argyrios Kyrtzidis 11583c757b Due to a bug, -Wno-everything works like -Weverything. Fix the bug by having
-Wno-everything remap all warnings to ignored.

We can now use "-Wno-everything -W<warning>" to ignore all warnings except
specific ones.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149121 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-27 06:15:43 +00:00
Argyrios Kyrtzidis 97a9cf3b99 In FixItRecompile::BeginInvocation() reset the diagnostics before executing
the original action.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149120 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-27 06:15:37 +00:00
Douglas Gregor cff9f26ce0 Reimplement (de-)serialization of Objective-C categories to eliminate
the direct serialization of the linked-list structure. Instead, use a
scheme similar to how we handle redeclarations, with redeclaration
lists on the side. This addresses several issues:
  - In cases involving mixing and matching of many categories across
  many modules, the linked-list structure would not be consistent
  across different modules, and categories would get lost.
  - If a module is loaded after the class definition and its other
  categories have already been loaded, we wouldn't see any categories
  in the newly-loaded module.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149112 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-27 01:47:08 +00:00
John McCall 6895a644ca Be sure to emit delayed diagnostics after parsing the declaration
of a for-range variable.  Fixes PR11793.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149109 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-27 01:29:43 +00:00
Richard Smith 745f5147e0 constexpr: Implement the [dcl.constexpr]p5 check for whether a constexpr
function definition can produce a constant expression. This also provides the
last few checks for [dcl.constexpr]p3 and [dcl.constexpr]p4.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149108 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-27 01:14:48 +00:00
Argyrios Kyrtzidis 30ae84cfd1 In FixItRecompile::BeginInvocation(), check the return value of BeginSourceFile().
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149107 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-27 01:00:47 +00:00
Matt Beaumont-Gay ba4be25c90 Placate gcc's -Wreturn-type
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149104 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-27 00:46:27 +00:00
NAKAMURA Takumi a5fde150f9 test/Driver/prefixed-tools.c: Disable this on win32 hosts, msvc and mingw.
It had failed on Win32 due to inability of executing shell scripts.
Still it fails even with mingw MSYS bash.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149100 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-27 00:31:09 +00:00
NAKAMURA Takumi 5701e97d6d test/Driver/prefixed-tools.c: Fix newline at end-of-file.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149099 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-27 00:31:03 +00:00
Eli Friedman 0fa0638168 Turn off implicit truncation warning for compound assignment to bitfields; it might be reasonable in some cases, but it clearly doesn't make sense in some cases, like the included testcase.
<rdar://problem/10238797>, part 2.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149095 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-26 23:34:06 +00:00
Ted Kremenek 71d9d5cb9d Teach ccc-analyzer about -fobjc-abi-version.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149094 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-26 23:30:13 +00:00
Eli Friedman 3a643afa40 Make the bitfield implicit truncation warning slightly more aggressive, and make the printed warning a bit more accurate. The new behavior matches gcc's -Wconversion. <rdar://problem/10238797>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149089 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-26 23:11:39 +00:00
Joerg Sonnenberger 1bd9137449 Remove the ToolTriple logic in NetBSD, which was completely broken by
the recent refactoring. All interesting NetBSD release have a GNU as
version on i386 that supports --32, so don't bother with the conditional
setting of it.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149087 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-26 22:27:52 +00:00
Bob Wilson 8b30a9379f Make clz/ctz builtins defined for zero on ARM targets. rdar://10732455
ARM supports clz and ctz directly and both operations have well-defined
results for zero.  There is no disadvantage in performance to using the
defined-at-zero versions of llvm.ctlz/cttz intrinsics.  We're running into
ARM-specific code written with the assumption that __builtin_clz(0) == 32,
even though that value is technically undefined.  The code is failing now
because of llvm optimizations that are taking advantage of the undef
behavior (specifically svn r147255).  There's nothing wrong with that
optimization on x86 where any incorrect assumptions about __builtin_clz(0)
will quickly be exposed.  For ARM, though, optimizations based on that undef
behavior are likely to cause subtle bugs.  Other targets with defined-at-zero
clz/ctz support may want to override the default behavior as well.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149086 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-26 22:14:27 +00:00
Joerg Sonnenberger 66de97fcc3 Remove obviously incorrect branch.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149084 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-26 21:58:37 +00:00
Joerg Sonnenberger 34144f6761 Keep track of the original target the user specified before
normalization. This used to be captured in DefaultTargetTriple and is
used for the (optional) $triple-$tool lookup for cross-compilation.
Do this properly by making it an attribute of the toolchain and use it
in combination with the computed triple as index for the toolchain
lookup.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149083 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-26 21:56:28 +00:00
Ted Kremenek 8bef823818 Change references to 'const ProgramState *' to typedef 'ProgramStateRef'.
At this point this is largely cosmetic, but it opens the door to replace
ProgramStateRef with a smart pointer that more eagerly acts in the role
of reclaiming unused ProgramState objects.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149081 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-26 21:29:00 +00:00
Fariborz Jahanian bbdfad581f objc-arc: introduce -no-finalize-removal which in gc mode,
leaves "finalize' behind and in arc mode, does not
include it. This allows the migrated source to be compiled
in both gc and arc mode. // rdar://10532441


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149079 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-26 20:57:58 +00:00
John McCall e8c904ff34 Don't suppress access-control or invalid-type diagnostics from a
declarator just because we were able to build an invalid decl
for it.  The invalid-type diagnostics, in particular, are still useful
to know, and may indicate something about why the decl is invalid.

Also, recover from an illegal pointer/reference-to-unqualified-retainable
type using __strong instead of __autoreleasing;  in general, a random
object is much more likely to be __strong, so this avoids unnecessary
cascading errors in the most common case.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149074 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-26 20:04:03 +00:00
Douglas Gregor b9cd498fd4 Try harder to get X7 defined
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149072 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-26 18:38:13 +00:00
Argyrios Kyrtzidis 4fe19b5bf0 Change HasMutableFields to HasOnlyCMembers and consider that a tag inside
another tag does not break C-like-ness. rdar://10756831

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149071 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-26 18:28:08 +00:00
Douglas Gregor ed0cc2269b Don't separately serialize the list of instance variables in an
Objective-C class. The AST reader just throws away this data anyway!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149067 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-26 17:31:14 +00:00
Douglas Gregor a2a50282c3 Force layout of more of the unions and structures in this test
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149066 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-26 17:23:00 +00:00