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

21021 Коммитов

Автор SHA1 Сообщение Дата
Fariborz Jahanian 776dbf9704 Force clang to produce legacy api for messaging
in for pre-snowleoprd (NeXt runtime). Fixes
radar 7866951


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101791 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-19 17:53:30 +00:00
Rafael Espindola b1af4c810f Add comment explaning the use of c99 inline in c++.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101787 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-19 16:58:20 +00:00
Dan Gohman cb421fa690 Fix -Wcast-qual warnings.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101786 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-19 16:39:44 +00:00
Zhongxing Xu cb7464ab40 Move all C++ expression evaluation logic into its own file.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101772 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-19 12:51:02 +00:00
Zhongxing Xu 856c6bcaea Analyzer: add support for CXXNewExpr.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101771 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-19 11:47:28 +00:00
David Chisnall d901da5314 Don't just emit ivar metadata - emit CORRECT ivar metadata. (GNU runtime)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101759 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-19 01:37:25 +00:00
David Chisnall 7f63cb098f Fix emitting ivar metadata for synthesized ivars and some 64-bit fixes. (GNU runtime)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101758 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-19 00:45:34 +00:00
Rafael Espindola b8cab18e85 If a method is virtual and the class key function is in another file, emit the method as available_externally.
Fixes PR6747


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101757 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-19 00:44:22 +00:00
Fariborz Jahanian 65ad5a42cc Local static variables must be available module-wise
as they are accessible in static methods in a class
local to the same function. Fixes PR6769.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101756 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-18 21:01:23 +00:00
Nuno Lopes a75b71f967 recommit r101568 to fix PR6766
as a side-effect, remove two FIXMEs now fixed

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101726 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-18 19:06:43 +00:00
Douglas Gregor a77eaa9f45 Make sure that we don't visit redeclarations of nested classes while
instantiating class members as part of an explicit
instantiation. Addresses a compilation problem in
Boost.Serialization.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101725 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-18 18:11:38 +00:00
Douglas Gregor c1c9df77c0 C++ [namespace.memdef]p3 only applies when the friend is not named via
a qualified name. We weren't checking for an empty
nested-name-specifier when dealing with friend class templates
(although we were checking in the other places where we deal with this
paragraph). Fixes a Boost.Serialization showstopper.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101724 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-18 17:37:40 +00:00
Daniel Dunbar d13ada13cb tests: Don't force triple in x86-builtin-palignr test, this test should be
portable.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101719 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-18 15:30:18 +00:00
Benjamin Kramer b6eee077b2 Bail out early to avoid comparing the internals of two conversion sequences of
different kinds (aka garbage). This happens if we're comparing a standard
conversion sequence to an ambiguous one which have the same KindRank.

Found by valgrind.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101717 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-18 12:05:54 +00:00
Douglas Gregor 66821b5515 When performing reference initialization for the purposes of overload
resolution ([over.ics.ref]), we take some shortcuts required by the
standard that effectively permit binding of a const volatile reference
to an rvalue. We have to treat lightly here to avoid infinite
recursion.

Fixes PR6177.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101712 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-18 09:22:00 +00:00
Douglas Gregor 9dc58bb414 Binding a reference to an rvalue is a direct binding in C++0x but not
in C++03.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101707 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-18 08:46:23 +00:00
Chandler Carruth 630eb01b25 Fix the access checking of function and function template argument types,
return types, and default arguments. This fixes PR6855 along with several
similar cases where we rejected valid code.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101706 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-18 08:23:21 +00:00
Douglas Gregor 2559a7045a When checking the copy constructor for the optional copy during a
reference binding to an rvalue of reference-compatible type, check
parameters after the first for complete parameter types and build any
required default function arguments. We're effectively simulating the
type-checking for a call without building the call itself.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101705 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-18 07:57:34 +00:00
Douglas Gregor 523d46af40 In C++98/03, when binding a reference to an rvalue of
reference-compatible type, the implementation is permitted to make a
copy of the rvalue (or many such copies, even). However, even though
we don't make that copy, we are required to check for the presence of
a suitable copy constructor. With this change, we do.

Note that in C++0x we are not allowed to make these copies, so we test
both dialects separately.

Also note the FIXME in one of the C++03 tests, where we are not
instantiating default function arguments for the copy constructor we
pick (but do not call). The fix is obvious; eliminating the infinite
recursion it causes is not. Will address that next.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101704 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-18 07:40:54 +00:00
Chandler Carruth 389980e360 Add testcase that I forgot for r101667 for gnu-keywords.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101700 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-18 06:12:13 +00:00
Ted Kremenek 422bae76c7 Allow the 'ibaction' attribute to be attached to method declarations (and not issue a warning).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101699 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-18 04:59:38 +00:00
Douglas Gregor 153b3ba7a6 Do not consider explicit constructors when performing a copy to a
temporary object. This is blindingly obvious from reading C++
[over.match.ctor]p1, but somehow I'd missed it and it took DR152 to
educate me. Adjust one test that was relying on this non-standard
behavior.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101688 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-18 02:16:12 +00:00
Anders Carlsson 6ba38151f7 Simplify wide bit-field layout in CGRecordLayoutBuilder, and also fix a bug where assigning to a bit-field member would overwrite other parts of the struct.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101681 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-17 22:54:57 +00:00
Douglas Gregor 3fbaf3e5d5 Improve our handling of user-defined conversions as part of overload
resolution. There are two sources of problems involving user-defined
conversions that this change eliminates, along with providing simpler
interfaces for checking implicit conversions:

  - It eliminates a case of infinite recursion found in Boost.

  - It eliminates the search for the constructor needed to copy a temporary
    generated by an implicit conversion from overload
    resolution. Overload resolution assumes that, if it gets a value
    of the parameter's class type (or a derived class thereof), there
    is a way to copy if... even if there isn't. We now model this
    properly.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101680 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-17 22:01:05 +00:00
Anders Carlsson 4803535dfe Fix an assert when assigning a boolean value to a bitfield of type _Bool.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101678 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-17 21:52:22 +00:00
Anders Carlsson d62328e6a0 Unnamed bit-fields in a union should be laid out with a type that doesn't affect alignment.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101673 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-17 21:04:52 +00:00
Anders Carlsson 86664465ba Factor union field layout code out into a separate function. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101671 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-17 20:49:27 +00:00
Anders Carlsson de9f153b23 If a wide bit-field is inside a union its offset should always be 0.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101668 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-17 20:21:41 +00:00
Chandler Carruth eb5d7b7526 Add support for '-fgnu-keywords' and '-fasm' to Clang's driver. They are not
implemented precisely the same as GCC, but the distinction GCC makes isn't
useful to represent. This allows parsing code which uses GCC-specific keywords
('asm', etc.) without parsing in a fully GNU mode.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101667 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-17 20:17:31 +00:00
Anders Carlsson 046c294a43 Vtable -> VTable renames across the board.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101666 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-17 20:15:18 +00:00
Chandler Carruth 63e9c0ddf1 Prevent accidental in-source builds with CMake, and detect when there are
generated files from a previous in-source builds.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101665 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-17 20:12:02 +00:00
Chris Lattner afd5eda46e fix integrated assembler with i386 objc code.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101660 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-17 18:26:20 +00:00
Anders Carlsson fbf05613db Fix a bug where we would sometimes incorrectly mark an vtable function as unused.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101643 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-17 17:24:33 +00:00
Benjamin Kramer f6cde77d7b Add printName to DeclarationName which prints the human-readable name on a
raw_ostream. Use it in getAsString and NamedDecl's raw_ostream operator.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101633 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-17 09:56:45 +00:00
Benjamin Kramer 900fc6388e Add raw_ostream operators to NamedDecl for convenience. Switch over all users of getNameAsString on a stream.
The next step is to print the name directly into the stream, avoiding a temporary std::string copy.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101632 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-17 09:33:03 +00:00
Chris Lattner 7a22f02a02 revert r101568, which miscompiles this testcase, distilled from ldecod:
void exit_picture()
{
  char yuv_types[4][6]= {"4:0:0","4:2:0","4:2:2","4:4:4"};
  foo(yuv_types);
}



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101623 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-17 06:53:44 +00:00
Daniel Dunbar fb36d21960 Driver: Add missing claim() for -mllvm options.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101618 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-17 06:10:00 +00:00
Eric Christopher 26d2427abe New test to verify that we see constant integers here.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101611 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-17 02:36:08 +00:00
Eric Christopher 691ebc3f32 Consolidate most of the integer constant expression builtin requirement
checking into a single function and use that throughout. Remove some
now unnecessary diagnostics and update tests with now more accurate
diagnostics.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101610 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-17 02:26:23 +00:00
Ted Kremenek f91e56b63b Wrap 'data' key in quotes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101594 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-17 00:37:35 +00:00
Ted Kremenek b0c0295c38 Make script actually work.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101591 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-17 00:33:24 +00:00
Ted Kremenek 87bdd6689a Log code completion data in json format.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101587 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-17 00:21:44 +00:00
Ted Kremenek 2ee297fab4 Send code completion data in json format.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101586 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-17 00:21:42 +00:00
Ted Kremenek 1af0a2a518 Remove unneeded assertion and don't return a null CXString.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101585 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-17 00:21:38 +00:00
Chris Lattner 1c6c64b518 emit warn_char_constant_too_large at most once per literal, fixing PR6852
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101580 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-16 23:44:05 +00:00
Chris Lattner 2b334bb312 make our existing "switch on bool" warning work for C. Since
the result of comparisons are 'int' in C, it doesn't work to
test just the result type of the expression.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101576 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-16 23:34:13 +00:00
Douglas Gregor ca7eaeeed8 If a non-noreturn virtual member function is guaranteed not to return,
do *not* suggest that the function could be attribute 'noreturn';
overridden functions may end up returning.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101572 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-16 23:28:44 +00:00
Douglas Gregor 8f00dcf141 Switch Sema::FindCompositePointerType() over to InitializationSequence.
This is the last of the uses of TryImplicitConversion outside of
overload resolution and InitializationSequence itself.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101569 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-16 23:20:25 +00:00
Nuno Lopes 6784704d47 fix PR6766: codegen of var initialized with wide char
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101568 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-16 23:19:41 +00:00
Douglas Gregor 575c63a83e Move Sema::PerformImplicitConversion over to where Sema::TryImplicitConversion is, for my own sanity. No functionality change
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101554 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-16 22:27:05 +00:00