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

34379 Коммитов

Автор SHA1 Сообщение Дата
Fariborz Jahanian f83a615ad0 objc2: add __has_feature(objc_default_synthesize_properties).
// rdar://10770497


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149565 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-02 00:15:51 +00:00
Eric Christopher 271ce5454b r149474 went a bit too far when combined with type caching. If we want
a full type go ahead and emit it if we currently only have a forward
declaration.

Fixes gdb bots for gdb1090.exp and call-ar-st.exp.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149560 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-01 23:39:00 +00:00
Rafael Espindola 20039ae1d9 Reject mismatched "#pragma GCC visibility push" and "#pragma GCC visibility pop".
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149559 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-01 23:24:59 +00:00
Fariborz Jahanian 52b6236427 Look for declaration of CFBridgingRetain/CFBridgingRetain before
changing the diagnostic. Also use correct spelling for both.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149554 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-01 22:56:20 +00:00
Dylan Noblesmith 873488a9d5 make: fix installation of generated header files
The PROJ_SRC_DIR != PROJ_OBJ_DIR path was missing the directory
creation logic that was in the path for non-generated headers.
PR11903.

(The oversight was copied and pasted from LLVM's Makefile.rules,
where it apparently existed since time immemorial til it was
corrected in r127325.)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149551 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-01 22:23:31 +00:00
Dylan Noblesmith eafa50bbdf cmake: don't install config.h (v2)
This header is private and shouldn't be used by clients.

(This reverts r149540, reinstating r149496. False alarm.)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149550 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-01 22:22:37 +00:00
Eric Christopher ef81e0f8f1 Remove duplicated comment.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149544 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-01 21:48:10 +00:00
Eric Christopher af790885c7 Fix comment.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149543 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-01 21:44:56 +00:00
Dylan Noblesmith 3f405d3606 cmake: revert r149496
It *looks* like this caused PR11903, somehow.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149540 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-01 21:17:55 +00:00
Douglas Gregor ac32ff9812 Make sure that imported definitions get completed before we add
anything into the corresponding DeclContext. Co-hacked with Sean;
fixes <rdar://problem/10768928>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149535 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-01 21:00:38 +00:00
Benjamin Kramer 5b419362c2 libclang: Mark clang_Cursor_isNull with CINDEX_LINKAGE to make it available on windows.
Patch by Timothy J Fontaine!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149533 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-01 20:37:28 +00:00
Argyrios Kyrtzidis 7f3a458cd4 [libclang] Make sure we don't ever leave a StoredDiagnostic associated with
a SourceManager that has already been deleted, rdar://10768346.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149532 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-01 19:54:02 +00:00
Douglas Gregor a28c1df2cc Add missing dependency to unbreak the CMake build
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149531 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-01 19:53:01 +00:00
David Chisnall dccaa239ec size() == 0 -> empty().
Spotted by rjmcall.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149526 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-01 19:16:56 +00:00
Anna Zaks 84aac9acc7 [analyzer] Fix a crash in CheckerContext::isCLibraryFunction for C++
declarations with special names.

A patch by Dmitri Gribenko.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149525 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-01 19:16:20 +00:00
Anna Zaks c36bedc90c Add a new compiler warning, which flags anti-patterns used as the size
argument in strncat.

The warning is ignored by default since it needs more qualification. 

TODO: The warning message and the note are messy when
strncat is a builtin due to the macro expansion.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149524 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-01 19:08:57 +00:00
Douglas Gregor b710dfe523 Diagnose the restriction on default arguments in C++11 [expr.prim.lambda]p5.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149517 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-01 17:18:19 +00:00
Douglas Gregor a1f2114d9e Introduce the lambda scope before determining explicit captures, which
cleans up and improves a few things:
  - We get rid of the ugly dance of computing all of the captures in
  data structures that clone those of CapturingScopeInfo, centralizing
  the logic for accessing/updating these data structures
  - We re-use the existing capture logic for 'this', which actually
  works now.

Cleaned up some diagnostic wording in minor ways as well.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149516 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-01 17:04:21 +00:00
Anna Zaks ac4e5b7a11 [analyzer] Testing: add 2 new checkers to the buildbot script.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149514 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-01 16:46:57 +00:00
NAKAMURA Takumi 93b7750843 test/Driver/target.c: Relax expression for "gcc.exe" on win32.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149510 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-01 15:16:22 +00:00
Dylan Noblesmith 69d3b4f7c9 include clang's config.h unconditionally
And remove HAVE_CLANG_CONFIG_H, now that the header is generated
in the autoconf build, too. (clang r149497 / llvm r149498)

Also include the config.h header after all other headers, per
the LLVM coding standards.

It also turns out WindowsToolChain.cpp wasn't using the config
header at all, so that include's just deleted now.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149504 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-01 14:25:28 +00:00
NAKAMURA Takumi 9dc01f5f9c test/Modules/compiler_builtins.m: Appease Cygwin to add -D__need_wint_t.
On Cygwin, at first, <stddef.h> is included without __need_wint_t.
Next, <stddef.h> is included with __need_wint_t, though Modules feature would not process <stddef.h> twice.
Then, wint_t is not found in system headers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149500 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-01 14:09:19 +00:00
NAKAMURA Takumi 8c8840d049 test/Modules/compiler_builtins.m: Mark this as XFAIL:win32. MS limits.h provides size_t.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149499 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-01 14:09:13 +00:00
Dylan Noblesmith 04f7a889b2 autoconf: add private config.h to clang
This already exists in the CMake build, which is part of what makes
building clang separately from llvm via cmake possible. This cleans up
that discrepancy between the build systems (and sets the groundwork
for configuring clang separately, too).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149497 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-01 13:50:25 +00:00
Dylan Noblesmith f9b6e97638 cmake: don't install config.h
This header is private and shouldn't be used by clients.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149496 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-01 13:50:22 +00:00
Dylan Noblesmith 36579d4f55 Frontend: fix comment typos
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149495 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-01 13:50:20 +00:00
Richard Smith 15efc4d597 constexpr: check for overflow in pointer subtraction.
This is a mess. According to the C++11 standard, pointer subtraction only has
undefined behavior if the difference of the array indices does not fit into a
ptrdiff_t.

However, common implementations effectively perform a char* subtraction first,
and then divide the result by the element size, which can cause overflows in
some cases. Those cases are not considered to be undefined behavior by this
change; perhaps they should be.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149490 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-01 08:10:20 +00:00
Stepan Dyatkovskiy ab14ae2ab1 Compatability fix for SwitchInst refactoring.
The purpose of refactoring is to hide operand roles from SwitchInst user (programmer). If you want to play with operands directly, probably you will need lower level methods than SwitchInst ones (TerminatorInst or may be User). After this patch we can reorganize SwitchInst operands and successors as we want.

What was done:

1. Changed semantics of index inside the getCaseValue method:
getCaseValue(0) means "get first case", not a condition. Use getCondition() if you want to resolve the condition. I propose don't mix SwitchInst case indexing with low level indexing (TI successors indexing, User's operands indexing), since it may be dangerous.
2. By the same reason findCaseValue(ConstantInt*) returns actual number of case value. 0 means first case, not default. If there is no case with given value, ErrorIndex will returned.
3. Added getCaseSuccessor method. I propose to avoid usage of TerminatorInst::getSuccessor if you want to resolve case successor BB. Use getCaseSuccessor instead, since internal SwitchInst organization of operands/successors is hidden and may be changed in any moment.
4. Added resolveSuccessorIndex and resolveCaseIndex. The main purpose of these methods is to see how case successors are really mapped in TerminatorInst.
4.1 "resolveSuccessorIndex" was created if you need to level down from SwitchInst to TerminatorInst. It returns TerminatorInst's successor index for given case successor.
4.2 "resolveCaseIndex" converts low level successors index to case index that curresponds to the given successor.

Note: There are also related compatability fix patches for dragonegg, klee, llvm-gcc-4.0, llvm-gcc-4.2, safecode, clang.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149482 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-01 07:50:21 +00:00
Argyrios Kyrtzidis 5d3a4bb13d Revert r149363 which was part a series of commits that were reverted in llvm
commit 149470. This fixes test/CodeGen/PR3589-freestanding-libcalls.c.

Original log:

    ConstantArray::get() (for strings) is going away, use
    ConstantDataArray::getString instead.

    Many instances of ConstantArray::get() could be moved to
    use more efficient ConstantDataArray methods that avoid a ton
    of intermediate Constant*'s for each element (e.g.
    GetConstantArrayFromStringLiteral).  I don't plan on doing this
    in the short-term though.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149477 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-01 06:36:49 +00:00
Argyrios Kyrtzidis c221411ad5 Remove redundant checks in CXXRecordDecl::isCLike(), as suggested by Sebastian.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149476 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-01 06:36:44 +00:00
Eric Christopher 0086a5b44a For pass-by-value record arguments to functions emit a forward decl
instead of the entire class definition.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149474 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-01 06:07:23 +00:00
Richard Smith 7b48a29863 constexpr: overflow checking for integral and floating-point arithmetic.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149473 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-01 05:53:12 +00:00
Douglas Gregor b223d8c426 When providing code completions for a switch over a scoped enumeration
type, be sure to add the qualifier for the enumeration type.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149471 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-01 05:02:47 +00:00
Richard Smith 8398cbfc73 constexpr: Unlike other incomplete types, 'void' cannot possibly be completed as
a literal type. Disallow it as the return type of a constexpr function
declaration.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149469 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-01 04:40:02 +00:00
Richard Smith b04035a7b1 constexpr: require 'this' to point to an object in a constexpr method call.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149467 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-01 02:39:43 +00:00
Richard Smith b02e4629f7 constexpr: add support for comparisons of pointer-to-members.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149463 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-01 01:42:44 +00:00
Douglas Gregor 93962e5360 Improve checking of explicit captures in a C++11 lambda expression:
- Actually building the var -> capture mapping properly (there was an off-by-one error)
  - Keeping track of the source location of each capture
  - Minor QoI improvements, e.g, highlighing the prior capture if
  there are multiple captures, pointing at the variable declaration we
  found if we reject it.

As part of this, add standard citations for the various semantic
checks we perform, and note where we're not performing those checks as
we should.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149462 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-01 01:18:43 +00:00
Nico Weber ee625afea7 Fix crash on invalid in microsoft anonymous struct extension.
Fixes PR11847. Patch from Jason Haslam!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149460 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-01 00:41:00 +00:00
Douglas Gregor fe9b559f81 Diagnose attempts to explicitly capture a __block variable in a lambda.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149458 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-01 00:09:55 +00:00
Bob Wilson 48b68a0dc3 Use the new Triple::getMacOSXVersion function in another place.
I removed support for "*-darwin*-iphoneos" triples, since we now have
iOS listed as a separate OS in the triples.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149455 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-31 23:52:58 +00:00
Bob Wilson 8f1e656178 Fix an assertion failure in isMacOSXVersionLT for IOS targets.
Check if the triple OS is IOS instead of checking for arm/thumb architectures
and check that before calling isMacOSXVersionLT.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149454 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-31 23:52:54 +00:00
Kaelyn Uhrain 16e46dd0c2 Make the callback object to Sema::CorrectTypo mandatory.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149451 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-31 23:49:25 +00:00
Richard Smith 4ac38094a1 Extend for-range temporary cleanups codegen test to catch the bug which Eli
fixed in r149440.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149450 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-31 23:43:25 +00:00
Fariborz Jahanian 7eb82f0d09 objc-arc: In various diagnostics mention
CFBridgingRetain/CFBridgingRelease calls instead
of __bridge_retained/__bridge_transfer casts as preferred
way of moving cf objects to arc land. // rdar://10207950


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149449 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-31 23:42:37 +00:00
Richard Smith 3df61308dd constexpr: Treat INT_MIN % -1 as undefined behavior in C++11. Technically, it
isn't, but this is just a (reported) defect in the wording.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149448 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-31 23:24:19 +00:00
Eli Friedman d29975fd08 Make sure we call MaybeCreateExprWithCleanups for the sub-expression of an indirect goto.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149441 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-31 22:47:07 +00:00
Eli Friedman c6c14e56e3 A couple minor fixes to template instantiation for for-range loops.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149440 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-31 22:45:40 +00:00
Bob Wilson 4c5ffb32e8 Use new Triple::getMacOSXVersion function.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149439 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-31 22:43:59 +00:00
Fariborz Jahanian 9c7aed308a arc migrator: twik previous patch to exclude user provided
explicit type cast. // rdar://10521744


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149437 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-31 22:09:44 +00:00
Fariborz Jahanian 2908ffbc5f arc migrator: Do not attempt to migrate to bridge casts which
cancel out each other. Leave it alone so users can take a look
(unmigrated code forces error diagnostic). // rdar://10521744


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149435 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-31 21:58:23 +00:00