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

26376 Коммитов

Автор SHA1 Сообщение Дата
Douglas Gregor be230c36e3 Implement support for pack expansions whose pattern is a non-type
template argument (described by an expression, of course). For
example:

  template<int...> struct int_tuple { };

  template<int ...Values>
  struct square {
    typedef int_tuple<(Values*Values)...> type;
  };

It also lays the foundation for pack expansions in an initializer-list.
  



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122751 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-03 17:17:50 +00:00
Oscar Fuentes 9917401b32 Use some of the llvm cmake infraestructure. This takes care of
disabling rtti and exceptions where requested. Remove some unnecessary
code too.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122750 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-03 17:00:02 +00:00
Douglas Gregor 81063a2377 Consolidate template metafunction tests for variadic templates into a single file
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122748 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-03 16:17:20 +00:00
Oscar Fuentes 7f88643437 Set LLVM_NO_RTTI and LLVM_USED_LIBS for clangStaticAnalyzerCheckers
Patch by arrowdodger!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122747 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-03 14:53:25 +00:00
Douglas Gregor 6b9109e9d5 When we attempt to create a built-in that involves a library type we
don't have access to (e.g., fprintf, which needs the library type
FILE), fail with a warning and forget about the builtin
entirely. Previously, we would actually provide an error, which breaks
autoconf's super-lame checks for fprintf, longjmp, etc. Fixes PR8316.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122744 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-03 09:37:44 +00:00
Peter Collingbourne a96022c365 Funciton -> Function
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122709 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-02 19:53:19 +00:00
Peter Collingbourne 743b82bf3c Unkown -> Unknown
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122708 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-02 19:53:12 +00:00
Francois Pichet 8595a0ced7 Remove obsolete comments.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122686 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-02 09:19:59 +00:00
Rafael Espindola 33a53440eb Add support for passing variables declared to use a xmm register to asm
statements using the "x" constraint.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122679 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-02 03:59:13 +00:00
Rafael Espindola baf86955a9 Produce a better error message for invalid register names.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122670 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-01 21:47:03 +00:00
Rafael Espindola 03117d1b2e Fix typo and add comment.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122669 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-01 21:12:33 +00:00
Benjamin Kramer b2c5de5baa More empty directory removal.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122668 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-01 21:04:42 +00:00
Nick Lewycky 4ff1a1c091 Remove empty directories.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122665 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-01 20:51:16 +00:00
Nick Lewycky 3fdcc6fb12 Remove stray emacs mode markers in all these files that was causing emacs to
open them in fundamental-mode instead of c++-mode.
Also twiddle whitespace for consistency in ToolChains.cpp.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122646 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-31 17:31:54 +00:00
Francois Pichet f57258bb96 MSVC doesn't require an accessible copy-constructor when binding a temporary class object to a const-reference.
Note: this is not a C++0x behavior change, it was already like that in MSVC 2003.

This fixes a compile error when parsing MSVC header files with clang.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122644 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-31 10:43:42 +00:00
Rafael Espindola 0ec89f928c Add support for declaring register contraints in variables. They are only used
in asm statements:

register int foo asm("rdi");

asm("..." : ... "r" (foo) ...

We also only accept these variables if the constraint in the asm statement is "r".

This fixes most of PR3933.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122643 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-30 22:59:32 +00:00
Nick Lewycky a9de3fa8a9 Correct function name in comment.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122640 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-30 20:21:55 +00:00
David Chisnall 5389f48b24 Expose Objective-C type encodings of declarations to libclang users. This also adds a method in ASTContext which encodes FunctionDecls using the same encoding format that is used for Objective-C methods.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122639 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-30 14:05:53 +00:00
Benjamin Kramer 9f0c7cc36d Simplify mem{cpy, move, set} creation with IRBuilder.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122634 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-30 00:13:21 +00:00
Rafael Espindola 272324bc88 Fix PR8796.
The problem was that we were asserting the we never added an empty class
to the same offset twice. This is not true for unions, where two members, empty
or not, can have the some offset.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122633 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-29 23:02:58 +00:00
Roman Divacky c8b09a1fa2 set features for k8-sse3
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122629 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-29 13:28:29 +00:00
Abramo Bagnara 927b180b8d Added scalar casts test.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122599 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-28 17:19:27 +00:00
Abramo Bagnara 4b0766f958 Canonicalize types before possible cast.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122592 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-28 09:13:41 +00:00
Francois Pichet 6915c529db More __uuidof validation:
1. Do not validate for uuid attribute if the type is template dependent.
2. Search every class declaration and definition for the uuid attribute.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122578 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-27 01:32:00 +00:00
David Chisnall 8fac25d33b Add support for GNU runtime property set / get structure functions. Minor refactoring of Mac runtime (returns the same function for both, as the Mac runtimes currently only provide a single entry point for setting and getting struct properties, although this will presumably be fixed at some point).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122569 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-26 22:13:16 +00:00
David Chisnall c7ff82c204 Fix for PR8695.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122564 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-26 20:12:30 +00:00
Chris Lattner 3f59c975aa The -fshort-wchar option causes wchar_t to become unsigned, in addition to being
16-bits in size.  Implement this by splitting WChar into two enums, like we have
for char.  This fixes a miscompmilation of XULRunner, PR8856.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122558 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-25 23:25:43 +00:00
Michael J. Spencer af6530c938 Remove all uses of PathV1::GetRootDirectory.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122552 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-25 20:09:27 +00:00
Ted Kremenek a6b0b96e53 Add basic support for pointer arithmetic in
SimpleSValBuilder.  This clears up some
false positives emitted by ArrayBoundCheckerV2
due to the lack of support for pointer arithmetic.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122546 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-24 08:39:33 +00:00
Argyrios Kyrtzidis 3252134192 Remove the EntoSA directories.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122543 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-24 06:19:58 +00:00
Chris Lattner 194252d414 don't use #pragma mark, it isn't portable.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122540 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-24 04:45:23 +00:00
Michael J. Spencer 1a3942a18b ifndef _MSC_VER out #pragma mark on MSVC. It still tries to parse the text even
though it doesn't know what it is, and complains about invalid tokens ;/.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122538 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-24 04:07:39 +00:00
Argyrios Kyrtzidis ee933e1cc2 Handle locations coming from macro instantiations properly in SourceManager::isBeforeInTranslationUnit().
Fixes rdar://8790245 and http://llvm.org/PR8821.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122536 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-24 02:53:53 +00:00
John McCall 7f040a9d81 Refactor how we collect attributes during parsing, and add slots for attributes
on array and function declarators.  This is pretty far from complete, and I'll
revisit it later if someone doesn't beat me to it.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122535 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-24 02:08:15 +00:00
Douglas Gregor 6e4e17de3d Fix a thinko in a helper routine for template argument deduction that
caused an assertion when dealing with non-type template parameter
packs. Add some tests for deduction and instantiation of non-type
template parameter packs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122534 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-24 00:35:52 +00:00
Douglas Gregor 85374738e4 Non-type template parameter packs cannot have default arguments.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122533 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-24 00:20:52 +00:00
Douglas Gregor 56bc9832bc When instantiating a non-type template parameter pack, be sure to
extract the appropriate argument from the argument pack (based on the
current substitution index, of course). Simple instantiation of pack
expansions involving non-type template parameter packs now works.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122532 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-24 00:15:10 +00:00
Douglas Gregor 10738d36b1 Add an AST representation for non-type template parameter
packs, e.g.,

  template<typename T, unsigned ...Dims> struct multi_array;

along with semantic analysis support for finding unexpanded non-type
template parameter packs in types, expressions, and so on.

Template instantiation involving non-type template parameter packs
probably doesn't work yet. That'll come soon.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122527 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-23 23:51:58 +00:00
Douglas Gregor 662a4822ee Improve the diagnostic and recovery for missing colons after 'case'
and 'default' statements, including a Fix-It to add the colon:

test/Parser/switch-recovery.cpp:13:12: error: expected ':' after 'case'
    case 17 // expected-error{{expected ':' after 'case'}}
           ^
           :
test/Parser/switch-recovery.cpp:16:12: error: expected ':' after 'default'
    default // expected-error{{expected ':' after 'default'}}
           ^
           :



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122522 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-23 22:56:40 +00:00
Douglas Gregor a8bc8c9e9b Implement parsing of function parameter packs and non-type template
parameter packs (C++0x [dcl.fct]p13), including disambiguation between
unnamed function parameter packs and varargs (C++0x [dcl.fct]p14) for
cases like 

  void f(T...)

where T may or may not contain unexpanded parameter packs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122520 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-23 22:44:42 +00:00
Ted Kremenek c32647d111 Add -fobjc-default-synthesized-properties flag
to allow us to explicitly control whether or
not Objective-C properties are default synthesized.
Currently this feature only works when using
the -fobjc-non-fragile-abi2 flag (so there is
no functionality change), but we can now turn
off this feature without turning off all the features
coupled with -fobjc-non-fragile-abi2.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122519 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-23 21:35:43 +00:00
Ted Kremenek 21142581d5 Chris Lattner has strong opinions about directory
layout.  :)

Rename the 'EntoSA' directories to 'StaticAnalyzer'.

Internally we will still use the 'ento' namespace
for the analyzer engine (unless there are further
sabre rattlings...).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122514 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-23 19:38:26 +00:00
John McCall fd03843f05 Kill RecordType::getAddressSpace() and its fixme; that's just not how
address spaces work.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122511 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-23 17:56:54 +00:00
Douglas Gregor b9c6631941 Reimplement the comparison of a class template partial
specialization's template arguments against the primary template's
template arguments using the obvious, correct method of checking the
injected-class-name type (C++ [temp.class.spec]p9b3). The previous
incarnation of this comparison attempted to use its own formulation of
the injected-class-name, which is redudant and, with the introduction
of variadic templates, became wrong (again).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122508 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-23 17:13:55 +00:00
Douglas Gregor b7d09d627c When forming the injected-class-name of a variadic template, the
template argument corresponding to a template parameter pack is an
argument pack of a pack expansion of that template parameter
pack. Implements C++0x [temp.dep.type]p2 (at least, as much of it as
we can).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122498 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-23 16:00:30 +00:00
Zhongxing Xu 3e310d33e4 When cast derived to base, only process MemRegionVal.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122494 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-23 12:08:42 +00:00
Ted Kremenek 3a8f40ed5e Rename headers: 'clang/GR' 'clang/EntoSA' and
update Makefile.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122493 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-23 07:22:02 +00:00
Ted Kremenek 9ef6537a89 Rename static analyzer namespace 'GR' to 'ento'.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122492 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-23 07:20:52 +00:00
Zhongxing Xu 51fbe2b766 Remove lib/Checker directory.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122475 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-23 05:22:43 +00:00
Ted Kremenek 15a467e9e8 It's amazing what you find when you actually
set the RUN line correctly in a test file!

Mark a bunch of tests for ArrayBoundCheckerV2
as FIXME's, as our current lack of pointer
arithmetic handling causes these to be all
false positives/negatives.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122471 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-23 02:42:49 +00:00