]> granicus.if.org Git - clang/log
clang
13 years agoSet LLVM_NO_RTTI and LLVM_USED_LIBS for clangStaticAnalyzerCheckers
Oscar Fuentes [Mon, 3 Jan 2011 14:53:25 +0000 (14:53 +0000)]
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

13 years agoWhen we attempt to create a built-in that involves a library type we
Douglas Gregor [Mon, 3 Jan 2011 09:37:44 +0000 (09:37 +0000)]
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

13 years agoFunciton -> Function
Peter Collingbourne [Sun, 2 Jan 2011 19:53:19 +0000 (19:53 +0000)]
Funciton -> Function

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122709 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoUnkown -> Unknown
Peter Collingbourne [Sun, 2 Jan 2011 19:53:12 +0000 (19:53 +0000)]
Unkown -> Unknown

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122708 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoRemove obsolete comments.
Francois Pichet [Sun, 2 Jan 2011 09:19:59 +0000 (09:19 +0000)]
Remove obsolete comments.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122686 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd support for passing variables declared to use a xmm register to asm
Rafael Espindola [Sun, 2 Jan 2011 03:59:13 +0000 (03:59 +0000)]
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

13 years agoProduce a better error message for invalid register names.
Rafael Espindola [Sat, 1 Jan 2011 21:47:03 +0000 (21:47 +0000)]
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

13 years agoFix typo and add comment.
Rafael Espindola [Sat, 1 Jan 2011 21:12:33 +0000 (21:12 +0000)]
Fix typo and add comment.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122669 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoMore empty directory removal.
Benjamin Kramer [Sat, 1 Jan 2011 21:04:42 +0000 (21:04 +0000)]
More empty directory removal.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122668 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoRemove empty directories.
Nick Lewycky [Sat, 1 Jan 2011 20:51:16 +0000 (20:51 +0000)]
Remove empty directories.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122665 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoRemove stray emacs mode markers in all these files that was causing emacs to
Nick Lewycky [Fri, 31 Dec 2010 17:31:54 +0000 (17:31 +0000)]
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

13 years agoMSVC doesn't require an accessible copy-constructor when binding a temporary class...
Francois Pichet [Fri, 31 Dec 2010 10:43:42 +0000 (10:43 +0000)]
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

13 years agoAdd support for declaring register contraints in variables. They are only used
Rafael Espindola [Thu, 30 Dec 2010 22:59:32 +0000 (22:59 +0000)]
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

13 years agoCorrect function name in comment.
Nick Lewycky [Thu, 30 Dec 2010 20:21:55 +0000 (20:21 +0000)]
Correct function name in comment.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122640 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoExpose Objective-C type encodings of declarations to libclang users. This also adds...
David Chisnall [Thu, 30 Dec 2010 14:05:53 +0000 (14:05 +0000)]
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

13 years agoSimplify mem{cpy, move, set} creation with IRBuilder.
Benjamin Kramer [Thu, 30 Dec 2010 00:13:21 +0000 (00:13 +0000)]
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

13 years agoFix PR8796.
Rafael Espindola [Wed, 29 Dec 2010 23:02:58 +0000 (23:02 +0000)]
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

13 years agoset features for k8-sse3
Roman Divacky [Wed, 29 Dec 2010 13:28:29 +0000 (13:28 +0000)]
set features for k8-sse3

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122629 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdded scalar casts test.
Abramo Bagnara [Tue, 28 Dec 2010 17:19:27 +0000 (17:19 +0000)]
Added scalar casts test.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122599 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoCanonicalize types before possible cast.
Abramo Bagnara [Tue, 28 Dec 2010 09:13:41 +0000 (09:13 +0000)]
Canonicalize types before possible cast.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122592 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoMore __uuidof validation:
Francois Pichet [Mon, 27 Dec 2010 01:32:00 +0000 (01:32 +0000)]
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

13 years agoAdd support for GNU runtime property set / get structure functions. Minor refactorin...
David Chisnall [Sun, 26 Dec 2010 22:13:16 +0000 (22:13 +0000)]
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

13 years agoFix for PR8695.
David Chisnall [Sun, 26 Dec 2010 20:12:30 +0000 (20:12 +0000)]
Fix for PR8695.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122564 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoThe -fshort-wchar option causes wchar_t to become unsigned, in addition to being
Chris Lattner [Sat, 25 Dec 2010 23:25:43 +0000 (23:25 +0000)]
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

13 years agoRemove all uses of PathV1::GetRootDirectory.
Michael J. Spencer [Sat, 25 Dec 2010 20:09:27 +0000 (20:09 +0000)]
Remove all uses of PathV1::GetRootDirectory.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122552 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd basic support for pointer arithmetic in
Ted Kremenek [Fri, 24 Dec 2010 08:39:33 +0000 (08:39 +0000)]
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

13 years agoRemove the EntoSA directories.
Argyrios Kyrtzidis [Fri, 24 Dec 2010 06:19:58 +0000 (06:19 +0000)]
Remove the EntoSA directories.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122543 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agodon't use #pragma mark, it isn't portable.
Chris Lattner [Fri, 24 Dec 2010 04:45:23 +0000 (04:45 +0000)]
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

13 years agoifndef _MSC_VER out #pragma mark on MSVC. It still tries to parse the text even
Michael J. Spencer [Fri, 24 Dec 2010 04:07:39 +0000 (04:07 +0000)]
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

13 years agoHandle locations coming from macro instantiations properly in SourceManager::isBefore...
Argyrios Kyrtzidis [Fri, 24 Dec 2010 02:53:53 +0000 (02:53 +0000)]
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

13 years agoRefactor how we collect attributes during parsing, and add slots for attributes
John McCall [Fri, 24 Dec 2010 02:08:15 +0000 (02:08 +0000)]
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

13 years agoFix a thinko in a helper routine for template argument deduction that
Douglas Gregor [Fri, 24 Dec 2010 00:35:52 +0000 (00:35 +0000)]
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

13 years agoNon-type template parameter packs cannot have default arguments.
Douglas Gregor [Fri, 24 Dec 2010 00:20:52 +0000 (00:20 +0000)]
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

13 years agoWhen instantiating a non-type template parameter pack, be sure to
Douglas Gregor [Fri, 24 Dec 2010 00:15:10 +0000 (00:15 +0000)]
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

13 years agoAdd an AST representation for non-type template parameter
Douglas Gregor [Thu, 23 Dec 2010 23:51:58 +0000 (23:51 +0000)]
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

13 years agoImprove the diagnostic and recovery for missing colons after 'case'
Douglas Gregor [Thu, 23 Dec 2010 22:56:40 +0000 (22:56 +0000)]
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

13 years agoImplement parsing of function parameter packs and non-type template
Douglas Gregor [Thu, 23 Dec 2010 22:44:42 +0000 (22:44 +0000)]
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

13 years agoAdd -fobjc-default-synthesized-properties flag
Ted Kremenek [Thu, 23 Dec 2010 21:35:43 +0000 (21:35 +0000)]
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

13 years agoChris Lattner has strong opinions about directory
Ted Kremenek [Thu, 23 Dec 2010 19:38:26 +0000 (19:38 +0000)]
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

13 years agoKill RecordType::getAddressSpace() and its fixme; that's just not how
John McCall [Thu, 23 Dec 2010 17:56:54 +0000 (17:56 +0000)]
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

13 years agoReimplement the comparison of a class template partial
Douglas Gregor [Thu, 23 Dec 2010 17:13:55 +0000 (17:13 +0000)]
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

13 years agoWhen forming the injected-class-name of a variadic template, the
Douglas Gregor [Thu, 23 Dec 2010 16:00:30 +0000 (16:00 +0000)]
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

13 years agoWhen cast derived to base, only process MemRegionVal.
Zhongxing Xu [Thu, 23 Dec 2010 12:08:42 +0000 (12:08 +0000)]
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

13 years agoRename headers: 'clang/GR' 'clang/EntoSA' and
Ted Kremenek [Thu, 23 Dec 2010 07:22:02 +0000 (07:22 +0000)]
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

13 years agoRename static analyzer namespace 'GR' to 'ento'.
Ted Kremenek [Thu, 23 Dec 2010 07:20:52 +0000 (07:20 +0000)]
Rename static analyzer namespace 'GR' to 'ento'.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122492 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoRemove lib/Checker directory.
Zhongxing Xu [Thu, 23 Dec 2010 05:22:43 +0000 (05:22 +0000)]
Remove lib/Checker directory.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122475 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoIt's amazing what you find when you actually
Ted Kremenek [Thu, 23 Dec 2010 02:42:49 +0000 (02:42 +0000)]
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

13 years agoFurther tweak nonloc::ConcreteInt pretty printing
Ted Kremenek [Thu, 23 Dec 2010 02:42:46 +0000 (02:42 +0000)]
Further tweak nonloc::ConcreteInt pretty printing
to correctly print out negative values for
signed integers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122470 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd WIP prototype of a new buffer overflow
Ted Kremenek [Thu, 23 Dec 2010 02:42:43 +0000 (02:42 +0000)]
Add WIP prototype of a new buffer overflow
checker based on using raw (symbolic) byte offsets
from a base region.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122469 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoChange MemRegion extent type to be the same type used
Ted Kremenek [Thu, 23 Dec 2010 02:42:36 +0000 (02:42 +0000)]
Change MemRegion extent type to be the same type used
for array indices.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122468 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd 'getConditionType()' and 'getArrayIndexType()'
Ted Kremenek [Thu, 23 Dec 2010 02:42:34 +0000 (02:42 +0000)]
Add 'getConditionType()' and 'getArrayIndexType()'
to SValBuilder.  These two query methods are useful
for constructing SVals.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122467 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoEnhance pretty-printing for nonloc::ConcreteInt
Ted Kremenek [Thu, 23 Dec 2010 02:42:31 +0000 (02:42 +0000)]
Enhance pretty-printing for nonloc::ConcreteInt
to also include signedness and bitwidth of
the underlying integer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122466 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoImplement the part of C++0x [temp.arg.explicit]p3 that pertains to
Douglas Gregor [Thu, 23 Dec 2010 01:52:01 +0000 (01:52 +0000)]
Implement the part of C++0x [temp.arg.explicit]p3 that pertains to
parameter packs. In particular, a parameter pack not otherwise deduced
is deduced to an empty parameter pack.

The C++0x wording here is a bit unfortunate; this should really only
apply to function templates, and it mentions "trailing" parameter
packs, which doesn't really make sense in the context of function
templates. Will file a core issue separately.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122463 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoImplement the rest of C++0x [temp.deduct.type]p9, which specifies that
Douglas Gregor [Thu, 23 Dec 2010 01:24:45 +0000 (01:24 +0000)]
Implement the rest of C++0x [temp.deduct.type]p9, which specifies that
the presence of a pack expansion anywhere except at the end of a
template-argument-list causes the entire template-argument-list to be
a non-deduced context.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122461 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoChange all self assignments X=X to (void)X, so that we can turn on a
Jeffrey Yasskin [Thu, 23 Dec 2010 01:01:28 +0000 (01:01 +0000)]
Change all self assignments X=X to (void)X, so that we can turn on a
new gcc warning that complains on self-assignments and
self-initializations.  Fix one bug found by the warning, in which one
clang::OverloadCandidate constructor failed to initialize its
FunctionTemplate member.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122459 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoBe paranoid about NULL size expressions in dependently-sized array types
Douglas Gregor [Wed, 22 Dec 2010 23:15:38 +0000 (23:15 +0000)]
Be paranoid about NULL size expressions in dependently-sized array types

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122454 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoUnify the consistency checking for deduced template arguments into a
Douglas Gregor [Wed, 22 Dec 2010 23:09:49 +0000 (23:09 +0000)]
Unify the consistency checking for deduced template arguments into a
single routine. Extend that routine to handle consistency
checking for template argument packs, so that we can compare the
deduced packs for template parameter packs across different pack
expansions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122452 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agobuild: Use CLANG_NO_RUNTIME=1 specifically, not just any definition.
Daniel Dunbar [Wed, 22 Dec 2010 22:23:39 +0000 (22:23 +0000)]
build: Use CLANG_NO_RUNTIME=1 specifically, not just any definition.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122449 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoSubsequent attempt to fix linux build.
Argyrios Kyrtzidis [Wed, 22 Dec 2010 21:41:01 +0000 (21:41 +0000)]
Subsequent attempt to fix linux build.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122442 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoImplement template argument deduction for pack expansions whose
Douglas Gregor [Wed, 22 Dec 2010 21:19:48 +0000 (21:19 +0000)]
Implement template argument deduction for pack expansions whose
pattern is a template argument, which involves repeatedly deducing
template arguments using the pattern of the pack expansion, then
bundling the resulting deductions into an argument pack.

We can now handle a variety of simple list-handling metaprograms using
variadic templates. See, e.g., the new "count" metaprogram.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122439 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoApparently I'm on a mission to break as many builds as possible.
Argyrios Kyrtzidis [Wed, 22 Dec 2010 21:10:38 +0000 (21:10 +0000)]
Apparently I'm on a mission to break as many builds as possible.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122436 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoForgot to move the files in CMakeLists.txt.
Argyrios Kyrtzidis [Wed, 22 Dec 2010 20:30:07 +0000 (20:30 +0000)]
Forgot to move the files in CMakeLists.txt.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122433 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd GR/Checkers subdir for CMake build.
Argyrios Kyrtzidis [Wed, 22 Dec 2010 20:22:35 +0000 (20:22 +0000)]
Add GR/Checkers subdir for CMake build.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122432 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoMove AnalysisConsumer.cpp and ExprEngine.cpp into the Checkers subdir temporarily
Argyrios Kyrtzidis [Wed, 22 Dec 2010 20:15:43 +0000 (20:15 +0000)]
Move AnalysisConsumer.cpp and ExprEngine.cpp into the Checkers subdir temporarily
to avoid cyclic dependency between the libraries and fix the linux build.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122431 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoComplain on missing property getter method only
Fariborz Jahanian [Wed, 22 Dec 2010 19:46:35 +0000 (19:46 +0000)]
Complain on missing property getter method only
if property-dot expression is decidedly
an rvalue. // rdar://8155806.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122430 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoWhen performing template argument deduction where the argument is a
Douglas Gregor [Wed, 22 Dec 2010 18:55:49 +0000 (18:55 +0000)]
When performing template argument deduction where the argument is a
dependent template specialization type, the number of template
arguments need not match precisely. Rather than checking the number of
arguments eagerly (which does not consider argument packs), let the
deduction routine for template argument lists cope with too many/too
few arguments.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122425 91177308-0d34-0410-b5e6-96231b3b80d8

13 years ago[analyzer] Refactoring: Drop the 'GR' prefix.
Argyrios Kyrtzidis [Wed, 22 Dec 2010 18:53:44 +0000 (18:53 +0000)]
[analyzer] Refactoring: Drop the 'GR' prefix.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122424 91177308-0d34-0410-b5e6-96231b3b80d8

13 years ago[analyzer] Refactoring: Move stuff into namespace 'GR'.
Argyrios Kyrtzidis [Wed, 22 Dec 2010 18:53:20 +0000 (18:53 +0000)]
[analyzer] Refactoring: Move stuff into namespace 'GR'.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122423 91177308-0d34-0410-b5e6-96231b3b80d8

13 years ago[analyzer] Refactoring: Move checkers into lib/GR/Checkers and their own library...
Argyrios Kyrtzidis [Wed, 22 Dec 2010 18:52:56 +0000 (18:52 +0000)]
[analyzer] Refactoring: Move checkers into lib/GR/Checkers and their own library, libclangGRCheckers

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122422 91177308-0d34-0410-b5e6-96231b3b80d8

13 years ago[analyzer] Refactoring: lib/Checker -> lib/GR and libclangChecker -> libclangGRCore
Argyrios Kyrtzidis [Wed, 22 Dec 2010 18:52:29 +0000 (18:52 +0000)]
[analyzer] Refactoring: lib/Checker -> lib/GR and libclangChecker -> libclangGRCore

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122421 91177308-0d34-0410-b5e6-96231b3b80d8

13 years ago[analyzer] Refactoring: include/clang/Checker -> include/clang/GR
Argyrios Kyrtzidis [Wed, 22 Dec 2010 18:51:49 +0000 (18:51 +0000)]
[analyzer] Refactoring: include/clang/Checker -> include/clang/GR

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122420 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoImplicitly expand argument packs when performing template argument
Douglas Gregor [Wed, 22 Dec 2010 18:17:10 +0000 (18:17 +0000)]
Implicitly expand argument packs when performing template argument
deduction. Unify all of the looping over template arguments for
deduction purposes into a single place, where argument pack expansion
occurs; this is also the hook for deducing from pack expansions, which
itself is not yet implemented.

For now, at least we can handle a basic "count" metafunction written
with variadics. See the new test for the formulation that works.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122418 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoIf the unary operator is prefix and an lvalue (in C++), bind
Zhongxing Xu [Wed, 22 Dec 2010 08:38:13 +0000 (08:38 +0000)]
If the unary operator is prefix and an lvalue (in C++), bind
the location (l-value) to it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122396 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoIntroduced raw_identifier token kind.
Abramo Bagnara [Wed, 22 Dec 2010 08:23:18 +0000 (08:23 +0000)]
Introduced raw_identifier token kind.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122394 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoThe base type is not always pointer type. We may cast to a base reference.
Zhongxing Xu [Wed, 22 Dec 2010 08:12:57 +0000 (08:12 +0000)]
The base type is not always pointer type. We may cast to a base reference.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122393 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAlways blast through no-op casts when getting expr SVals.
Zhongxing Xu [Wed, 22 Dec 2010 07:40:30 +0000 (07:40 +0000)]
Always blast through no-op casts when getting expr SVals.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122390 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAfter inlining the CXXConstructExpr, bind the temporary object region to it.
Zhongxing Xu [Wed, 22 Dec 2010 07:20:27 +0000 (07:20 +0000)]
After inlining the CXXConstructExpr, bind the temporary object region to it.
This change is necessary when the variable is a const reference and we need
the l-value of the construct expr.  After that, when binding the variable,
recover the lazy compound value when the variable is not a reference.

In Environment, use the value of a no-op cast expression when it has one.
Otherwise, blast-through it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122388 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoRedesign the way anonymous fields are handled in designated-initializers.
Francois Pichet [Wed, 22 Dec 2010 03:46:10 +0000 (03:46 +0000)]
Redesign the way anonymous fields are handled in designated-initializers.
Previously designated anonymous fields were found via name lookup. This redesign uses the fact that an IndirectFieldDecl declaration will always follow an anonymous implicit field to remove the special case of name lookup.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122387 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoTweak the checking of class template partial specialization arguments
Douglas Gregor [Tue, 21 Dec 2010 22:27:23 +0000 (22:27 +0000)]
Tweak the checking of class template partial specialization arguments
to cope with parameter packs. This is a band-aid I will be
revisiting this section when I implement declaration matching
semantics for variadic templates.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122369 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd a hack to work around the lack of proper type-source info in a pack expansion...
Douglas Gregor [Tue, 21 Dec 2010 22:10:26 +0000 (22:10 +0000)]
Add a hack to work around the lack of proper type-source info in a pack expansion TypeLoc

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122367 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd some const qualifiers
Douglas Gregor [Tue, 21 Dec 2010 21:51:48 +0000 (21:51 +0000)]
Add some const qualifiers

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122365 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFor member pointer conversions potentially involving derived-to-base
Douglas Gregor [Tue, 21 Dec 2010 21:40:41 +0000 (21:40 +0000)]
For member pointer conversions potentially involving derived-to-base
conversions, make sure that the (possibly) derived type is complete
before looking for base classes.

Finishes the fix for PR8801.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122363 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoWhen searching for the instantiation of a locally-scoped tag
Douglas Gregor [Tue, 21 Dec 2010 21:22:51 +0000 (21:22 +0000)]
When searching for the instantiation of a locally-scoped tag
declaration, also look for an instantiation of its previous
declarations. Fixes PR8801.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122361 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoIn C++, if the user redeclares a builtin function with a type that is
Douglas Gregor [Tue, 21 Dec 2010 19:47:46 +0000 (19:47 +0000)]
In C++, if the user redeclares a builtin function with a type that is
inconsistent with the type that the builtin *should* have, forget
about the builtin altogether: we don't want subsequence analyses,
CodeGen, etc., to think that we have a proper builtin function.

C is protected from errors here because it allows one to use a
library builtin without having a declaration, and detects inconsistent
(re-)declarations of builtins during declaration merging. C++ was
unprotected, and therefore would crash.

Fixes PR8839.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122351 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoWhen determining which preprocessed entities to traverse in libclang,
Douglas Gregor [Tue, 21 Dec 2010 19:07:48 +0000 (19:07 +0000)]
When determining which preprocessed entities to traverse in libclang,
take into account the region of interest. Otherwise, we may fail to
traverse some important preprocessed entity cursors.
Fixes <rdar://problem/8554072>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122350 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFix test to be platform-agnostic
Douglas Gregor [Tue, 21 Dec 2010 17:52:09 +0000 (17:52 +0000)]
Fix test to be platform-agnostic

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122348 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFix a major inconsistency in the representation of Objective-C
Douglas Gregor [Tue, 21 Dec 2010 17:34:17 +0000 (17:34 +0000)]
Fix a major inconsistency in the representation of Objective-C
classes, categories, protocols, and class extensions, where the
methods and properties of these entities would be inserted into the
DeclContext in an ordering that doesn't necessarily reflect source
order. The culprits were Sema::ActOnMethodDeclaration(), which did not
perform the insertion of the just-created method declaration into
the DeclContext for these Objective-C entities, and
Sema::ActOnAtEnd(), which inserted all method declarations at the
*end* of the DeclContext.

With this fix in hand, clean up the code-completion actions for
property setters/getters that worked around this brokenness in the AST.

Fixes <rdar://problem/8062781>, where this problem manifested as poor
token-annotation information, but this would have struck again in many
other places.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122347 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoReplace all uses of PathV1::makeAbsolute with PathV2::fs::make_absolute.
Michael J. Spencer [Tue, 21 Dec 2010 16:45:57 +0000 (16:45 +0000)]
Replace all uses of PathV1::makeAbsolute with PathV2::fs::make_absolute.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122340 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFix spelling.
Michael J. Spencer [Tue, 21 Dec 2010 16:45:42 +0000 (16:45 +0000)]
Fix spelling.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122339 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoImplement BlockDecl::getSourceRange(). The bogus source-range
Douglas Gregor [Tue, 21 Dec 2010 16:27:07 +0000 (16:27 +0000)]
Implement BlockDecl::getSourceRange(). The bogus source-range
information caused token-annotation to fail in funny ways. Fixes
<rdar://problem/8595386>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122338 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd test for C++ [temp.friend]p8, which bans partial specializations from being friends
Douglas Gregor [Tue, 21 Dec 2010 16:05:12 +0000 (16:05 +0000)]
Add test for C++ [temp.friend]p8, which bans partial specializations from being friends

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122335 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoA class template partial specialization cannot be a friend. Fixes PR8649.
Douglas Gregor [Tue, 21 Dec 2010 08:14:57 +0000 (08:14 +0000)]
A class template partial specialization cannot be a friend. Fixes PR8649.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122325 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoTeach clang_getCursorSemanticParent() and
Douglas Gregor [Tue, 21 Dec 2010 07:55:45 +0000 (07:55 +0000)]
Teach clang_getCursorSemanticParent() and
clang_getCursorLexicalParent() to cope with class and function
templates, along with the parent of the translation unit. Fixes PR8761
and PR8766.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122324 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoWhen checking a using declaration, make sure that the context we're
Douglas Gregor [Tue, 21 Dec 2010 07:41:49 +0000 (07:41 +0000)]
When checking a using declaration, make sure that the context we're
looking in is complete. Fixes PR8756.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122323 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoDon't try to compute the value of a value-dependent expression when
Douglas Gregor [Tue, 21 Dec 2010 07:22:56 +0000 (07:22 +0000)]
Don't try to compute the value of a value-dependent expression when
checking trivial comparisons. Fixes PR8795.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122322 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoInitialize LangOptions::MSCVersion. Thanks to Csaba Raduly for noting the omission
Douglas Gregor [Tue, 21 Dec 2010 06:21:20 +0000 (06:21 +0000)]
Initialize LangOptions::MSCVersion. Thanks to Csaba Raduly for noting the omission

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122318 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd back the late-specified return type paper
Douglas Gregor [Tue, 21 Dec 2010 05:54:22 +0000 (05:54 +0000)]
Add back the late-specified return type paper

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122317 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoUpdates to the C++ status page for C++0x features, from Michael Price
Douglas Gregor [Tue, 21 Dec 2010 05:43:31 +0000 (05:43 +0000)]
Updates to the C++ status page for C++0x features, from Michael Price

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122315 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd IndirectField case in DeclContextPrinter::PrintDeclContext.
Francois Pichet [Tue, 21 Dec 2010 03:08:02 +0000 (03:08 +0000)]
Add IndirectField case in DeclContextPrinter::PrintDeclContext.
Fix PR8832.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122311 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoadd missing newlines at end of file.
Chris Lattner [Tue, 21 Dec 2010 02:36:58 +0000 (02:36 +0000)]
add missing newlines at end of file.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122309 91177308-0d34-0410-b5e6-96231b3b80d8