]> granicus.if.org Git - clang/log
clang
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

13 years agoUnbreak the MSVC build.
Francois Pichet [Thu, 13 Jan 2011 23:35:06 +0000 (23:35 +0000)]
Unbreak the MSVC build.

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

13 years agoSave getObjCGCAttrKind and use it in two places
Fariborz Jahanian [Thu, 13 Jan 2011 21:35:27 +0000 (21:35 +0000)]
Save getObjCGCAttrKind and use it in two places
for efficiancy (still part of //rdar://8761767).
Per John's comment.

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

13 years agoRename 'CheckDeadStores.cpp' to 'DeadStoresChecker.cpp'.
Ted Kremenek [Thu, 13 Jan 2011 20:58:59 +0000 (20:58 +0000)]
Rename 'CheckDeadStores.cpp' to 'DeadStoresChecker.cpp'.

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

13 years agoRemove warning in dead stores checker for
Ted Kremenek [Thu, 13 Jan 2011 20:58:56 +0000 (20:58 +0000)]
Remove warning in dead stores checker for
dead stores within nested assignments.  I have
never seen an actual bug found by this specific
warning, and it can lead to many false positives.

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

13 years agoGenerate write-barriers for global objc
Fariborz Jahanian [Thu, 13 Jan 2011 20:00:54 +0000 (20:00 +0000)]
Generate write-barriers for global objc
assigns. // rdar://8761767

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

13 years agoMove name mangling support from CodeGen to AST. In the
Peter Collingbourne [Thu, 13 Jan 2011 18:57:25 +0000 (18:57 +0000)]
Move name mangling support from CodeGen to AST.  In the
process, perform a number of refactorings:

- Move MiscNameMangler member functions to MangleContext
- Remove GlobalDecl dependency from MangleContext
- Make MangleContext abstract and move Itanium/Microsoft functionality
  to their own classes/files
- Implement ASTContext::createMangleContext and have CodeGen use it

No (intended) functionality change.

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

13 years agoOnly apply the parameter pack matching of C++0x [temp.arg.template]p3
Douglas Gregor [Thu, 13 Jan 2011 18:47:47 +0000 (18:47 +0000)]
Only apply the parameter pack matching of C++0x [temp.arg.template]p3
when we're actually matching a template template argument to a
template template parameter. Otherwise, use strict matching.

Fixes <rdar://problem/8859985> clang++: variadics and out-of-line definitions.

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

13 years agoFix a test case
Douglas Gregor [Thu, 13 Jan 2011 18:03:24 +0000 (18:03 +0000)]
Fix a test case

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

13 years agoWhen your comments and your code are out-of-sync, the test case is wrong.
Douglas Gregor [Thu, 13 Jan 2011 17:44:36 +0000 (17:44 +0000)]
When your comments and your code are out-of-sync, the test case is wrong.

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

13 years agoAdd tests for name mangling of variadic templates.
Douglas Gregor [Thu, 13 Jan 2011 16:39:34 +0000 (16:39 +0000)]
Add tests for name mangling of variadic templates.

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

13 years agoCXXBaseObjectRegion is like FieldRegion. Need to blast through it when
Zhongxing Xu [Thu, 13 Jan 2011 12:46:31 +0000 (12:46 +0000)]
CXXBaseObjectRegion is like FieldRegion. Need to blast through it when
getting the base region. This makes the RemoveDeadBindings() correct.

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

13 years agoSupport inlining base initializers. We still haven't got it completely right,
Zhongxing Xu [Thu, 13 Jan 2011 12:30:12 +0000 (12:30 +0000)]
Support inlining base initializers. We still haven't got it completely right,
since the bindings are purged after they are set up. Need to investigate
RemoveDeadBindings algorithm.

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

13 years agoAdd comments.
Zhongxing Xu [Thu, 13 Jan 2011 07:59:59 +0000 (07:59 +0000)]
Add comments.

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

13 years agoFix a corner case in RegionStore where we assign
Ted Kremenek [Thu, 13 Jan 2011 06:58:15 +0000 (06:58 +0000)]
Fix a corner case in RegionStore where we assign
a struct value to a symbolic index into array.
RegionStore can't actually reason about this,
so we were getting bogus warnings about loading
uninitialized values from the array.  The solution
is invalidate the entire array when we cannot
represent the binding explicitly.

Fixes <rdar://problem/8848957>

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

13 years agoRename 'HasGeneratedNode' to 'hasGeneratedNode'
Ted Kremenek [Thu, 13 Jan 2011 04:36:46 +0000 (04:36 +0000)]
Rename 'HasGeneratedNode' to 'hasGeneratedNode'
and 'getBasePredecessor()' to 'getPredecessor()'.

Also remove a unneeded save-and-restore of
node builder's tag field.

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

13 years agoRemove unnecessary save-and-restore of the
Ted Kremenek [Thu, 13 Jan 2011 04:36:40 +0000 (04:36 +0000)]
Remove unnecessary save-and-restore of the
node builder's 'HasGeneratedNode' field.

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

13 years agoRemove CheckerContext's dependence on setting
Ted Kremenek [Thu, 13 Jan 2011 04:36:36 +0000 (04:36 +0000)]
Remove CheckerContext's dependence on setting
the node builder's "tag" ivar (which we would
like to remove).

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

13 years agoEnsure an insertion point at the end of a statement-expression.
John McCall [Thu, 13 Jan 2011 02:03:06 +0000 (02:03 +0000)]
Ensure an insertion point at the end of a statement-expression.
Fixes PR8967.

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

13 years agooptimize out a temporary sys::Path
Chris Lattner [Thu, 13 Jan 2011 01:35:58 +0000 (01:35 +0000)]
optimize out a temporary sys::Path

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

13 years agoOnly add unnamed_addr to definitions.
Rafael Espindola [Thu, 13 Jan 2011 01:12:55 +0000 (01:12 +0000)]
Only add unnamed_addr to definitions.

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

13 years agoAllow us to transform pack expansion expressions.
Douglas Gregor [Thu, 13 Jan 2011 00:19:55 +0000 (00:19 +0000)]
Allow us to transform pack expansion expressions.

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

13 years agoImplement C++0x [temp.arg.template]p3, which allows slightly fuzzy
Douglas Gregor [Thu, 13 Jan 2011 00:08:50 +0000 (00:08 +0000)]
Implement C++0x [temp.arg.template]p3, which allows slightly fuzzy
matching of variadic template template parameters to template
arguments. This paragraph was the subject of ISO C++ committee
document N2555: Extending Variadic Template Template Parameters.

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

13 years agoreplace all uses of PathV1::IsSymlink with PathV2::is_symlink.
Michael J. Spencer [Wed, 12 Jan 2011 23:54:48 +0000 (23:54 +0000)]
replace all uses of PathV1::IsSymlink with PathV2::is_symlink.

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

13 years agoRefactor and simplify Sema::TemplateParameterListsAreEqual. We had a
Douglas Gregor [Wed, 12 Jan 2011 23:45:44 +0000 (23:45 +0000)]
Refactor and simplify Sema::TemplateParameterListsAreEqual. We had a
bunch of duplicated checks for parameter pack/non-pack mismatches.

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

13 years agoAdd the location of the right parenthesis of a C++ named cast
Douglas Gregor [Wed, 12 Jan 2011 22:41:29 +0000 (22:41 +0000)]
Add the location of the right parenthesis of a C++ named cast
(static_cast, dynamic_cast, reinterpret_cast, or const_cast) to
improve source-location information. Fixes PR8960.

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

13 years agoAdd IR generation support for SizeOfPackExpr.
Douglas Gregor [Wed, 12 Jan 2011 22:11:34 +0000 (22:11 +0000)]
Add IR generation support for SizeOfPackExpr.

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

13 years agoAdd some more partial-ordering tests, including one that changes with
Douglas Gregor [Wed, 12 Jan 2011 22:04:05 +0000 (22:04 +0000)]
Add some more partial-ordering tests, including one that changes with
the proposed resolution to core isue 692. I'm not certain which way
we'll go on this one.

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

13 years agowint_t is defined as 'unsigned int' on Linux. Fixes PR8938.
Douglas Gregor [Wed, 12 Jan 2011 21:19:25 +0000 (21:19 +0000)]
wint_t is defined as 'unsigned int' on Linux. Fixes PR8938.

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

13 years agoUpdate Xcode project.
Anders Carlsson [Wed, 12 Jan 2011 19:36:11 +0000 (19:36 +0000)]
Update Xcode project.

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

13 years agoTeach TreeTransform how to transform a pack expansion type into
Douglas Gregor [Wed, 12 Jan 2011 17:07:58 +0000 (17:07 +0000)]
Teach TreeTransform how to transform a pack expansion type into
another pack expansion type. This can happen when rebuilding types in
the current instantiation.

Fixes <rdar://problem/8848837> (Clang crashing on libc++ <functional>).

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

13 years agoPR3558: mark "logically const" accessor methods in ASTContext as const,
Jay Foad [Wed, 12 Jan 2011 09:06:06 +0000 (09:06 +0000)]
PR3558: mark "logically const" accessor methods in ASTContext as const,
and mark the fields they use as mutable. This allows us to remove a few
const_casts.

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

13 years agoAdd some documentation for C++ static analyzer.
Zhongxing Xu [Wed, 12 Jan 2011 07:20:03 +0000 (07:20 +0000)]
Add some documentation for C++ static analyzer.

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

13 years agoAdd cast expr kinds to CheckerVisitor.def.
Zhongxing Xu [Wed, 12 Jan 2011 06:24:01 +0000 (06:24 +0000)]
Add cast expr kinds to CheckerVisitor.def.

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

13 years agoFix a latent bug where, after emitting an expression statement, we would
John McCall [Wed, 12 Jan 2011 03:41:02 +0000 (03:41 +0000)]
Fix a latent bug where, after emitting an expression statement, we would
delete the block we began emitting into if it had no predecessors.  We never
want to do this, because there are several valid cases during statement
emission where an existing block has no known predecessors but will acquire
some later.  The case in my test case doesn't inherently fall into this
category, because we could safely emit the case-range code before the statement
body, but there are examples with labels that can't be fallen into
that would also demonstrate this bug.

rdar://problem/8837067

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

13 years agoDriver: Change -dumpversion to return a GCC compatible answer.
Daniel Dunbar [Wed, 12 Jan 2011 00:43:47 +0000 (00:43 +0000)]
Driver: Change -dumpversion to return a GCC compatible answer.
 - See comment for why.

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

13 years agoSlight bugfix to the attribute-distribution logic for GC attributes.
John McCall [Wed, 12 Jan 2011 00:34:59 +0000 (00:34 +0000)]
Slight bugfix to the attribute-distribution logic for GC attributes.
Slight optimization of getObjCGCAttrKind.

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