]> granicus.if.org Git - clang/log
clang
11 years agoc-index-test.c: Let this C89-compliant since r186817.
NAKAMURA Takumi [Mon, 22 Jul 2013 15:59:52 +0000 (15:59 +0000)]
c-index-test.c: Let this C89-compliant since r186817.

  warning: initializer for aggregate is not a compile-time constant [-Wc99-extensions]

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

11 years ago[ms-cxxabi] Emit linkonce complete dtors in TUs that need them
Reid Kleckner [Mon, 22 Jul 2013 13:51:44 +0000 (13:51 +0000)]
[ms-cxxabi] Emit linkonce complete dtors in TUs that need them

Based on Peter Collingbourne's destructor patches.

Prior to this change, clang was considering ?1 to be the complete
destructor and the base destructor, which was wrong.  This lead to
crashes when clang tried to emit two LLVM functions with the same name.

In this ABI, TUs with non-inline dtors might not emit a complete
destructor.  They are emitted as inline thunks in TUs that need them,
and they always delegate to the base dtors of the complete class and its
virtual bases.  This change uses the DeferredDecls machinery to emit
complete dtors as needed.

Currently in clang try body destructors can catch exceptions thrown by
virtual base destructors.  In the Microsoft C++ ABI, clang may not have
the destructor definition, in which case clang won't wrap the virtual
virtual base destructor calls in a try-catch.  Diagnosing this in user
code is TODO.

Finally, for classes that don't use virtual inheritance, MSVC always
calls the base destructor (?1) directly.  This is a useful code size
optimization that avoids emitting lots of extra thunks or aliases.
Implementing it also means our existing tests continue to pass, and is
consistent with MSVC's output.

We can do the same for Itanium by tweaking GetAddrOfCXXDestructor, but
it will require further testing.

Reviewers: rjmccall

CC: cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D1066

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

11 years agoRename D to GD to match the type, which is GlobalDecl
Reid Kleckner [Mon, 22 Jul 2013 13:07:10 +0000 (13:07 +0000)]
Rename D to GD to match the type, which is GlobalDecl

Now we can save GD.getDecl() in D and shorten some casts.

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

11 years agoInstall git-clang-format along with clang-format by default.
Daniel Jasper [Mon, 22 Jul 2013 12:51:47 +0000 (12:51 +0000)]
Install git-clang-format along with clang-format by default.

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

11 years agoForward declare OMPClause in Sema.h to avoid an include
Reid Kleckner [Mon, 22 Jul 2013 12:47:44 +0000 (12:47 +0000)]
Forward declare OMPClause in Sema.h to avoid an include

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

11 years agoImplement the part of C89 6.5.7 p3 requiring a constant initializer list
Enea Zaffanella [Mon, 22 Jul 2013 10:58:26 +0000 (10:58 +0000)]
Implement the part of C89 6.5.7 p3 requiring a constant initializer list
when initializing aggregate/union types, no matter if static or not.

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

11 years agoImprove clarity/consistency of a few UsingDecl methods and related helpers.
Enea Zaffanella [Mon, 22 Jul 2013 10:54:09 +0000 (10:54 +0000)]
Improve clarity/consistency of a few UsingDecl methods and related helpers.
No functionality change.

In Sema helper functions:
 * renamed isTypeName as HasTypenameKeyword
In UsingDecl:
 * renamed get/setUsingLocation to get/setUsingLoc
 * renamed is/setTypeName as has/setTypename

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

11 years agoRemove superfluous cast.
Robert Wilhelm [Mon, 22 Jul 2013 05:04:01 +0000 (05:04 +0000)]
Remove superfluous cast.

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

11 years agoPR16288: A template is only missing a default template argument if it provides
Richard Smith [Mon, 22 Jul 2013 03:31:14 +0000 (03:31 +0000)]
PR16288: A template is only missing a default template argument if it provides
any default template arguments, not if it inherits some.

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

11 years agoImplement DR257 / fix PR16659:
Richard Smith [Mon, 22 Jul 2013 02:56:56 +0000 (02:56 +0000)]
Implement DR257 / fix PR16659:
  A constructor for an abstract class does not call constructors for virtual
  base classes, so it is not an error if no initializer is present for the
  virtual base and the virtual base cannot be default initialized.

Also provide a (disabled by default, for now) warning for the case where a
virtual base class's initializer is ignored in an abstract class's constructor,
and address a defect in DR257 where it was not carried through to C++11's rules
for implicit deletion of special member functions.

Based on a patch by Maurice Bos.

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

11 years agoSemaTemplate.cpp: Prune a stray "\param NumParamLists" in comment. [-Wdocumentation]
NAKAMURA Takumi [Mon, 22 Jul 2013 01:27:42 +0000 (01:27 +0000)]
SemaTemplate.cpp: Prune a stray "\param NumParamLists" in comment. [-Wdocumentation]

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

11 years agoTest updates missed from r186799.
Richard Smith [Sun, 21 Jul 2013 23:13:17 +0000 (23:13 +0000)]
Test updates missed from r186799.

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

11 years agoTighten up the set of operator new/operator delete calls we're permitted to
Richard Smith [Sun, 21 Jul 2013 23:12:18 +0000 (23:12 +0000)]
Tighten up the set of operator new/operator delete calls we're permitted to
optimize, to follow the permissions granted in N3664. Under those rules, only
calls generated by new-expressions and delete-expressions are permitted to be
optimized, and direct calls to ::operator new and ::operator delete must be
treated as normal calls.

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

11 years agoConst-correct some iterators. No functional change.
Craig Topper [Sun, 21 Jul 2013 22:20:10 +0000 (22:20 +0000)]
Const-correct some iterators. No functional change.

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

11 years agoReplace 'unsigned short' with 'uint16_t' in a packed data structure for consistency...
Craig Topper [Sun, 21 Jul 2013 21:56:18 +0000 (21:56 +0000)]
Replace 'unsigned short' with 'uint16_t' in a packed data structure for consistency with other fields and to be explicit about bit count.

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

11 years agoRevert r186649 because it wasn't unnecessary and add a comment.
Craig Topper [Sun, 21 Jul 2013 18:58:40 +0000 (18:58 +0000)]
Revert r186649 because it wasn't unnecessary and add a comment.

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

11 years agoConvert Sema::MatchTemplateParametersToScopeSpecifier to ArrayRef.
Robert Wilhelm [Sun, 21 Jul 2013 15:20:44 +0000 (15:20 +0000)]
Convert  Sema::MatchTemplateParametersToScopeSpecifier to ArrayRef.

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

11 years agoreport unused-value warning also for warn_unused types
Lubos Lunak [Sun, 21 Jul 2013 13:15:58 +0000 (13:15 +0000)]
report unused-value warning also for warn_unused types

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

11 years agoclang-format: Smarter replacement in the vim integration.
Daniel Jasper [Sun, 21 Jul 2013 10:45:33 +0000 (10:45 +0000)]
clang-format: Smarter replacement in the vim integration.

With this fix, only changed regions will be replaced in vim's buffer.
Thereby, marks should mostly be left intact. Furthermore, this is a
better fix for the performance problem in conjunction with
'foldmethod=syntax' (see r186660).

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

11 years agoAdded preproc callback for pragma directives.
Enea Zaffanella [Sat, 20 Jul 2013 20:09:11 +0000 (20:09 +0000)]
Added preproc callback for pragma directives.

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

11 years agoAdd missing check for creating an instance of an abstract class through an
Richard Smith [Sat, 20 Jul 2013 19:41:36 +0000 (19:41 +0000)]
Add missing check for creating an instance of an abstract class through an
implicit conversion sequence.

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

11 years agoUndisable a test for a c++98-compat warning for inheriting constructors now that...
Richard Smith [Sat, 20 Jul 2013 19:22:08 +0000 (19:22 +0000)]
Undisable a test for a c++98-compat warning for inheriting constructors now that we implement them.

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

11 years agoadd type attribute warn_unused, for -Wunused-variable warnings (pr#14253)
Lubos Lunak [Sat, 20 Jul 2013 15:05:36 +0000 (15:05 +0000)]
add type attribute warn_unused, for -Wunused-variable warnings (pr#14253)

The functionality is equivalent to the GCC attribute. Variables of tagged
types will be warned about as unused if they are not used in any way
except for possible (even non-trivial) ctors/dtors called. Useful for tagging
classes like std::string (which is not part of this commit).

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

11 years agoavoid bogus warnings about "unknown" pragmas with -frewrite-includes (pr#14831)
Lubos Lunak [Sat, 20 Jul 2013 14:30:01 +0000 (14:30 +0000)]
avoid bogus warnings about "unknown" pragmas with -frewrite-includes (pr#14831)

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

11 years agofix sometimes incorrect line numbers in -frewrite-includes mode (pr#14795)
Lubos Lunak [Sat, 20 Jul 2013 14:23:27 +0000 (14:23 +0000)]
fix sometimes incorrect line numbers in -frewrite-includes mode (pr#14795)

Every #include is surrounded by #if 0 in order to comment it out, which adds
lines. That is fixed up right after, but that all can be inside #if part
that is not processed, so fix up also after every end of a conditional part.

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

11 years agoSilence GCC warning for using both enum and unsigned in a ternary expr.
Benjamin Kramer [Sat, 20 Jul 2013 12:06:17 +0000 (12:06 +0000)]
Silence GCC warning for using both enum and unsigned in a ternary expr.

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

11 years agoDiagnosticIDs: Forbid Diag ID from being valid
David Majnemer [Sat, 20 Jul 2013 07:15:15 +0000 (07:15 +0000)]
DiagnosticIDs: Forbid Diag ID from being valid

Diag ID is used throughout clang as a sentinel id meaning "this is an
invalid diagnostic id."  Confusingly, Diag ID maps to a valid, usable,
diagnostic id.  Instead, start diagnostic ids at ID one.

Incidently, remove an unused element from StaticDiagInfo.

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

11 years agoIf a default argument is a dependent type, get the real type from the desugared
Richard Trieu [Sat, 20 Jul 2013 03:49:02 +0000 (03:49 +0000)]
If a default argument is a dependent type, get the real type from the desugared
template.  Passing around dependent types can lead to integral arguments that
cannot be evaluated.

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

11 years agoFix bug in computing POD-for-layout.
Eli Friedman [Sat, 20 Jul 2013 01:06:31 +0000 (01:06 +0000)]
Fix bug in computing POD-for-layout.

A class with a field of non-POD-for-layout type is not POD-for-layout.
This computation should not depend on whether the field is of POD type
in the language sense.

Fixes PR16537.

Patch by Josh Magee.

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

11 years agoUse -lines option instead of -offset/-length. This fixes problems with files using...
Alexander Kornienko [Sat, 20 Jul 2013 01:01:25 +0000 (01:01 +0000)]
Use -lines option instead of -offset/-length. This fixes problems with files using dos newlines (<CR><LF>).

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

11 years agoMake IgnoreParens() look through ChooseExprs.
Eli Friedman [Sat, 20 Jul 2013 00:40:58 +0000 (00:40 +0000)]
Make IgnoreParens() look through ChooseExprs.

This is the same way GenericSelectionExpr works, and it's generally a
more consistent approach.

A large part of this patch is devoted to caching the value of the condition
of a ChooseExpr; it's needed to avoid threading an ASTContext into
IgnoreParens().

Fixes <rdar://problem/14438917>.

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

11 years agoFIXME fix: improving diagnostics for template arguments deduction of class templates...
Larisse Voufo [Fri, 19 Jul 2013 23:00:19 +0000 (23:00 +0000)]
FIXME fix: improving diagnostics for template arguments deduction of class templates and explicit specializations
    This patch essentially removes all the FIXMEs following calls to DeduceTemplateArguments() that want to keep track of deduction failure info.

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

11 years agoRevert "Use function overloading instead of template specialization for diagnosis...
Larisse Voufo [Fri, 19 Jul 2013 22:53:23 +0000 (22:53 +0000)]
Revert "Use function overloading instead of template specialization for diagnosis of bad template argument deductions."

This reverts commit a730f548325756d050d4caaa28fcbffdae8dfe95.

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

11 years agoFix pack instantiation with function types.
Eli Friedman [Fri, 19 Jul 2013 22:50:29 +0000 (22:50 +0000)]
Fix pack instantiation with function types.

Make sure we correctly expand packs which expand to another
pack in a function type.

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

11 years agoUse function overloading instead of template specialization for diagnosis of bad...
Larisse Voufo [Fri, 19 Jul 2013 22:34:32 +0000 (22:34 +0000)]
Use function overloading instead of template specialization for diagnosis of bad template argument deductions.

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

11 years agoCorrectly handle packs for variadic type traits.
Eli Friedman [Fri, 19 Jul 2013 21:49:32 +0000 (21:49 +0000)]
Correctly handle packs for variadic type traits.

I'm not sure how to write a test for this; the following shows the
difference in -ast-dump:

template <int x> struct A {};
template <class T> struct B { };
template <class ...Args> using C = A<(__is_trivially_constructible(Args...))>;
template <class ...Args> using D = C<B<Args>...>;

However, I can't seem to write a test that triggers a visible difference
in behavior.

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

11 years agoRemove trailing whitespace
Craig Topper [Fri, 19 Jul 2013 21:43:59 +0000 (21:43 +0000)]
Remove trailing whitespace

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

11 years agoAdd a cl.exe compatible driver mode
Hans Wennborg [Fri, 19 Jul 2013 20:33:20 +0000 (20:33 +0000)]
Add a cl.exe compatible driver mode

The mode doesn't actually do anything yet, but this provides a
way to get into it.

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

11 years agoUse an i686 triple for this test now that it uses stdcall
Reid Kleckner [Fri, 19 Jul 2013 20:32:18 +0000 (20:32 +0000)]
Use an i686 triple for this test now that it uses stdcall

There seems to be a crash here if we have a calling convention attribute
that gets ignored and then we instantiate templates.

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

11 years agoFix another place where clang check objc selector name instead of checking the select...
Jean-Daniel Dupas [Fri, 19 Jul 2013 20:25:56 +0000 (20:25 +0000)]
Fix another place where clang check objc selector name instead of checking the selector family

Summary: In ARC mode, clang emits a warning if the result of an 'init' method is unused but miss cases where the method does not follows the Cocoa naming convention but is properly declared as an init family method.

CC: cfe-commits, eli.friedman
Differential Revision: http://llvm-reviews.chandlerc.com/D1163

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

11 years agoObjectiveC migrator: Another use case of enum
Fariborz Jahanian [Fri, 19 Jul 2013 20:18:36 +0000 (20:18 +0000)]
ObjectiveC migrator: Another use case of enum
declaration which can be migrated to NS_ENUM.

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

11 years agoAdd support for raw_ostream on the printing methods of Diagnostics.
Samuel Benzaquen [Fri, 19 Jul 2013 20:02:35 +0000 (20:02 +0000)]
Add support for raw_ostream on the printing methods of Diagnostics.

Summary:
Add printToStream*(llvm::raw_ostream&) methods to Diagnostics, and reimplement everything based on streams instead of concatenating strings.
Also, fix some functions to start with lowercase to match the style guide.

Reviewers: klimek

CC: cfe-commits, revane
Differential Revision: http://llvm-reviews.chandlerc.com/D1187

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

11 years agoCreate calling convention AttributedType sugar nodes
Reid Kleckner [Fri, 19 Jul 2013 19:51:03 +0000 (19:51 +0000)]
Create calling convention AttributedType sugar nodes

Canonical types are unchanged.  The type printer had to be changed to
avoid printing any non-default implicit calling convention as well as
the calling convention attribute.

Reviewers: rjmccall

Differential Revision: http://llvm-reviews.chandlerc.com/D1132

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

11 years agoFix for template substitution with packs.
Eli Friedman [Fri, 19 Jul 2013 19:40:38 +0000 (19:40 +0000)]
Fix for template substitution with packs.

When we see a pack, and replace it with a template argument which is
also a pack, we want to use the pack pattern, not the expanded pack.
The caller should take care of expanding the pack afterwards.

Fixes PR16646.

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

11 years agoUpdate users manual to indicate:
Richard Smith [Fri, 19 Jul 2013 19:06:48 +0000 (19:06 +0000)]
Update users manual to indicate:
  1) clang++ must be used when linking C++ programs using -fsanitize=undefined, and
  2) MSan can't be combined with TSan or ASan.

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

11 years ago[mips] Add support for command-line options -mno-check-zero-division and
Akira Hatanaka [Fri, 19 Jul 2013 18:58:48 +0000 (18:58 +0000)]
[mips] Add support for command-line options -mno-check-zero-division and
-mcheck-zero-division.

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

11 years ago[arcmt] After checking is successful disable auto-synthesize to avoid "@synthesize...
Argyrios Kyrtzidis [Fri, 19 Jul 2013 18:57:15 +0000 (18:57 +0000)]
[arcmt] After checking is successful disable auto-synthesize to avoid "@synthesize of 'weak' property is only
allowed in ARC" errors.

rdar://14461559

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

11 years agoReplace some existing type attribute diagnostics with a
Aaron Ballman [Fri, 19 Jul 2013 18:53:44 +0000 (18:53 +0000)]
Replace some existing type attribute diagnostics with a
single diagnostic that selects.  No functional changes intended.

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

11 years agoAdd SourceRange to PPCallbacks::Defined callback.
John Thompson [Fri, 19 Jul 2013 18:50:04 +0000 (18:50 +0000)]
Add SourceRange to PPCallbacks::Defined callback.

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

11 years agoFix source range of implicitly instantiated friend declaration.
Enea Zaffanella [Fri, 19 Jul 2013 18:02:36 +0000 (18:02 +0000)]
Fix source range of implicitly instantiated friend declaration.

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

11 years agoFix test to actually check things.
Benjamin Kramer [Fri, 19 Jul 2013 17:49:21 +0000 (17:49 +0000)]
Fix test to actually check things.

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

11 years agoFixes an ObjC migrator crash when last decl
Fariborz Jahanian [Fri, 19 Jul 2013 17:44:32 +0000 (17:44 +0000)]
Fixes an ObjC migrator crash when last decl
in file is an enum.

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

11 years agoThis patch implements __get_cpuid_max() as an inline and __cpuid() and
Roman Divacky [Fri, 19 Jul 2013 17:28:36 +0000 (17:28 +0000)]
This patch implements __get_cpuid_max() as an inline and __cpuid() and
__cpuid_count() as macros to be compatible with GCC's cpuid.h.  It also adds
bit_<foo> constants for the various feature bits as described in version 039
(May 2011) of Intel's SDM Volume 2 in the description of the CPUID
instruction.  The list of bit_<foo> constants is a bit exhaustive (GCC
doesn't do near this many).  More bits could be added from a newer version of
SDM if desired.

Patch by John Baldwin!

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

11 years ago[SystemZ] Add -march= command-line option
Richard Sandiford [Fri, 19 Jul 2013 16:51:51 +0000 (16:51 +0000)]
[SystemZ] Add -march= command-line option

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

11 years ago[SystemZ] Enable frame-pointer elimination for -O1 and above
Richard Sandiford [Fri, 19 Jul 2013 14:06:49 +0000 (14:06 +0000)]
[SystemZ] Enable frame-pointer elimination for -O1 and above

Copies the x86 behavior.

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

11 years agoRevert r186672 - turns out ASan supports Mac OS 10.6 yet.
Alexey Samsonov [Fri, 19 Jul 2013 12:53:04 +0000 (12:53 +0000)]
Revert r186672 - turns out ASan supports Mac OS 10.6 yet.

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

11 years ago[ASan] Reflect the dropped Mac OS 10.6 support in docs
Alexey Samsonov [Fri, 19 Jul 2013 12:33:30 +0000 (12:33 +0000)]
[ASan] Reflect the dropped Mac OS 10.6 support in docs

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

11 years agoAllow clang tools to display an overview when using the CommonOptionsParser.
Manuel Klimek [Fri, 19 Jul 2013 12:20:59 +0000 (12:20 +0000)]
Allow clang tools to display an overview when using the CommonOptionsParser.

Patch by Guillaume Papin.

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

11 years agoAdds overlapsWith and contains predicates on tooling::Range.
Manuel Klimek [Fri, 19 Jul 2013 12:12:36 +0000 (12:12 +0000)]
Adds overlapsWith and contains predicates on tooling::Range.

Patch by Guillaume Papin.

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

11 years agoAdds ctorInitializer and forEachConstructorInitializer matchers.
Manuel Klimek [Fri, 19 Jul 2013 11:50:54 +0000 (11:50 +0000)]
Adds ctorInitializer and forEachConstructorInitializer matchers.

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

11 years agoStmtOpenMP.h: Prune a stray \param in the comment of OMPExecutableDirective(). [...
NAKAMURA Takumi [Fri, 19 Jul 2013 10:31:05 +0000 (10:31 +0000)]
StmtOpenMP.h: Prune a stray \param in the comment of OMPExecutableDirective(). [-Wdocumentation]

-  /// \param Clauses A list of clauses.

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

11 years agoStmtOpenMP.h: Fix bogus \param(s). [-Wdocumentation]
NAKAMURA Takumi [Fri, 19 Jul 2013 10:30:58 +0000 (10:30 +0000)]
StmtOpenMP.h: Fix bogus \param(s). [-Wdocumentation]

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

11 years agoImprove clang-format vim integration.
Daniel Jasper [Fri, 19 Jul 2013 09:30:44 +0000 (09:30 +0000)]
Improve clang-format vim integration.

The previous line-by-line replacement causes vim to take a long time if
the foldmethod is set to 'syntax'. This should significantly improve
performance in that case.

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

11 years agoSimplify the CodeGenFunction::Build*Virtual*Call family of functions
Timur Iskhodzhanov [Fri, 19 Jul 2013 08:14:45 +0000 (08:14 +0000)]
Simplify the CodeGenFunction::Build*Virtual*Call family of functions

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

11 years agoRemove trailing whitespace.
Craig Topper [Fri, 19 Jul 2013 04:46:31 +0000 (04:46 +0000)]
Remove trailing whitespace.

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

11 years agoRemove unnecessary IsFirst variable from debug codde in GetDiagInfo.
Craig Topper [Fri, 19 Jul 2013 03:59:51 +0000 (03:59 +0000)]
Remove unnecessary IsFirst variable from debug codde in GetDiagInfo.

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

11 years agoOpenMP: basic support for #pragma omp parallel
Alexey Bataev [Fri, 19 Jul 2013 03:13:43 +0000 (03:13 +0000)]
OpenMP: basic support for #pragma omp parallel

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

11 years agoObjectiveC migrator: add support to migrate to
Fariborz Jahanian [Fri, 19 Jul 2013 01:05:49 +0000 (01:05 +0000)]
ObjectiveC migrator: add support to migrate to
NS_OPTIONS.

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

11 years ago[analyzer] Include analysis stack in crash traces.
Jordan Rose [Fri, 19 Jul 2013 00:59:08 +0000 (00:59 +0000)]
[analyzer] Include analysis stack in crash traces.

Sample output:

0.     Program arguments: ...
1.     <eof> parser at end of file
2.     While analyzing stack:
       #0 void inlined()
       #1 void test()
3.     crash-trace.c:6:3: Error evaluating statement

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

11 years agoUpdate createCompileUnit call for llvm changes.
Eric Christopher [Fri, 19 Jul 2013 00:51:58 +0000 (00:51 +0000)]
Update createCompileUnit call for llvm changes.

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

11 years agoFix crash-on-invalid with inheriting constructor.
Eli Friedman [Thu, 18 Jul 2013 23:59:50 +0000 (23:59 +0000)]
Fix crash-on-invalid with inheriting constructor.

Fixes PR16656.

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

11 years agoClean up diagnostics for inheriting constructors.
Eli Friedman [Thu, 18 Jul 2013 23:29:14 +0000 (23:29 +0000)]
Clean up diagnostics for inheriting constructors.

No new diagnostics, just better wording and notes pointing at more
relevant locations.

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

11 years agoAdded -lines X:Y option to specify line range to process. This is a more human-friend...
Alexander Kornienko [Thu, 18 Jul 2013 22:54:56 +0000 (22:54 +0000)]
Added -lines X:Y option to specify line range to process. This is a more human-friendly alternative to -offset and -length.

Differential Revision: http://llvm-reviews.chandlerc.com/D1160

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

11 years agoObjectiveC migrator: Remove semicolon after the typedef
Fariborz Jahanian [Thu, 18 Jul 2013 22:17:33 +0000 (22:17 +0000)]
ObjectiveC migrator: Remove semicolon after the typedef
declaration when converting to NS_ENUM. This required
some code refactoring.

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

11 years agoAddress -Wreorder warning in Driver.cpp
Hans Wennborg [Thu, 18 Jul 2013 21:45:42 +0000 (21:45 +0000)]
Address -Wreorder warning in Driver.cpp

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

11 years agoTurn Driver::CCCIsCXX and CCCIsCPP into a single Mode enum,
Hans Wennborg [Thu, 18 Jul 2013 20:29:38 +0000 (20:29 +0000)]
Turn Driver::CCCIsCXX and CCCIsCPP into a single Mode enum,
and add a new option --driver-mode= to control it explicitly.

The CCCIsCXX and CCCIsCPP flags were non-overlapping, i.e. there
are currently really three modes that Clang can run in: gcc, g++
or cpp, so it makes sense to represent them as an enum.

Having a command line flag to control it helps testing.

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

11 years agoObjectiveC migration. migration to NS_ENUM/SN_OPTION
Fariborz Jahanian [Thu, 18 Jul 2013 20:11:45 +0000 (20:11 +0000)]
ObjectiveC migration. migration to NS_ENUM/SN_OPTION
- wip.

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

11 years ago[Driver] Use LLVM's response file parser because it can read UTF-16
Reid Kleckner [Thu, 18 Jul 2013 20:00:53 +0000 (20:00 +0000)]
[Driver] Use LLVM's response file parser because it can read UTF-16

MSBuild writes response files as UTF-16 little endian with a byte order
mark.  With this change, clang will be able to read them, although we
still can't parse any of their flags.

Adds a UTF-16-LE response file with a BOM for testing.

Differential Revision: http://llvm-reviews.chandlerc.com/D1137

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

11 years agoSeparate the notion of 'context' when recursing down in the parser and actual errors.
Samuel Benzaquen [Thu, 18 Jul 2013 19:47:59 +0000 (19:47 +0000)]
Separate the notion of 'context' when recursing down in the parser and actual errors.

Summary:
Change how error messages are constructed and stored in Diagnostics.
Separate the notion of 'context' when recursing down in the parser and actual errors.
This will simplify adding some new features, like argument overloading and error recovery.

Reviewers: klimek

CC: cfe-commits, revane
Differential Revision: http://llvm-reviews.chandlerc.com/D1168

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

11 years agoChanged declarations from Attr to InheritableAttr as they are already being processed...
Aaron Ballman [Thu, 18 Jul 2013 19:11:29 +0000 (19:11 +0000)]
Changed declarations from Attr to InheritableAttr as they are already being processed that way semantically.

Patch thanks to Dean Sutherland!  Reviewed by Eli Friedman.

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

11 years agoSwitching to use checkAttributeNumArgs for trivial cases. No functional changes...
Aaron Ballman [Thu, 18 Jul 2013 18:01:48 +0000 (18:01 +0000)]
Switching to use checkAttributeNumArgs for trivial cases.  No functional changes intended.

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

11 years agoTest contents were somehow duplicated, resulting in any testcase that fails automatic...
Aaron Ballman [Thu, 18 Jul 2013 17:41:26 +0000 (17:41 +0000)]
Test contents were somehow duplicated, resulting in any testcase that fails automatically failing twice.  Removing the duplicates.

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

11 years agoReplacing a morally duplicate diagnostic by adding it to an existing diagnostic's...
Aaron Ballman [Thu, 18 Jul 2013 14:56:42 +0000 (14:56 +0000)]
Replacing a morally duplicate diagnostic by adding it to an existing diagnostic's select list.  Updates the tests for the more consistent diagnostic.

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

11 years agoclang-format: Fix bad line break with pointers to members.
Daniel Jasper [Thu, 18 Jul 2013 14:46:07 +0000 (14:46 +0000)]
clang-format: Fix bad line break with pointers to members.

Before:
  void f() {
    (a->*
     aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa)(aaaa,
                                           bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb);
  }

After:
  void f() {
    (a->*aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa)(
        aaaa, bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb);
  }

Also add missing test case.

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

11 years agoFix crash in libclang if code completion is used with unknown flags.
Manuel Klimek [Thu, 18 Jul 2013 14:23:12 +0000 (14:23 +0000)]
Fix crash in libclang if code completion is used with unknown flags.

Use CaptureDroppedDiagnostics to make sure that there is a diagnostic
client installed when warning flags are parsed.

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

11 years agoRemoved a parameter from handleAttrWithMessage to make it more consistent with other...
Aaron Ballman [Thu, 18 Jul 2013 13:13:52 +0000 (13:13 +0000)]
Removed a parameter from handleAttrWithMessage to make it more consistent with other attribute handlers, as well as other attribute error messages.  Added missing test cases for the unavailable attribute, and updated the deprecated test case.

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

11 years agoFix volatile _Complex alignment test on platforms where 64-bit floating point isn...
JF Bastien [Thu, 18 Jul 2013 06:11:45 +0000 (06:11 +0000)]
Fix volatile _Complex alignment test on platforms where 64-bit floating point isn't 64-bit aligned

Add x86-64 triple, and check its datalayout. Also add some comments, and use the new CHECK-LABEL.

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

11 years agos/BuiltinLocation/ArtificialLocation/
Adrian Prantl [Thu, 18 Jul 2013 01:36:04 +0000 (01:36 +0000)]
s/BuiltinLocation/ArtificialLocation/

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

11 years agoInstead of checking against some version of "isType()" go ahead and
Eric Christopher [Thu, 18 Jul 2013 00:52:50 +0000 (00:52 +0000)]
Instead of checking against some version of "isType()" go ahead and
use the conversion to bool to check if we've managed to get a type
that isn't default constructed - as we meant to in the first place.

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

11 years agoFix a compile error caught by bb-chapuni.
Adrian Prantl [Thu, 18 Jul 2013 00:47:12 +0000 (00:47 +0000)]
Fix a compile error caught by bb-chapuni.

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

11 years agoFix a compile error caught by bb-chapuni.
Adrian Prantl [Thu, 18 Jul 2013 00:43:29 +0000 (00:43 +0000)]
Fix a compile error caught by bb-chapuni.

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

11 years agoDon't generate bogus line table entries for __copy_helper_block_ and
Adrian Prantl [Thu, 18 Jul 2013 00:28:05 +0000 (00:28 +0000)]
Don't generate bogus line table entries for __copy_helper_block_ and
__destroy_helper_block_, but do generate scope information.

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

11 years agoReplace llvm::DIBuilder::DisableDebugLocations() with two RAII interfaces
Adrian Prantl [Thu, 18 Jul 2013 00:28:02 +0000 (00:28 +0000)]
Replace llvm::DIBuilder::DisableDebugLocations() with two RAII interfaces
inspired by CodegenFunction::LexicalScope.
- NoLocation temporarily turns off debug locations altogether.
  This is useful for emitting instructions that should be
  counted towards the function prologue.
- BuiltinLocation temporarily switches to an artificial debug location
  that has a valid scope, but no line information. This is useful when
  emitting compiler-generated helper functions that have no source
  location associated with them.

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

11 years agoClarified documentation.
Adrian Prantl [Thu, 18 Jul 2013 00:27:59 +0000 (00:27 +0000)]
Clarified documentation.

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

11 years agoSimplify logic by using the appropriate function.
Adrian Prantl [Thu, 18 Jul 2013 00:27:56 +0000 (00:27 +0000)]
Simplify logic by using the appropriate function.

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

11 years agoAdd condition expression result to if and elif callbacks.
John Thompson [Thu, 18 Jul 2013 00:00:36 +0000 (00:00 +0000)]
Add condition expression result to if and elif callbacks.

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

11 years agoReinstate r186040, with additional fixes and more test coverage (reverted in
Richard Smith [Wed, 17 Jul 2013 23:53:16 +0000 (23:53 +0000)]
Reinstate r186040, with additional fixes and more test coverage (reverted in
r186331).

Original commit log:
  If we friend a declaration twice, that should not make it visible to
  name lookup in the surrounding context. Slightly rework how we handle
  friend declarations to inherit the visibility of the prior
  declaration, rather than setting a friend declaration to be visible
  whenever there was a prior declaration.

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

11 years ago80-column fixes.
Eric Christopher [Wed, 17 Jul 2013 22:52:53 +0000 (22:52 +0000)]
80-column fixes.

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

11 years agoEven more code conformance.
Robert Wilhelm [Wed, 17 Jul 2013 21:14:35 +0000 (21:14 +0000)]
Even more code conformance.

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

11 years agoMS wide bitfield error check in Sema
Reid Kleckner [Wed, 17 Jul 2013 20:46:03 +0000 (20:46 +0000)]
MS wide bitfield error check in Sema

cl.exe treats wide bitfields as an error. This patch causes them to be
an error if IsMsStruct is true, as it is in straight C.

Patch by Warren Hunt!

Reviewers: eli.friedman

Differential Revision: http://llvm-reviews.chandlerc.com/D1125

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