]> granicus.if.org Git - clang/log
clang
13 years agoAdd more parser tests for the override control keywords.
Anders Carlsson [Thu, 20 Jan 2011 03:41:12 +0000 (03:41 +0000)]
Add more parser tests for the override control keywords.

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

13 years agoTurns out that the previous commit also fixes this :-)
Rafael Espindola [Thu, 20 Jan 2011 02:57:51 +0000 (02:57 +0000)]
Turns out that the previous commit also fixes this :-)

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

13 years agoFix PR8884 by skipping transparent contexts. The test is for LikageSpec. I
Rafael Espindola [Thu, 20 Jan 2011 02:26:24 +0000 (02:26 +0000)]
Fix PR8884 by skipping transparent contexts. The test is for LikageSpec. I
failed to find a case where an enum context would make a difference, but
found PR9007 on the way.

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

13 years agoAdd CharUnits::RoundUpToAlignment() to simplify rounding in character units.
Ken Dyck [Thu, 20 Jan 2011 01:59:55 +0000 (01:59 +0000)]
Add CharUnits::RoundUpToAlignment() to simplify rounding in character units.

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

13 years agoWhen building a user-defined conversion sequence, keep track of the
Douglas Gregor [Thu, 20 Jan 2011 01:32:05 +0000 (01:32 +0000)]
When building a user-defined conversion sequence, keep track of the
declaration that name lookup actually found, so that we can use it for
access checking later on. Fixes <rdar://problem/8876150>.

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

13 years agoSema::BuildCXXMemberCallExpr() can fail due to access or ambiguities,
Douglas Gregor [Thu, 20 Jan 2011 00:18:04 +0000 (00:18 +0000)]
Sema::BuildCXXMemberCallExpr() can fail due to access or ambiguities,
so allow it to propagate the failure outward. Fixes the crashing part
of <rdar://problem/8876150>.

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

13 years agoExplicitly track the number of call arguments provided when performing
Douglas Gregor [Wed, 19 Jan 2011 23:54:39 +0000 (23:54 +0000)]
Explicitly track the number of call arguments provided when performing
overload resolution, so that we only use that number of call arguments
for partial ordering. Fixes PR9006, a recent regression.

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

13 years agoEradicate any mention of C++0x concepts.
Douglas Gregor [Wed, 19 Jan 2011 23:15:20 +0000 (23:15 +0000)]
Eradicate any mention of C++0x concepts.

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

13 years agoVariadic templates are fully implemented.
Douglas Gregor [Wed, 19 Jan 2011 22:11:50 +0000 (22:11 +0000)]
Variadic templates are fully implemented.

Turn on the __has_feature switch for variadic templates, document
their completion, and put the ExtWarn into the c++0x-extensions
warning group.

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

13 years agoDowngrade the "variadic templates are a C++0x feature" error to an
Douglas Gregor [Wed, 19 Jan 2011 21:59:15 +0000 (21:59 +0000)]
Downgrade the "variadic templates are a C++0x feature" error to an
ExtWarn. We want variadic templates to be usable in libc++/libstdc++
headers even when we're in C++98/03 mode, since it's the only clean
way to implement TR1 <functional>.

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

13 years agoRefactor the dependence computation for DeclRefExpr so that we can
Douglas Gregor [Wed, 19 Jan 2011 21:52:31 +0000 (21:52 +0000)]
Refactor the dependence computation for DeclRefExpr so that we can
reuse it for BlockDeclRefExpr. Do so, fixing the dependence calculate
for BlockDeclRefExpr.

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

13 years agoImplement basic support for the use of variadic templates and blocks
Douglas Gregor [Wed, 19 Jan 2011 21:32:01 +0000 (21:32 +0000)]
Implement basic support for the use of variadic templates and blocks
together. In particular:
  - Handle the use of captured parameter pack names within blocks
  (BlockDeclRefExpr understands parameter packs now)
  - Handle the declaration and expansion of parameter packs within a block's
  parameter list, e.g., ^(Args ...args) { ... })
  - Handle instantiation of blocks where the return type was not
  explicitly specified. (unrelated, but necessary for my tests).

Together, these fixes should make blocks and variadic templates work
reasonably well together. Note that BlockDeclRefExpr is still broken
w.r.t. its computation of type and value dependence, which will still
cause problems for blocks in templates.

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

13 years agoTeach libclang to generate USRs containing parameter packs and pack expansions.
Douglas Gregor [Wed, 19 Jan 2011 20:50:07 +0000 (20:50 +0000)]
Teach libclang to generate USRs containing parameter packs and pack expansions.

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

13 years agoTeach libclang about SizeOfPackExpr.
Douglas Gregor [Wed, 19 Jan 2011 20:34:17 +0000 (20:34 +0000)]
Teach libclang about SizeOfPackExpr.

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

13 years agoImplement support for non-type template parameter packs whose type is
Douglas Gregor [Wed, 19 Jan 2011 20:10:05 +0000 (20:10 +0000)]
Implement support for non-type template parameter packs whose type is
a pack expansion, e.g., the parameter pack Values in:

  template<typename ...Types>
  struct Outer {
    template<Types ...Values>
    struct Inner;
  };

This new implementation approach introduces the notion of an
"expanded" non-type template parameter pack, for which we have already
expanded the types of the parameter pack (to, say, "int*, float*",
for Outer<int*, float*>) but have not yet expanded the values. Aside
from creating these expanded non-type template parameter packs, this
patch updates template argument checking and non-type template
parameter pack instantiation to make use of the appropriate types in
the parameter pack.

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

13 years agoNonTypeTemplateParmDecls always have TypeSourceInfo. There's no sense
Douglas Gregor [Wed, 19 Jan 2011 17:02:02 +0000 (17:02 +0000)]
NonTypeTemplateParmDecls always have TypeSourceInfo. There's no sense
in pretending otherwise.

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

13 years agoWarn about the use of unparenthesized |= in conditionals (which may be
Douglas Gregor [Wed, 19 Jan 2011 16:50:08 +0000 (16:50 +0000)]
Warn about the use of unparenthesized |= in conditionals (which may be
a typo for !=). Fixes PR9001, from Hans Wennborg!

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

13 years agoParse the optional semicolon after a C++ in-class member function
Douglas Gregor [Wed, 19 Jan 2011 16:41:58 +0000 (16:41 +0000)]
Parse the optional semicolon after a C++ in-class member function
definition, rather than complaining about it. Problem reported by
Marshall Clow.

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

13 years agoWhen building the copy expression for a __block variable, make sure
John McCall [Wed, 19 Jan 2011 11:48:09 +0000 (11:48 +0000)]
When building the copy expression for a __block variable, make sure
there's a respectable point of instantiation.  Also, make sure we do
this operation even when instantiating a dependently-typed variable.

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

13 years agoChange the canonical representation of array types to store qualifiers on the
John McCall [Wed, 19 Jan 2011 10:06:00 +0000 (10:06 +0000)]
Change the canonical representation of array types to store qualifiers on the
outermost array types and not on the element type.  Move the CanonicalType
member from Type to ExtQualsTypeCommonBase;  the canonical type on an ExtQuals
node includes the qualifiers on the ExtQuals.  Assorted optimizations enabled
by this change.

getQualifiers(), hasQualifiers(), etc. should all now implicitly look through
array types.

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

13 years agoChange QualType::getTypePtr() to return a const pointer, then change a
John McCall [Wed, 19 Jan 2011 06:33:43 +0000 (06:33 +0000)]
Change QualType::getTypePtr() to return a const pointer, then change a
thousand other things which were (generally inadvertantly) relying on that.

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

13 years agoFix name to match reality.
Nick Lewycky [Wed, 19 Jan 2011 05:59:39 +0000 (05:59 +0000)]
Fix name to match reality.

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

13 years agoReplace calls to getTypeSize() and getTypeAlign() with their 'InChars'
Ken Dyck [Wed, 19 Jan 2011 01:58:38 +0000 (01:58 +0000)]
Replace calls to getTypeSize() and getTypeAlign() with their 'InChars'
counterparts where char units are needed.

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

13 years agoAdd a unary minus operator.
Ken Dyck [Wed, 19 Jan 2011 01:44:40 +0000 (01:44 +0000)]
Add a unary minus operator.

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

13 years agoEmit DW_TAG_lexical_scope to surround foreach.
Devang Patel [Wed, 19 Jan 2011 01:36:36 +0000 (01:36 +0000)]
Emit DW_TAG_lexical_scope to surround foreach.

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

13 years agoDon't silently drop warning flags passed in to
Douglas Gregor [Wed, 19 Jan 2011 01:02:47 +0000 (01:02 +0000)]
Don't silently drop warning flags passed in to
clang_createTranslationUnitFromSourceFile().

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

13 years agolib/Sema/SemaExpr.cpp: __null should be LongLongTy on LLP64 Win64.
NAKAMURA Takumi [Wed, 19 Jan 2011 00:11:41 +0000 (00:11 +0000)]
lib/Sema/SemaExpr.cpp: __null should be LongLongTy on LLP64 Win64.

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

13 years agolib/CodeGen/TargetInfo.cpp: Fix coding style and erase an obsolete comment.
NAKAMURA Takumi [Wed, 19 Jan 2011 00:11:33 +0000 (00:11 +0000)]
lib/CodeGen/TargetInfo.cpp: Fix coding style and erase an obsolete comment.

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

13 years agoTeach UninitializedValuesV2 to implicitly reason about C++
Ted Kremenek [Tue, 18 Jan 2011 21:18:58 +0000 (21:18 +0000)]
Teach UninitializedValuesV2 to implicitly reason about C++
references by monitoring whether an access to
a variable is solely to compute it's lvalue or
to do an lvalue-to-rvalue conversion (i.e., a load).

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

13 years agoAdd unnamed_addr in CreateRuntimeVariable.
Rafael Espindola [Tue, 18 Jan 2011 21:07:57 +0000 (21:07 +0000)]
Add unnamed_addr in CreateRuntimeVariable.

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

13 years agoWhen redefining a macro don't warn twice if it's not used and don't warn for duplicate
Argyrios Kyrtzidis [Tue, 18 Jan 2011 19:50:15 +0000 (19:50 +0000)]
When redefining a macro don't warn twice if it's not used and don't warn for duplicate
definition by command line options. Fixes rdar://8875916.

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

13 years agoProperly do a float -> _Complex double conversion, fixes rdar://8875946.
Argyrios Kyrtzidis [Tue, 18 Jan 2011 18:49:33 +0000 (18:49 +0000)]
Properly do a float -> _Complex double conversion, fixes rdar://8875946.

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

13 years agoComment a wacky test case
Douglas Gregor [Tue, 18 Jan 2011 18:38:18 +0000 (18:38 +0000)]
Comment a wacky test case

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

13 years agoFix some unnecessarily complicated code for canonicalizing variably-modified
John McCall [Tue, 18 Jan 2011 08:40:38 +0000 (08:40 +0000)]
Fix some unnecessarily complicated code for canonicalizing variably-modified
parameter types.

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

13 years agoGeneralize some operations on qualifiers. QualType::getQualifiers() and
John McCall [Tue, 18 Jan 2011 07:41:22 +0000 (07:41 +0000)]
Generalize some operations on qualifiers.  QualType::getQualifiers() and
::getCVRQualifiers() now look through array types, like all the other
standard queries.  Also, make a 'split' variant of getUnqualifiedType().

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

13 years agoFix newlines.
Daniel Dunbar [Tue, 18 Jan 2011 05:36:08 +0000 (05:36 +0000)]
Fix newlines.

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

13 years agotests: Force a triple.
Daniel Dunbar [Tue, 18 Jan 2011 05:36:03 +0000 (05:36 +0000)]
tests: Force a triple.

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

13 years agoAdd support for explicit constructor calls in Microsoft mode.
Francois Pichet [Tue, 18 Jan 2011 05:04:39 +0000 (05:04 +0000)]
Add support for explicit constructor calls in Microsoft mode.
For example:

class A{
public:
  A& operator=(const A& that) {
      if (this != &that) {
          this->A::~A();
          this->A::A(that);  // <=== explicit constructor call.
      }
      return *this;
  }
};

More work will be needed to support an explicit call to a template constructor.

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

13 years agoCorrectly enable test/Sema/unit-variables.c,
Ted Kremenek [Tue, 18 Jan 2011 05:00:42 +0000 (05:00 +0000)]
Correctly enable test/Sema/unit-variables.c,
thus identifying a minor logical flaw in
UninitializedValuesV2.cpp.

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

13 years agoTeach UninitializedValuesV2 about "int x = x" and
Ted Kremenek [Tue, 18 Jan 2011 04:53:25 +0000 (04:53 +0000)]
Teach UninitializedValuesV2 about "int x = x" and
also properly handle confluence of loops.

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

13 years agoGet clang-wpa to build in TOT (reflecting updates
Ted Kremenek [Tue, 18 Jan 2011 04:22:19 +0000 (04:22 +0000)]
Get clang-wpa to build in TOT (reflecting updates
to the static analyzer).

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

13 years agoIntroduce the notion of a "minimal" import of ASTs, to better support LLDB.
Douglas Gregor [Tue, 18 Jan 2011 03:11:38 +0000 (03:11 +0000)]
Introduce the notion of a "minimal" import of ASTs, to better support LLDB.

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

13 years agoReplace calls to CharUnits::fromQuantity() with ones to
Ken Dyck [Tue, 18 Jan 2011 02:01:14 +0000 (02:01 +0000)]
Replace calls to CharUnits::fromQuantity() with ones to
ASTContext::toCharUnitsFromBits() when converting from bit sizes to char units.

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

13 years agoFix warnings found by gcc-4.6, from -Wunused-but-set-variable and
Jeffrey Yasskin [Tue, 18 Jan 2011 02:00:16 +0000 (02:00 +0000)]
Fix warnings found by gcc-4.6, from -Wunused-but-set-variable and
-Wint-to-pointer-cast.

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

13 years agoReplace calls to CharUnits::fromQuantity() with ones
Ken Dyck [Tue, 18 Jan 2011 01:56:16 +0000 (01:56 +0000)]
Replace calls to CharUnits::fromQuantity() with ones
ASTContext::toCharUnitsFromBits() when converting from bit sizes to char units.

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

13 years agolib/CodeGen/TargetInfo.cpp: Add Win64 calling conversion.
NAKAMURA Takumi [Mon, 17 Jan 2011 22:56:31 +0000 (22:56 +0000)]
lib/CodeGen/TargetInfo.cpp: Add Win64 calling conversion.

FIXME: It would be incompatible to Microsoft's in one point.
On mingw64-gcc, {i128} is expanded for args and returned as {rax, rdx}.

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

13 years agolib/Basic/Targets.cpp: __builtin_va_list is as same on win64 mingw64!
NAKAMURA Takumi [Mon, 17 Jan 2011 22:56:23 +0000 (22:56 +0000)]
lib/Basic/Targets.cpp: __builtin_va_list is as same on win64 mingw64!

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

13 years agolib/Basic/Targets.cpp: Fix __declspec() on Mingw-w64.
NAKAMURA Takumi [Mon, 17 Jan 2011 22:56:16 +0000 (22:56 +0000)]
lib/Basic/Targets.cpp: Fix __declspec() on Mingw-w64.

It should be defined as-is. Some headers would detect existence of __declspec and use one.

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

13 years agolib/Basic/Targets.cpp: Set user_label_prefix on Win64 both mingw and msvc.
NAKAMURA Takumi [Mon, 17 Jan 2011 22:56:08 +0000 (22:56 +0000)]
lib/Basic/Targets.cpp: Set user_label_prefix on Win64 both mingw and msvc.

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

13 years agoSimplify.
Devang Patel [Mon, 17 Jan 2011 22:23:07 +0000 (22:23 +0000)]
Simplify.

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

13 years agoMore unnamed_addr.
Rafael Espindola [Mon, 17 Jan 2011 22:22:52 +0000 (22:22 +0000)]
More unnamed_addr.

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

13 years agomerge strings created by
Rafael Espindola [Mon, 17 Jan 2011 22:11:21 +0000 (22:11 +0000)]
merge strings created by
const NSConstantString *appKey =  @"MyApp";

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

13 years agoNetBSD, OpenBSD, and Dragonfly BSD also have arc4random. Patch from
Douglas Gregor [Mon, 17 Jan 2011 19:16:24 +0000 (19:16 +0000)]
NetBSD, OpenBSD, and Dragonfly BSD also have arc4random. Patch from
Joerg Sonnenberger!

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

13 years agoAdd missing <cctype> include, from Joerg Sonnenberger
Douglas Gregor [Mon, 17 Jan 2011 19:15:43 +0000 (19:15 +0000)]
Add missing <cctype> include, from Joerg Sonnenberger

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

13 years agoHandle base and member destructors in CheckFallThrough.
Anders Carlsson [Mon, 17 Jan 2011 19:06:31 +0000 (19:06 +0000)]
Handle base and member destructors in CheckFallThrough.

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

13 years agoConvert "#pragma unused(...)" into tokens for the parser.
Argyrios Kyrtzidis [Mon, 17 Jan 2011 18:58:44 +0000 (18:58 +0000)]
Convert "#pragma unused(...)" into tokens for the parser.
This allows us to cache a "#pragma unused" that occurs inside an inline C++ member function.
Fixes rdar://8829590&8770988.

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

13 years agoAdd unnamed_addr to the special strings created by
Rafael Espindola [Mon, 17 Jan 2011 16:31:00 +0000 (16:31 +0000)]
Add unnamed_addr to the special strings created by
__builtin___CFStringMakeConstantString
This fixes PR8993. A darwin expert might want to check that this is safe.

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

13 years agoRemove dead code.
Anders Carlsson [Mon, 17 Jan 2011 03:13:24 +0000 (03:13 +0000)]
Remove dead code.

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

13 years agoChange ParseOptionalCXX0XVirtSpecifierSeq to take a VirtSpecifiers struct.
Anders Carlsson [Mon, 17 Jan 2011 03:05:47 +0000 (03:05 +0000)]
Change ParseOptionalCXX0XVirtSpecifierSeq to take a VirtSpecifiers struct.

Enforce C++[class.mem]p8:
A virt-specifier-seq shall contain at most one of each virt-specifier.

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

13 years agoRemove a c++ file test I inadvertently added in Sema last week.
Francois Pichet [Mon, 17 Jan 2011 01:08:01 +0000 (01:08 +0000)]
Remove a c++ file test I inadvertently added in Sema last week.

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

13 years agoRevert r123600.
Francois Pichet [Mon, 17 Jan 2011 00:56:42 +0000 (00:56 +0000)]
Revert r123600.

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

13 years agoBegin work on supporting "N3206: Override control: Eliminating Attributes", from
Anders Carlsson [Sun, 16 Jan 2011 23:56:42 +0000 (23:56 +0000)]
Begin work on supporting "N3206: Override control: Eliminating Attributes", from

http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3206.htm

This lands support for parsing virt-specifier-seq after member functions, including the
contextual keywords 'final', and 'override'. The keywords are not yet used for anything.

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

13 years agoFix a bug where the -Wmissing-noreturn would always treat constructors with base...
Anders Carlsson [Sun, 16 Jan 2011 22:12:43 +0000 (22:12 +0000)]
Fix a bug where the -Wmissing-noreturn would always treat constructors with base or member initializers as noreturn.

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

13 years agoAdd AnalysisContext::dumpCFG.
Anders Carlsson [Sun, 16 Jan 2011 22:05:23 +0000 (22:05 +0000)]
Add AnalysisContext::dumpCFG.

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

13 years agoDowngrade ext_enumerator_too_large from ExtWarn to Extension in Microsoft mode. Other...
Francois Pichet [Sun, 16 Jan 2011 21:44:17 +0000 (21:44 +0000)]
Downgrade ext_enumerator_too_large from ExtWarn to Extension in Microsoft mode. Otherwise you can warnings flooding trying to selfhost clang with fms-extensions because of "unsigned int" -> "signed int" enumerator conversion.

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

13 years agoEmit an extension diagnostic for C99 designated initializers that appear in C++ code
Douglas Gregor [Sun, 16 Jan 2011 16:13:16 +0000 (16:13 +0000)]
Emit an extension diagnostic for C99 designated initializers that appear in C++ code

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

13 years agoTweak the partial ordering rules for function templates to prefer a
Douglas Gregor [Sun, 16 Jan 2011 16:03:23 +0000 (16:03 +0000)]
Tweak the partial ordering rules for function templates to prefer a
non-variadic function template over a variadic one. This matches GCC
and the intent of the C++0x wording, in a way that I think is likely
to be acceptable to the committee.

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

13 years agoimprove compatibility with GCC: when generating the ".d" filename to use
Chris Lattner [Sun, 16 Jan 2011 08:14:11 +0000 (08:14 +0000)]
improve compatibility with GCC: when generating the ".d" filename to use
and the filename has multiple .'s in it, use the last.  For example, "foo.bar.cpp"
should produce "foo.bar.d" not "foo.d".  Patch by Johan Boule in PR8391

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

13 years agoAST/InheritViz: Remove all internal uses of PathV1.
Michael J. Spencer [Sat, 15 Jan 2011 21:43:57 +0000 (21:43 +0000)]
AST/InheritViz: Remove all internal uses of PathV1.

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

13 years agoAdd toCharUnitsInBits() to simplify the many calls to CharUnits::fromQuantity() of...
Ken Dyck [Sat, 15 Jan 2011 18:38:59 +0000 (18:38 +0000)]
Add toCharUnitsInBits() to simplify the many calls to CharUnits::fromQuantity() of the form CharUnits::fromQuantity(bitSize, Context.getCharWidth()).

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

13 years agoUnbreak the MSVC build again: replace bzero by memset.
Francois Pichet [Sat, 15 Jan 2011 13:27:47 +0000 (13:27 +0000)]
Unbreak the MSVC build again: replace bzero by memset.

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

13 years agoAlso set unnamed_addr on declarations.
Rafael Espindola [Sat, 15 Jan 2011 08:23:14 +0000 (08:23 +0000)]
Also set unnamed_addr on declarations.

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

13 years agoclean up some dead code around __has_include() processing code identified by the...
Chris Lattner [Sat, 15 Jan 2011 06:57:04 +0000 (06:57 +0000)]
clean up some dead code around __has_include() processing code identified by the ted-o-matic.

rdar://8867482

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

13 years agoIntroduce a new kind of TemplateName that captures a substituted
Douglas Gregor [Sat, 15 Jan 2011 06:45:20 +0000 (06:45 +0000)]
Introduce a new kind of TemplateName that captures a substituted
template template parameter pack that cannot be fully expanded because
its enclosing pack expansion could not be expanded. This form of
TemplateName plays the same role as SubstTemplateTypeParmPackType and
SubstNonTypeTemplateParmPackExpr do for template type parameter packs
and non-type template parameter packs, respectively.

We should now handle these multi-level pack expansion substitutions
anywhere. The largest remaining gap in our variadic-templates support
is that we cannot cope with non-type template parameter packs whose
type is a pack expansion.

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

13 years agoAdd initial prototype for implementation of
Ted Kremenek [Sat, 15 Jan 2011 02:58:47 +0000 (02:58 +0000)]
Add initial prototype for implementation of
-Wuninitialized based on CFG dataflow analysis.  WIP.

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

13 years agoAdd const version if CFG::isBlkExpr().
Ted Kremenek [Sat, 15 Jan 2011 02:58:42 +0000 (02:58 +0000)]
Add const version if CFG::isBlkExpr().

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

13 years agoStore/retrieve -fshort-enums for PCH, fixes rdar://8854933.
Argyrios Kyrtzidis [Sat, 15 Jan 2011 02:56:16 +0000 (02:56 +0000)]
Store/retrieve -fshort-enums for PCH, fixes rdar://8854933.

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

13 years agoTweak the storage mechanism for a set of overloaded template names in
Douglas Gregor [Sat, 15 Jan 2011 01:39:24 +0000 (01:39 +0000)]
Tweak the storage mechanism for a set of overloaded template names in
the TemplateName class. Nothing actually changes, but I find this less
objectionable (and it will factor into an upcoming change).

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

13 years agoIntroduce a new expression kind, SubstNonTypeTemplateParmPackExpr,
Douglas Gregor [Sat, 15 Jan 2011 01:15:58 +0000 (01:15 +0000)]
Introduce a new expression kind, SubstNonTypeTemplateParmPackExpr,
that captures the substitution of a non-type template argument pack
for a non-type template parameter pack within a pack expansion that
cannot be fully expanded. This follows the approach taken by
SubstTemplateTypeParmPackType.

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

13 years agoTeach template template argument pack expansions to keep track of the
Douglas Gregor [Fri, 14 Jan 2011 23:41:42 +0000 (23:41 +0000)]
Teach template template argument pack expansions to keep track of the
number of expansions, when we know it, and propagate that information
through Sema.

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

13 years agoHandle substitutions into function parameter packs whose patterns
Douglas Gregor [Fri, 14 Jan 2011 22:40:04 +0000 (22:40 +0000)]
Handle substitutions into function parameter packs whose patterns
contain multiple parameter packs at different levels.

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

13 years agoCleanup confused code that redundantly called "getDeclContext()" twice.
Ted Kremenek [Fri, 14 Jan 2011 22:31:41 +0000 (22:31 +0000)]
Cleanup confused code that redundantly called "getDeclContext()" twice.
Found by clang static analyzer.

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

13 years agoThe variable 'ReusedDecl' is written but never read.
Ted Kremenek [Fri, 14 Jan 2011 22:31:38 +0000 (22:31 +0000)]
The variable 'ReusedDecl' is written but never read.
Remove this variable (found by clang static analyzer).

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

13 years agoThe variable 'isTemplateSpecialization' is no longer
Ted Kremenek [Fri, 14 Jan 2011 22:31:36 +0000 (22:31 +0000)]
The variable 'isTemplateSpecialization' is no longer
used; nuke all assignments and its declaration.

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

13 years agoRemove unused store to variable 'Name'. Found by clang static analyzer.
Ted Kremenek [Fri, 14 Jan 2011 22:31:34 +0000 (22:31 +0000)]
Remove unused store to variable 'Name'.  Found by clang static analyzer.

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

13 years agoDriver: tweak handling of '--analyze' to invoke
Ted Kremenek [Fri, 14 Jan 2011 22:31:31 +0000 (22:31 +0000)]
Driver: tweak handling of '--analyze' to invoke
analyzer -cc1 options that are tailored to the
input type.  If the input type is "C++", we should
only run the dead stores checker (for now).  Similarly,
checks specific to Objective-C should only run
on Objective-C Code.

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

13 years agoFixed by r123477.
Owen Anderson [Fri, 14 Jan 2011 22:19:38 +0000 (22:19 +0000)]
Fixed by r123477.

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

13 years agoTeach PackExpansionExpr to keep track of the number of pack expansions
Douglas Gregor [Fri, 14 Jan 2011 21:20:45 +0000 (21:20 +0000)]
Teach PackExpansionExpr to keep track of the number of pack expansions
it will expand to, if known. Propagate this information throughout Sema.

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

13 years agoProperly propagate #pragma diagnostic mappings from PCH but not command-line warning...
Argyrios Kyrtzidis [Fri, 14 Jan 2011 20:54:07 +0000 (20:54 +0000)]
Properly propagate #pragma diagnostic mappings from PCH but not command-line warning flags.
Addresses rdar://8435969&8852495

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

13 years agoRename 'RemoveDeadBindings()' to 'removeDeadBindings()'
Ted Kremenek [Fri, 14 Jan 2011 20:34:15 +0000 (20:34 +0000)]
Rename 'RemoveDeadBindings()' to 'removeDeadBindings()'

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

13 years agoRename 'EnterStackFrame()' to 'enterStackFrame()'.
Ted Kremenek [Fri, 14 Jan 2011 20:34:10 +0000 (20:34 +0000)]
Rename 'EnterStackFrame()' to 'enterStackFrame()'.

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

13 years agoTeach RegionStore::EnterStackFrame() to handle
Ted Kremenek [Fri, 14 Jan 2011 20:29:43 +0000 (20:29 +0000)]
Teach RegionStore::EnterStackFrame() to handle
the case where the called function has fewer
formal arguments than actual arguments.  This
fixes a crash in the analyzer when doing
function call inlining.

Patch by Zhenbo Xu!

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

13 years agoWhen we're instantiating a direct variable initializer that has a pack
Douglas Gregor [Fri, 14 Jan 2011 17:12:22 +0000 (17:12 +0000)]
When we're instantiating a direct variable initializer that has a pack
expansion in it, we may end up instantiating to an empty
expression-list. In this case, the variable is uninitialized; tweak
the instantiation logic to handle this case. Fixes PR8977.

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

13 years agoKeep track of the number of expansions to be produced from a type pack
Douglas Gregor [Fri, 14 Jan 2011 17:04:44 +0000 (17:04 +0000)]
Keep track of the number of expansions to be produced from a type pack
expansion, when it is known due to the substitution of an out
parameter pack. This allows us to properly handle substitution into
pack expansions that involve multiple parameter packs at different
template parameter levels, even when this substitution happens one
level at a time (as with partial specializations of member class
templates and the signatures of member function templates).

Note that the diagnostic we provide when there is an arity mismatch
between an outer parameter pack and an inner parameter pack in this
case isn't as clear as the normal diagnostic for an arity
mismatch. However, this doesn't matter because these cases are very,
very rare and (even then) only typically occur in a SFINAE context.

The other kinds of pack expansions (expression, template, etc.) still
need to support optional tracking of the number of expansions, and we
need the moral equivalent of SubstTemplateTypeParmPackType for
substituted argument packs of template template and non-type template
parameters.

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

13 years agoSupport the zero-initialization of VLAs when that really means a zero
John McCall [Fri, 14 Jan 2011 10:37:58 +0000 (10:37 +0000)]
Support the zero-initialization of VLAs when that really means a zero
bit-pattern.  Continue punting on zero-initializing VLAs with a nonzero
pattern.

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

13 years agoWhen simplifying a cleanup's entry by merging it into a single predecessor,
John McCall [Fri, 14 Jan 2011 10:35:38 +0000 (10:35 +0000)]
When simplifying a cleanup's entry by merging it into a single predecessor,
replace all uses of the entry with the predecessor.  There are no cleanups
relying on this right now, but if we ever want a cleanup with a phi inside
it, this will be important.

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

13 years agotemporarily xfail, this was broken by r123418
Chris Lattner [Fri, 14 Jan 2011 05:30:12 +0000 (05:30 +0000)]
temporarily xfail, this was broken by r123418

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

13 years agoFix a few warnings stemming from my inability to properly fill out
Douglas Gregor [Fri, 14 Jan 2011 05:11:40 +0000 (05:11 +0000)]
Fix a few warnings stemming from my inability to properly fill out
switch() statements.

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

13 years agoStart implementing support for substitution into pack expansions that
Douglas Gregor [Fri, 14 Jan 2011 02:55:32 +0000 (02:55 +0000)]
Start implementing support for substitution into pack expansions that
involve template parameter packs at multiple template levels that
occur within the signatures members of class templates (and partial
specializations thereof). This is a work-in-progress that is deficient
in several ways, notably:
  - It only works for template type parameter packs, but we need to
  also support non-type template parameter packs and template template
  parameter packs.
  - It doesn't keep track of the lengths of the substituted argument
  packs in the expansion, so it can't properly diagnose length
  mismatches.

However, this is a concrete step in the right direction.

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

13 years agoReplace a literal '8' with getCharWidth().
Ken Dyck [Fri, 14 Jan 2011 02:01:36 +0000 (02:01 +0000)]
Replace a literal '8' with getCharWidth().

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