]> granicus.if.org Git - clang/log
clang
11 years agoclang-format: Fix template declaration line breaking with comment.
Daniel Jasper [Wed, 9 Oct 2013 15:06:17 +0000 (15:06 +0000)]
clang-format: Fix template declaration line breaking with comment.

Before, clang-format would always insert a linebreak before the comment
in code like:
  template <typename T> // T can be A, B or C.
  struct S {};

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

11 years ago[Mips] Group MIPS-related options checking function in one place.
Simon Atanasyan [Wed, 9 Oct 2013 12:12:39 +0000 (12:12 +0000)]
[Mips] Group MIPS-related options checking function in one place.

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

11 years ago[Mips] Make the isMipsR2Arch() function simpler - remove checking for
Simon Atanasyan [Wed, 9 Oct 2013 12:12:34 +0000 (12:12 +0000)]
[Mips] Make the isMipsR2Arch() function simpler - remove checking for
MIPS-arch.

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

11 years ago[Mips] Remove unused mips_CPUs_Group options group. It's better to join
Simon Atanasyan [Wed, 9 Oct 2013 12:12:29 +0000 (12:12 +0000)]
[Mips] Remove unused mips_CPUs_Group options group. It's better to join
all MIPS-related options to the new m_mips_Features_Group later.

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

11 years ago[Mips] Do not check for options from the OPT_mips_CPUs_Group. All these
Simon Atanasyan [Wed, 9 Oct 2013 12:12:24 +0000 (12:12 +0000)]
[Mips] Do not check for options from the OPT_mips_CPUs_Group. All these
options are aliases now.

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

11 years ago[Mips] Make mips32/mips32r2/mips64/mips64r2 real aliases for appropriate
Simon Atanasyan [Wed, 9 Oct 2013 12:12:19 +0000 (12:12 +0000)]
[Mips] Make mips32/mips32r2/mips64/mips64r2 real aliases for appropriate
march options.

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

11 years agoCode cleanup: rename VTableContext to ItaniumVTableContext, VTableBuilder to ItaniumV...
Timur Iskhodzhanov [Wed, 9 Oct 2013 11:33:51 +0000 (11:33 +0000)]
Code cleanup: rename VTableContext to ItaniumVTableContext, VTableBuilder to ItaniumVTableBuilder and clang-format code around

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

11 years agoclang/test/Coverage/codegen-next.m: Exclude this for targeting x86_64-win32.
NAKAMURA Takumi [Wed, 9 Oct 2013 09:45:27 +0000 (09:45 +0000)]
clang/test/Coverage/codegen-next.m: Exclude this for targeting x86_64-win32.

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

11 years agoReland 192220 "Abstract out parts of thunk emission code, add support for simple...
Timur Iskhodzhanov [Wed, 9 Oct 2013 09:23:58 +0000 (09:23 +0000)]
Reland 192220 "Abstract out parts of thunk emission code, add support for simple thunks when using -cxx-abi microsoft" with relaxed assertions

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

11 years agoMake wording for certain invalid unary expressions more consistent.
David Majnemer [Wed, 9 Oct 2013 00:22:23 +0000 (00:22 +0000)]
Make wording for certain invalid unary expressions more consistent.

An invalid decltype expression like 'decltype int' gives:
error: expected '(' after 'decltype'

This makes it so 'sizeof int' gives a similar one:
error: expected parentheses around type name in sizeof expression

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

11 years agoDebug Info: update testing cases when the context field of
Manman Ren [Wed, 9 Oct 2013 00:17:23 +0000 (00:17 +0000)]
Debug Info: update testing cases when the context field of
DICompositeType is updated to use DIScopeRef.

Paired commit with r192256.

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

11 years agoDebug Info: update testing cases when the derived-from field of
Manman Ren [Tue, 8 Oct 2013 23:29:36 +0000 (23:29 +0000)]
Debug Info: update testing cases when the derived-from field of
DICompositeType is updated to use DITypeRef.

Paired commit with r192251.

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

11 years agoDebug Info: update testing cases when the derived-from field of
Manman Ren [Tue, 8 Oct 2013 22:56:54 +0000 (22:56 +0000)]
Debug Info: update testing cases when the derived-from field of
DIDerivedType is updated to use DITypeRef.

Paired commit with r192246.

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

11 years ago-Wmicrosoft: Don't warn on non-inline pure virtual method definitions
Reid Kleckner [Tue, 8 Oct 2013 22:45:29 +0000 (22:45 +0000)]
-Wmicrosoft: Don't warn on non-inline pure virtual method definitions

MSVC and clang with -fms-extensions allow pure virtual methods to be
defined inline after the "= 0" tokens.  Clang warns on these because it
is not standard, but incorrectly warns on out-of-line definitions, which
are standard.

With this change, clang will only warn on inline definitions of pure
virtual methods.

Fixes some self-host warnings on out-of-line definitions of pure virtual
destructors.

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

11 years ago[AArch64] Add support for NEON scalar floating-point reciprocal estimate,
Chad Rosier [Tue, 8 Oct 2013 22:09:29 +0000 (22:09 +0000)]
[AArch64] Add support for NEON scalar floating-point reciprocal estimate,
reciprocal exponent, and reciprocal square root estimate instructions.

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

11 years agoTurn error about fastcall variadic function into warning in MS mode (PR12535)
Hans Wennborg [Tue, 8 Oct 2013 21:52:56 +0000 (21:52 +0000)]
Turn error about fastcall variadic function into warning in MS mode (PR12535)

MSVC allows this and silently falls back to __cdecl for variadic functions.
This patch turns Clang's error into a warning in MS mode and adds a test
to make sure we generate correct code.

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

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

11 years agoObjectiveC migrator: Add support for inferring
Fariborz Jahanian [Tue, 8 Oct 2013 21:32:16 +0000 (21:32 +0000)]
ObjectiveC migrator: Add support for inferring
properties of function pointer type.
// rdar://15082812

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

11 years ago[AArch64] Add support for NEON scalar signed/unsigned integer to floating-point
Chad Rosier [Tue, 8 Oct 2013 20:43:46 +0000 (20:43 +0000)]
[AArch64] Add support for NEON scalar signed/unsigned integer to floating-point
convert instructions.

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

11 years agoExplicitly request unsigned enum types when desired
Reid Kleckner [Tue, 8 Oct 2013 20:20:00 +0000 (20:20 +0000)]
Explicitly request unsigned enum types when desired

This fixes repeated -Wmicrosoft warnings when self-hosting clang on
Windows, and gets us real unsigned enum types with MSVC.

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

11 years agoObjectiveC migration. Add support for inferring
Fariborz Jahanian [Tue, 8 Oct 2013 20:14:24 +0000 (20:14 +0000)]
ObjectiveC migration. Add support for inferring
properties of block pointer types. Also, remove
strong lifetime attribute from property type
in this migration. This is wip.
// rdar://15082818

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

11 years agoRevert 192220 as it fails on an assertion
Timur Iskhodzhanov [Tue, 8 Oct 2013 20:09:50 +0000 (20:09 +0000)]
Revert 192220 as it fails on an assertion

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

11 years agoSuggest people use -Xclang not -cc1 when passing options to the frontend.
Richard Smith [Tue, 8 Oct 2013 19:50:01 +0000 (19:50 +0000)]
Suggest people use -Xclang not -cc1 when passing options to the frontend.

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

11 years agoRemove documentation of removed -ast-dump-xml flag.
Richard Smith [Tue, 8 Oct 2013 19:45:46 +0000 (19:45 +0000)]
Remove documentation of removed -ast-dump-xml flag.

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

11 years agoAbstract out parts of thunk emission code, add support for simple thunks when using...
Timur Iskhodzhanov [Tue, 8 Oct 2013 19:15:38 +0000 (19:15 +0000)]
Abstract out parts of thunk emission code, add support for simple thunks when using -cxx-abi microsoft

Reviewed at http://llvm-reviews.chandlerc.com/D1787

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

11 years ago[mips] Remove XFAIL.
Akira Hatanaka [Tue, 8 Oct 2013 19:08:54 +0000 (19:08 +0000)]
[mips] Remove XFAIL.

Triple x86_64 has been added to the command line, so this test doesn't fail
on mips anymore.

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

11 years agoRemove transient code I did not mean to check in.
Ted Kremenek [Tue, 8 Oct 2013 18:04:56 +0000 (18:04 +0000)]
Remove transient code I did not mean to check in.

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

11 years agoFixed messages in tests.
Serge Pavlov [Tue, 8 Oct 2013 17:38:38 +0000 (17:38 +0000)]
Fixed messages in tests.

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

11 years agoFixed grammar. Thanks to Jordan Rose.
Serge Pavlov [Tue, 8 Oct 2013 17:09:03 +0000 (17:09 +0000)]
Fixed grammar. Thanks to Jordan Rose.

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

11 years agoConvert anachronistic use of 'void *' to 'DeclContext *' in Scope that was a holdover...
Ted Kremenek [Tue, 8 Oct 2013 17:08:03 +0000 (17:08 +0000)]
Convert anachronistic use of 'void *' to 'DeclContext *' in Scope that was a holdover from the long-dead Action interface.

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

11 years agoFix an edge case in the template differ with default arguments.
Benjamin Kramer [Tue, 8 Oct 2013 16:58:52 +0000 (16:58 +0000)]
Fix an edge case in the template differ with default arguments.

In the test case one type is coming from a typedef with no default arg, the
other has the default arg. Taking the default arg from the typedef crashes, so
always use the real template paramter declaration. PR17510.

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

11 years agoclang-cl: ignore the /sdl[-] flag
Hans Wennborg [Tue, 8 Oct 2013 16:56:54 +0000 (16:56 +0000)]
clang-cl: ignore the /sdl[-] flag

In cl.exe, this flag turns some warnings into errors and adds some
codegen security checks. I don't think we intend to support this.

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

11 years agoAdd fixits suggesting parenthesis around type name in expressions like sizeof.
Serge Pavlov [Tue, 8 Oct 2013 16:56:30 +0000 (16:56 +0000)]
Add fixits suggesting parenthesis around type name in expressions like sizeof.
This fixes PR16992 - Fixit missing when "sizeof type" found.

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

11 years agoclang-format: Improve indentation when deriving from templated classes.
Daniel Jasper [Tue, 8 Oct 2013 16:24:07 +0000 (16:24 +0000)]
clang-format: Improve indentation when deriving from templated classes.

Before:
  struct aaaaaaaaaaaaa : public aaaaaaaaaaaaaaaaaaa< //
      aaaaaaaaaaaaaaaa> {};
  struct aaaaaaaaaaaaaaaaaaaa : public aaaaaaaaaaaaaaaaaaa<
      aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa> {};

After:
  struct aaaaaaaaaaaaa : public aaaaaaaaaaaaaaaaaaa< //
                             aaaaaaaaaaaaaaaa> {};
  struct aaaaaaaaaaaaaaaaaaaa
      : public aaaaaaaaaaaaaaaaaaa<aaaaaaaaaaaaaaaaaaaaa,
                                   aaaaaaaaaaaaaaaaaaaaaa> {};

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

11 years agoclang-format: Don't exit with failure on empty files.
Daniel Jasper [Tue, 8 Oct 2013 15:54:36 +0000 (15:54 +0000)]
clang-format: Don't exit with failure on empty files.

Also let clang-format-diff.py detect errors based on clang-format's
return code. Otherwise messages like "Can't find usable .clang-format,
falling back to LLVM style" can make it fail, which might be undesired.

Patch by Alp Toker. Thank you!

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

11 years agoMake InstantiatingTemplate depth checks clearer
Alp Toker [Tue, 8 Oct 2013 08:09:04 +0000 (08:09 +0000)]
Make InstantiatingTemplate depth checks clearer

The bool conversion operator on InstantiatingTemplate never added value and
only served to obfuscate the template instantiation routines.

This replaces the conversion and its callers with an explicit isInvalid()
function to make it clear what's going on at a glance.

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

11 years agoclang-format: Improve constructor initializer linewrapping.
Daniel Jasper [Tue, 8 Oct 2013 05:11:18 +0000 (05:11 +0000)]
clang-format: Improve constructor initializer linewrapping.

Specifically make ConstructorInitializerAllOnOneLineOrOnePerLine work
nicely with BreakConstructorInitializersBeforeComma.

This fixes llvm.org/PR17395.

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

11 years agoFix linkage calculation of auto member functions returning lambdas
Faisal Vali [Tue, 8 Oct 2013 04:15:04 +0000 (04:15 +0000)]
Fix linkage calculation of auto member functions returning lambdas

As described by Richard in https://groups.google.com/a/isocpp.org/d/msg/std-discussion/S1kmj0wF5-g/fb6agEYoL2IJ

we should allow:

template<typename S>
struct A {

template<typename T> static auto default_lambda() {
  return [](const T&) { return 42; };
}

template<class U = decltype(default_lambda<S>())>
  U func(U u = default_lambda<S>()) { return u; }

};

int run2 = A<double>{}.func()(3.14);

int run3 = A<char>{}.func()('a');

This patch allows the code using the same trickery that was used to allow the code in non-member functions at namespace scope.

Please see http://llvm-reviews.chandlerc.com/D1844 for richard's approval.

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

11 years ago[ms-cxxabi] Fix the calling convention for operator new in records
Reid Kleckner [Tue, 8 Oct 2013 00:58:57 +0000 (00:58 +0000)]
[ms-cxxabi] Fix the calling convention for operator new in records

Summary:
Operator new, new[], delete, and delete[] are all implicitly static when
declared inside a record.  CXXMethodDecl already knows this, but we need
to account for that before we pick the calling convention for the
function type.

Fixes PR17371.

Reviewers: rsmith

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

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

11 years agoSema: Only merge typedef attributes if the previous decl is a typedef
Justin Bogner [Tue, 8 Oct 2013 00:19:09 +0000 (00:19 +0000)]
Sema: Only merge typedef attributes if the previous decl is a typedef

In r186373, we started merging attributes on typedefs, but this causes
us to try to merge attributes even if the previous declaration was not
a typedef.

Only merge the attributes if the previous decl was also a typedef.

Fixes rdar://problem/15044218

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

11 years agoTBAA: use the same format for scalar TBAA and struct-path aware TBAA.
Manman Ren [Tue, 8 Oct 2013 00:08:49 +0000 (00:08 +0000)]
TBAA: use the same format for scalar TBAA and struct-path aware TBAA.

An updated version of r191586 with bug fix.

Struct-path aware TBAA generates tags to specify the access path,
while scalar TBAA only generates tags to scalar types.

We should not generate a TBAA tag with null being the first field. When
a TBAA type node is null, the tag should be null too. Make sure we
don't decorate an instruction with a null TBAA tag.

Added a testing case for the bug reported by Richard with -relaxed-aliasing
and -fsanitizer=thread.

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

11 years agoSplit test to test -Wshadow with emmintrin.h more portable.
Ted Kremenek [Tue, 8 Oct 2013 00:03:41 +0000 (00:03 +0000)]
Split test to test -Wshadow with emmintrin.h more portable.

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

11 years agoSuppress useless -Wshadow warning when using _mm* macros from emmintrin.h
Ted Kremenek [Mon, 7 Oct 2013 23:51:11 +0000 (23:51 +0000)]
Suppress useless -Wshadow warning when using _mm* macros from emmintrin.h

Fixes <rdar://problem/10679282>.

I'm not completely satisfied with this patch.  Sprinkling "diagnostic ignored"
_Pragmas throughout this file is gross, but I couldn't suppress
it for the entire file.

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

11 years agoclang-cl: Accept and mostly ignore /vm*, /GF, /GF-, /Zm, and /bigobj
Reid Kleckner [Mon, 7 Oct 2013 23:19:01 +0000 (23:19 +0000)]
clang-cl: Accept and mostly ignore /vm*, /GF, /GF-, /Zm, and /bigobj

Patch by David Ziman!

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

11 years agoAdd a triple to unbreak buildbots where size_t is not 'unsigned long'.
Richard Smith [Mon, 7 Oct 2013 22:58:25 +0000 (22:58 +0000)]
Add a triple to unbreak buildbots where size_t is not 'unsigned long'.

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

11 years agoRemove -ast-dump-xml.
Richard Smith [Mon, 7 Oct 2013 20:56:34 +0000 (20:56 +0000)]
Remove -ast-dump-xml.

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

11 years agoObjectiveC migrator: A typical implementation of
Fariborz Jahanian [Mon, 7 Oct 2013 20:41:53 +0000 (20:41 +0000)]
ObjectiveC migrator: A typical implementation of
'default' methods in Foundation does not
infer 'instancetype' for methods' result type.
// rdar://15145218

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

11 years agoAdd support for WG21 N3599 (literal operator template for strings) as a GNU
Richard Smith [Mon, 7 Oct 2013 19:57:58 +0000 (19:57 +0000)]
Add support for WG21 N3599 (literal operator template for strings) as a GNU
extension. The GCC folks have decided to support this even though the standard
committee have not yet approved this feature.

Patch by Hristo Venev!

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

11 years agoObjectiveC modern rewriter. Rewrite typedefs
Fariborz Jahanian [Mon, 7 Oct 2013 19:54:22 +0000 (19:54 +0000)]
ObjectiveC modern rewriter. Rewrite typedefs
declared locally in ObjectiveC containers.
// rdar://15143875

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

11 years agoFix objectsize tests after r192117
Matt Arsenault [Mon, 7 Oct 2013 19:00:18 +0000 (19:00 +0000)]
Fix objectsize tests after r192117

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

11 years agoObjectiveC: Warn when 'readonly' property has explicit
Fariborz Jahanian [Mon, 7 Oct 2013 17:20:02 +0000 (17:20 +0000)]
ObjectiveC: Warn when 'readonly' property has explicit
ownership attribute (such as 'copy', 'assign' etc.)
// rdar://15131088

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

11 years ago[analyzer] ArrayRef-ize BugReporter::EmitBasicReport.
Jordan Rose [Mon, 7 Oct 2013 17:16:59 +0000 (17:16 +0000)]
[analyzer] ArrayRef-ize BugReporter::EmitBasicReport.

No functionality change.

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

11 years ago[analyzer] RetainCountChecker: add support for CFAutorelease.
Jordan Rose [Mon, 7 Oct 2013 17:16:52 +0000 (17:16 +0000)]
[analyzer] RetainCountChecker: add support for CFAutorelease.

<rdar://problems/13710586&13710643>

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

11 years ago[AArch64] Add support for NEON scalar arithmetic instructions:
Chad Rosier [Mon, 7 Oct 2013 17:07:17 +0000 (17:07 +0000)]
[AArch64] Add support for NEON scalar arithmetic instructions:
SQDMULH, SQRDMULH, FMULX, FRECPS, and FRSQRTS.

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

11 years ago[libclang] Add some tests by Loïc Jaquemet that I forgot to add earlier.
Argyrios Kyrtzidis [Mon, 7 Oct 2013 16:38:40 +0000 (16:38 +0000)]
[libclang] Add some tests by Loïc Jaquemet that I forgot to add earlier.

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

11 years agoSema::tryCaptureVariable(): Prune three unused variables, HasBlocksAttr, IsBlock...
NAKAMURA Takumi [Mon, 7 Oct 2013 09:32:50 +0000 (09:32 +0000)]
Sema::tryCaptureVariable(): Prune three unused variables, HasBlocksAttr, IsBlock, and IsLambda. [-Wunused-variable]

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

11 years agoFix incorrect detection of class definitions with alignas specification.
Manuel Klimek [Mon, 7 Oct 2013 09:15:41 +0000 (09:15 +0000)]
Fix incorrect detection of class definitions with alignas specification.

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

11 years agoWhen merging class definitions across modules in C++, merge together fields.
Richard Smith [Mon, 7 Oct 2013 08:02:11 +0000 (08:02 +0000)]
When merging class definitions across modules in C++, merge together fields.
This change doesn't go all the way to making fields redeclarable; instead, it
makes them 'mergeable', which means we can find the canonical declaration, but
not much else (and for a declaration that's not from a module, the canonical
declaration is always that declaration).

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

11 years agoDriver: Use the canonical command line arguments.
David Majnemer [Mon, 7 Oct 2013 07:33:27 +0000 (07:33 +0000)]
Driver: Use the canonical command line arguments.

Summary:
Use the arguments given to the OS at process creation-time instead of
the arguments passed into main() by the C runtime environment.  The ones
that main() received may not be suitable (e.g. not Unicode).

Depends on D1834

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

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

11 years agoRefactor tryCaptureVar using ExtractMethod. No functionality change.
Faisal Vali [Mon, 7 Oct 2013 05:13:48 +0000 (05:13 +0000)]
Refactor tryCaptureVar using ExtractMethod.  No functionality change.

In chicago, Doug had requested that I go ahead and commit the refactor  as a separate change, if all the tests passed.

Lets hope the buildbots stay quiet.

Thanks!

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

11 years agoFix PR17382 - properly group virtual method overloads in the vftable
Timur Iskhodzhanov [Sun, 6 Oct 2013 15:31:37 +0000 (15:31 +0000)]
Fix PR17382 - properly group virtual method overloads in the vftable

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

11 years agoclang-format: Remove empty lines after visibility modifiers.
Daniel Jasper [Sun, 6 Oct 2013 11:40:08 +0000 (11:40 +0000)]
clang-format: Remove empty lines after visibility modifiers.

Formatting:
  class C {
  public:

    f();
  };

Now leads to:
  class C {
  public:
    f();
  };

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

11 years agoremove a dead assignment. The variables are set just right after. Found by scan-build...
Sylvestre Ledru [Sun, 6 Oct 2013 09:54:18 +0000 (09:54 +0000)]
remove a dead assignment. The variables are set just right after. Found by scan-build http://buildd-clang.debian.net/scan-build/

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

11 years agoPass CGCXXABIs around directly.
Mark Lacey [Sun, 6 Oct 2013 01:33:34 +0000 (01:33 +0000)]
Pass CGCXXABIs around directly.

In functions that only need to use the CGCXXABI member of a CodeGenTypes
class, pass that reference around directly rather than a reference to
a CodeGenTypes class.

This makes the actual dependence on CGCXXABI clear at the call sites.

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

11 years agoSwitching the CallableWhen attribute over to using the string literal helper function...
Aaron Ballman [Sat, 5 Oct 2013 22:45:34 +0000 (22:45 +0000)]
Switching the CallableWhen attribute over to using the string literal helper function instead of custom logic.

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

11 years agoAdd support for -mcx16, and predefine __GCC_HAVE_SYNC_COMPARE_AND_SWAP_16 when
Nick Lewycky [Sat, 5 Oct 2013 20:14:27 +0000 (20:14 +0000)]
Add support for -mcx16, and predefine __GCC_HAVE_SYNC_COMPARE_AND_SWAP_16 when
it is enabled. Also enable it on the same architectures that GCC does.

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

11 years agoSilencing an MSVC warning; SmallSet::count returns a bool instead of a size_t.
Aaron Ballman [Sat, 5 Oct 2013 19:56:07 +0000 (19:56 +0000)]
Silencing an MSVC warning; SmallSet::count returns a bool instead of a size_t.

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

11 years agoUse logical/arithmetic operations instead of builtins in tbmintrin.h. This way we...
Craig Topper [Sat, 5 Oct 2013 17:08:42 +0000 (17:08 +0000)]
Use logical/arithmetic operations instead of builtins in tbmintrin.h. This way we can remove the intrinsic support from the backend.

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

11 years agoRemove unused param from Linux::computeSysRoot().
Simon Atanasyan [Sat, 5 Oct 2013 14:37:55 +0000 (14:37 +0000)]
Remove unused param from Linux::computeSysRoot().

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

11 years agoSema: Cleanup redundant variable NumArgsToCheck
Benjamin Kramer [Sat, 5 Oct 2013 10:03:01 +0000 (10:03 +0000)]
Sema: Cleanup redundant variable NumArgsToCheck

Patch by Daniel Marjamäki!

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

11 years agoImplement aarch64 neon instruction set AdvSIMD (Across).
Jiangning Liu [Sat, 5 Oct 2013 08:22:55 +0000 (08:22 +0000)]
Implement aarch64 neon instruction set AdvSIMD (Across).

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

11 years agoRemove unused Sema::DelayedDestructorExceptionSpecs
Alp Toker [Sat, 5 Oct 2013 06:50:51 +0000 (06:50 +0000)]
Remove unused Sema::DelayedDestructorExceptionSpecs

This was a leftover from r160847.

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

11 years agoDebug Info: update testing cases when the derived-from field of a
Manman Ren [Sat, 5 Oct 2013 01:43:22 +0000 (01:43 +0000)]
Debug Info: update testing cases when the derived-from field of a
DW_TAG_pointer_type is updated to use DITypeRef.

Paired commit with r192018.

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

11 years agoConsumed Analysis: Change callable_when so that it can take a list of states
DeLesley Hutchins [Fri, 4 Oct 2013 21:28:06 +0000 (21:28 +0000)]
Consumed Analysis:  Change callable_when so that it can take a list of states
that a function can be called in.  This reduced the total number of annotations
needed and makes writing more complicated behaviour less burdensome.
Patch by chriswails@gmail.com.

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

11 years agoObjectiveC. Allow readonly properties without an explicit ownership
Fariborz Jahanian [Fri, 4 Oct 2013 18:06:08 +0000 (18:06 +0000)]
ObjectiveC. Allow readonly properties without an explicit ownership
(assign/unsafe_unretained/weak/retain/strong/copy) in super class
to be overridden by a property with any explicit ownership in the
subclass. // rdar://15014468

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

11 years agoTemporarily revert r191801 due to conflicts with the revert of r191792.
Eric Christopher [Fri, 4 Oct 2013 17:08:47 +0000 (17:08 +0000)]
Temporarily revert r191801 due to conflicts with the revert of r191792.

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

11 years agoDon't assume instruction names in the output.
Rafael Espindola [Fri, 4 Oct 2013 14:42:00 +0000 (14:42 +0000)]
Don't assume instruction names in the output.

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

11 years agoAdd test from pr17476.
Rafael Espindola [Fri, 4 Oct 2013 14:33:42 +0000 (14:33 +0000)]
Add test from pr17476.

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

11 years agoRevert "Teach TreeTransform and family how to transform generic lambdas within templa...
Rafael Espindola [Fri, 4 Oct 2013 14:28:51 +0000 (14:28 +0000)]
Revert "Teach TreeTransform and family how to transform generic lambdas within templates and nested within themselves."

This reverts commit r191879. It caused llvm.org/pr17476.

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

11 years agoDo not emit undefined lsrh/ashr for NEON shifts
Amaury de la Vieuville [Fri, 4 Oct 2013 13:13:15 +0000 (13:13 +0000)]
Do not emit undefined lsrh/ashr for NEON shifts

These IR instructions are undefined when the amount is equal to operand
size, but NEON right shifts support such shifts. Work around that by
emitting a different IR in these cases.

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

11 years agoRevert r191947. The problem is not MIPS-specific and requires more
Simon Atanasyan [Fri, 4 Oct 2013 11:46:54 +0000 (11:46 +0000)]
Revert r191947. The problem is not MIPS-specific and requires more
general solution.

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

11 years agoSimplify MicrosoftCXXNameMangler::mangleFunctionType
Timur Iskhodzhanov [Fri, 4 Oct 2013 11:25:05 +0000 (11:25 +0000)]
Simplify MicrosoftCXXNameMangler::mangleFunctionType

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

11 years ago[Mips] For MIPS '-fPIC -static' means to compile as -fPIC but link with
Simon Atanasyan [Fri, 4 Oct 2013 10:36:42 +0000 (10:36 +0000)]
[Mips] For MIPS '-fPIC -static' means to compile as -fPIC but link with
-static. So do not turn off the PIC flag if -static passed to the
driver in case of MIPS target.

http://llvm.org/bugs/show_bug.cgi?id=14693

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

11 years agoImplement aarch64 neon instruction set AdvSIMD (3V elem).
Jiangning Liu [Fri, 4 Oct 2013 09:21:17 +0000 (09:21 +0000)]
Implement aarch64 neon instruction set AdvSIMD (3V elem).

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

11 years ago[analyzer] Replace bug category magic strings with shared constants, take 2.
Jordan Rose [Fri, 4 Oct 2013 00:25:24 +0000 (00:25 +0000)]
[analyzer] Replace bug category magic strings with shared constants, take 2.

Re-commit r191910 (reverted in r191936) with layering violation fixed, by
moving the bug categories to StaticAnalyzerCore instead of ...Checkers.

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

11 years agoTemporarily revert r191910 until the layering violation can be fixed.
Richard Smith [Thu, 3 Oct 2013 23:38:02 +0000 (23:38 +0000)]
Temporarily revert r191910 until the layering violation can be fixed.

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

11 years agoDon't complain about -fuse-ld=gold (cf r191429).
Nico Weber [Thu, 3 Oct 2013 19:45:55 +0000 (19:45 +0000)]
Don't complain about -fuse-ld=gold (cf r191429).

(There's a real implementation for this flag in review.)

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

11 years agoFix the test in clang_f_opts.c to fail on unknown options.
Rafael Espindola [Thu, 3 Oct 2013 19:34:34 +0000 (19:34 +0000)]
Fix the test in clang_f_opts.c to fail on unknown options.

Also fix options that were broken in the previous refactorings.

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

11 years agoFix test.
Rafael Espindola [Thu, 3 Oct 2013 19:18:22 +0000 (19:18 +0000)]
Fix test.

With -### clang return 0, so we have to use FileCheck to see if there was an
error.

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

11 years agoMake this use -### instead of a temporary output.
Eric Christopher [Thu, 3 Oct 2013 18:23:29 +0000 (18:23 +0000)]
Make this use -### instead of a temporary output.

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

11 years agoGive this a temporary output so it is cleaned up.
Eric Christopher [Thu, 3 Oct 2013 18:02:14 +0000 (18:02 +0000)]
Give this a temporary output so it is cleaned up.

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

11 years agoIgnore -mieee-fp.
Rafael Espindola [Thu, 3 Oct 2013 17:06:43 +0000 (17:06 +0000)]
Ignore -mieee-fp.

It looks like clang always produce code with the ieee comparisons, so it is
safe to ignore this flag (we still error on -mno-ieee-fp).

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

11 years ago[analyzer] Replace bug category magic strings with shared constants.
Jordan Rose [Thu, 3 Oct 2013 16:57:20 +0000 (16:57 +0000)]
[analyzer] Replace bug category magic strings with shared constants.

One small functionality change is to bring the sizeof-pointer checker in
line with the other checkers by making its category be "Logic error"
instead of just "Logic". There should be no other functionality changes.

Patch by Daniel Marjamäki!

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

11 years ago[analyzer] Add new debug helper clang_analyzer_warnIfReached.
Jordan Rose [Thu, 3 Oct 2013 16:57:03 +0000 (16:57 +0000)]
[analyzer] Add new debug helper clang_analyzer_warnIfReached.

This will emit a warning if a call to clang_analyzer_warnIfReached is
executed, printing REACHABLE. This is a more explicit way to declare
expected reachability than using clang_analyzer_eval or triggering
a bug (divide-by-zero or null dereference), and unlike the former will
work the same in inlined functions and top-level functions. Like the
other debug helpers, it is part of the debug.ExprInspection checker.

Patch by Jared Grubb!

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

11 years ago[libclang] python: expose a few functions, patch by Loïc Jaquemet!
Argyrios Kyrtzidis [Thu, 3 Oct 2013 16:19:27 +0000 (16:19 +0000)]
[libclang] python: expose a few functions, patch by Loïc Jaquemet!

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

11 years ago[libclang] Introduce clang_Type_getClassType which returns the class type of a member...
Argyrios Kyrtzidis [Thu, 3 Oct 2013 16:19:23 +0000 (16:19 +0000)]
[libclang] Introduce clang_Type_getClassType which returns the class type of a member pointer type.

Patch by Che-Liang Chiou!

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

11 years agoFix test to work on Linux hosts by specifying triple.
Tim Northover [Thu, 3 Oct 2013 14:29:54 +0000 (14:29 +0000)]
Fix test to work on Linux hosts by specifying triple.

Thought I'd checked that before

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

11 years agoARM: *-*-darwin-eabi triples should use AAPCS.
Tim Northover [Thu, 3 Oct 2013 14:23:28 +0000 (14:23 +0000)]
ARM: *-*-darwin-eabi triples should use AAPCS.

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

11 years agoGracefully (and correctly) handle init of multiple union members
Matthew Curtis [Thu, 3 Oct 2013 12:14:24 +0000 (12:14 +0000)]
Gracefully (and correctly) handle init of multiple union members

We now emit warnings when doing so and code generation is consistent
with GCC. Note that the C99 spec is unclear as to the precise
behavior.

See also ...
Bug:
  http://llvm.org/bugs/show_bug.cgi?id=16644 and

cfe-dev discussion:
  http://lists.cs.uiuc.edu/pipermail/cfe-dev/2013-September/031918.html

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

11 years agoTeach TreeTransform and family how to transform generic lambdas within templates...
Faisal Vali [Thu, 3 Oct 2013 06:29:33 +0000 (06:29 +0000)]
Teach TreeTransform and family how to transform generic lambdas within templates and nested within themselves.

This does not yet include capturing (that is next).

Please see test file for examples.

This patch was LGTM'd by Doug:
http://llvm-reviews.chandlerc.com/D1784
http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20130930/090048.html

When I first committed this patch - a bunch of buildbots were unable to compile the code that VS2010 seemed to compile.  Seems like there was a dependency on Sema/Template.h which VS did not seem to need, but I have now added for the other compilers.  It still compiles on Visual Studio 2010 - lets hope the buildbots remain quiet (please!)

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

11 years agoExtract ABI-specific parts of MangleContext into separate classes
Timur Iskhodzhanov [Thu, 3 Oct 2013 06:26:13 +0000 (06:26 +0000)]
Extract ABI-specific parts of MangleContext into separate classes

Reviewed at http://llvm-reviews.chandlerc.com/D1807

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