Commit Graph

48608 Commits

Author SHA1 Message Date
Richard Smith b87c465391 Store a TypeArgument on an attribute as a TypeSourceInfo*, rather than as a
QualType with a SourceLocation stashed alongside.

llvm-svn: 193803
2013-10-31 21:23:20 +00:00
Kaelyn Uhrain bd6ddaa0e7 Fix a C struct diagnostic regression introduced by r187504 (PR17762).
llvm-svn: 193799
2013-10-31 20:32:56 +00:00
Chad Rosier bdca387884 [AArch64] Add support for NEON scalar shift immediate instructions.
llvm-svn: 193791
2013-10-31 19:29:05 +00:00
Rui Ueyama 727025a5e1 Use StringRef::endswith_lower. No functionality change.
llvm-svn: 193788
2013-10-31 19:12:53 +00:00
Jordan Rose 1417a7b174 [analyzer] Don't crash when a path goes through a 'delete' destructor call.
This was just left unimplemnted from r191381; the fix is to report this call
location as the location of the 'delete' expr.

PR17746

llvm-svn: 193783
2013-10-31 18:41:15 +00:00
Aaron Ballman 1306625b91 iboutletcollection really does have custom parsing.
llvm-svn: 193777
2013-10-31 17:44:01 +00:00
Benjamin Kramer 907305377a Remove unused diagnostic.
llvm-svn: 193774
2013-10-31 17:36:01 +00:00
Fariborz Jahanian d41dbadacd ObjectiveC migrator. Change naming hueristic for
deprecated categories, fixes a typo reported by
Jordan.

llvm-svn: 193759
2013-10-31 16:10:44 +00:00
Faisal Vali fe194d5a84 sizeof... a parameter pack should be an unevaluated context.
- can't think of a way to test this without generic lambda captures, but will include a test once that patch is made commit-ready.

patch was ok'd by Doug.
http://llvm-reviews.chandlerc.com/D2029 

llvm-svn: 193757
2013-10-31 15:58:51 +00:00
Chris Wailes 93edffa8fe Fixed bug with checking the kind of types.
The isLValueReferenceType function checks to see if the QualType's
canonical type is an LValue reference, and not if the QualType
itself is an LValue reference.  This caused a segfault when trying
to cast the QualType's Type to a LValueReference.  This is now
fixed by casting the result of getCanonicalType().

In addition, a test was added to isConsumableType to prevent
segfaults when a type being tested by the analysis is a reference
to a pointer or a pointer to a reference.

llvm-svn: 193751
2013-10-31 15:38:12 +00:00
Amara Emerson 703da2ea98 [AArch64] Add some CPU targets for "generic", A-53 and A-57.
Enables the clang driver to begin targeting specific CPUs. Introduced a
"generic" CPU which will ensure that the optional FP feature is enabled
by default when it gets to LLVM, without needing any extra arguments.
Cortex-A53 and A-57 are also introduced with tests, although backend
handling of them does not yet exist.

llvm-svn: 193740
2013-10-31 09:32:33 +00:00
Richard Smith b1f9a283ac Factor out custom parsing for iboutletcollection and vec_type_hint attributes
into a separate "parse an attribute that takes a type argument" codepath. This
results in both codepaths being a lot cleaner and simpler, and fixes some bugs
where the type argument handling bled into the expression argument handling and
caused us to both accept invalid and reject valid attribute arguments.

llvm-svn: 193731
2013-10-31 01:56:18 +00:00
Fariborz Jahanian 9d2ffea486 ObjectiveC migrator: annotate all protocols/methods in
a category with NSxxxDeprecated name with deprecated
annotation. // rdar://15337661

llvm-svn: 193726
2013-10-31 00:06:58 +00:00
Argyrios Kyrtzidis 28d5b6bb11 [libclang/python] Add __contains__ to SourceRange class.
Patch by Loïc Jaquemet!

llvm-svn: 193725
2013-10-31 00:03:33 +00:00
Mark Lacey fbbc738eb7 Fix Windows build by including CGFunctionInfo.h.
CodeGenTypes.h instantiates llvm::FoldingSet<> with CGFunctionInfo,
and VC++ doesn't like the static_cast from FoldingSetImpl::Node* to
CGFunctionInfo* since it hasn't seen the definition of CGFunctionInfo
and that it inherits from FoldingSetImpl::Node.

llvm-svn: 193722
2013-10-30 23:40:28 +00:00
Mark Lacey a8e7df3602 Add CodeGenABITypes.h for use in LLDB.
CodeGenABITypes is a wrapper built on top of CodeGenModule that exposes
some of the functionality of CodeGenTypes (held by CodeGenModule),
specifically methods that determine the LLVM types appropriate for
function argument and return values.

I addition to CodeGenABITypes.h, CGFunctionInfo.h is introduced, and the
definitions of ABIArgInfo, RequiredArgs, and CGFunctionInfo are moved
into this new header from the private headers ABIInfo.h and CGCall.h.

Exposing this functionality is one part of making it possible for LLDB
to determine the actual ABI locations of function arguments and return
values, making it possible for it to determine this for any supported
target without hard-coding ABI knowledge in the LLDB code.

llvm-svn: 193717
2013-10-30 21:53:58 +00:00
Hans Wennborg 31c51ccace clang-cl: Parse the /arch, /Yu and /Fp options (PR17736)
We don't support these options, but should at least parse them.

llvm-svn: 193702
2013-10-30 17:36:27 +00:00
Daniel Sanders d5f554f0bb [mips][msa] Correct definition of bins[lr] and CHECK-DAG-ize related tests
llvm-svn: 193695
2013-10-30 15:45:42 +00:00
Daniel Sanders ab94b537d7 [mips][msa] Added support for matching bmnz, bmnzi, bmz, and bmzi from normal IR (i.e. not intrinsics)
Also corrected the definition of the intrinsics for these instructions (the
result register is also the first operand), and added intrinsics for bsel and
bseli to clang (they already existed in the backend).

These four operations are mostly equivalent to bsel, and bseli (the difference
is which operand is tied to the result). As a result some of the tests changed
as described below.

bitwise.ll:
- bsel.v test adapted so that the mask is unknown at compile-time. This stops
  it emitting bmnzi.b instead of the intended bsel.v.
- The bseli.b test now tests the right thing. Namely the case when one of the
  values is an uimm8, rather than when the condition is a uimm8 (which is
  covered by bmnzi.b)

compare.ll:
- bsel.v tests now (correctly) emits bmnz.v instead of bsel.v because this
  is the same operation (see MSA.txt).

i8.ll
- CHECK-DAG-ized test.
- bmzi.b test now (correctly) emits equivalent bmnzi.b with swapped operands
  because this is the same operation (see MSA.txt).
- bseli.b still emits bseli.b though because the immediate makes it
  distinguishable from bmnzi.b.

vec.ll:
- CHECK-DAG-ized test.
- bmz.v tests now (correctly) emits bmnz.v with swapped operands (see
  MSA.txt).
- bsel.v tests now (correctly) emits bmnz.v with swapped operands (see
  MSA.txt).

llvm-svn: 193693
2013-10-30 15:20:38 +00:00
Chad Rosier 4d55e6e0a4 [AArch64] Add support for NEON scalar floating-point compare instructions.
llvm-svn: 193692
2013-10-30 15:20:07 +00:00
Alp Toker b364428fca Avoid diagnosing twice on non-x86 targets
The PowerPC and ARM native builders spotted this.

llvm-svn: 193688
2013-10-30 15:07:10 +00:00
Daniel Sanders d74b130cc9 [mips][msa] Added support for matching bins[lr]i.[bhwd] from normal IR (i.e. not intrinsics)
This required correcting the definition of the bins[lr]i intrinsics because
the result is also the first operand.

It also required removing the (arbitrary) check for 32-bit immediates in
MipsSEDAGToDAGISel::selectVSplat().

Currently using binsli.d with 2 bits set in the mask doesn't select binsli.d
because the constant is legalized into a ConstantPool. Similar things can
happen with binsri.d with more than 10 bits set in the mask. The resulting
code when this happens is correct but not optimal.

llvm-svn: 193687
2013-10-30 14:45:14 +00:00
Alp Toker 56cf2cb55a Fix triple / REQUIRES in test from r193685
llvm-svn: 193686
2013-10-30 14:38:32 +00:00
Alp Toker 45cf31f7d3 Recover instead of crashing on MS assembly when no target is loaded
It's possible to embed the frontend in applications that haven't initialized
backend targets so we need to handle this condition gracefully.

llvm-svn: 193685
2013-10-30 14:29:28 +00:00
Daniel Jasper 16fc754216 clang-format: Fix indenting corner case with comment and else.
Before:
  if (a) {
    f();
  }
      // or else ..
      else {
    g();
  }

After:
  if (a) {
    f();
  }
  // or else ..
  else {
    g();
  }

llvm-svn: 193684
2013-10-30 14:04:10 +00:00
Daniel Jasper 9885784d67 clang-format: Fix whitespaces in include directives.
Before (clang-format wouldn't change):
  #include  "a.h"
  #include<a>

After:
  #include "a.h"
  #include <a>

This fixes llvm.org/PR16151.

llvm-svn: 193683
2013-10-30 13:54:53 +00:00
Timur Iskhodzhanov 0201432a5e Make thunk this/return adjustment ABI-specific. Also, fix the return adjustment when using -cxx-abi microsoft
Reviewed at http://llvm-reviews.chandlerc.com/D2026

llvm-svn: 193679
2013-10-30 11:55:43 +00:00
Daniel Jasper 580da27616 clang-format: fix for \r\r\n produced in multiline block comments
Patch by Christopher Olsen. Thank you!

llvm-svn: 193678
2013-10-30 07:36:40 +00:00
Akira Hatanaka babd67e6ce [mips] Delete unused functions.
llvm-svn: 193674
2013-10-30 02:38:17 +00:00
Richard Smith 3876cc88ac PR17731: When determining whether a tag and a non-tag were declared in the same
scope, be careful about function-scope declarations (which are not declared in
their semantic context).

llvm-svn: 193671
2013-10-30 01:02:04 +00:00
Warren Hunt 7c55e7ef0e Minor efficiency refactor related to 193661. No functional change.
llvm-svn: 193665
2013-10-30 00:14:55 +00:00
Warren Hunt af41fcce0e Activating latent test case for r193661.
llvm-svn: 193664
2013-10-30 00:08:34 +00:00
Warren Hunt dbbc5dfd12 Fixing code gen to handle microsoft layouts for which size % alignment
!= 0

llvm-svn: 193661
2013-10-29 23:49:26 +00:00
Chris Wailes 9385f9f7c3 Changed tests_typestate to test_typestate for consistency.
llvm-svn: 193648
2013-10-29 20:28:41 +00:00
Evgeniy Stepanov 4ae68468cd Add -lm to sanitizer link arguments.
We'll need to intercept a few function in libm.

llvm-svn: 193644
2013-10-29 19:48:47 +00:00
Rafael Espindola 8c8711207c Add support for the separate version of /FI.
Patch by Jeff Muizelaar.

llvm-svn: 193642
2013-10-29 19:42:01 +00:00
Akira Hatanaka 618b29813a [mips] Align the stack to 16-bytes for -mfp64.
llvm-svn: 193640
2013-10-29 19:00:35 +00:00
Akira Hatanaka ddd6634340 [mips] Use the distance between the current argument's starting address and
the previous argument's ending address to compute the type of the padding
argument.

No intended functionality change.

llvm-svn: 193638
2013-10-29 18:41:15 +00:00
Akira Hatanaka 9064e36551 [mips] Move setDescriptionString to base class MipsTargetInfoBase and call it
at the end of handleTargetFeatures.

No intended functionality change.

llvm-svn: 193636
2013-10-29 18:30:33 +00:00
Tom Stellard 08ded12ffb R600: Add Sea Islands GPUs
llvm-svn: 193622
2013-10-29 16:38:29 +00:00
Daniel Jasper dd978ae0e1 clang-format: Option to control spacing in template argument lists.
Same as SpacesInParentheses, this option allows adding a space inside
the '<' and '>' of a template parameter list.

Patch by Christopher Olsen.

This fixes llvm.org/PR17301.

llvm-svn: 193614
2013-10-29 14:52:02 +00:00
Samuel Benzaquen f34ac3ed2c Resubmit "Refactor DynTypedMatcher into a value type class, just like Matcher<T>."
Summary: This resubmits r193100, plus a fix for a breakage with MSVC.

Reviewers: klimek, rnk

CC: cfe-commits, revane

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

llvm-svn: 193613
2013-10-29 14:37:15 +00:00
Timur Iskhodzhanov 66f4381b39 Fix an assertion when handling a custom case of virtual inheritance; also reduce code duplication
llvm-svn: 193610
2013-10-29 14:13:45 +00:00
Timur Iskhodzhanov d7354bb354 Add a missing lit-test expectation (forgotten to write initially?)
llvm-svn: 193608
2013-10-29 13:29:32 +00:00
Sylvestre Ledru 9f453d27bf Use LLVMLibsOptions intead of LDFLAGS when setting the libclang soname. This allows 'make LDFLAGS=foo' to be set correctly (and matches the way it is done with libllvm and liblldb)
llvm-svn: 193607
2013-10-29 13:01:41 +00:00
Tim Northover 58d2bb12ff ARM: fix AST for __builtin_arm_strex call
The AST was constructed so that this builtin returned the default BoolTy and
since I'd opted for custom SemaChecking, I should have set it properly at that
point.

This caused an assertion failure when the types didn't match up with what we
generated. This makes it return an IntTy, which is as good as anything.

llvm-svn: 193606
2013-10-29 12:32:58 +00:00
Daniel Jasper edc5f09175 clang-format: Fix overloaded operator for global-scoped conversions.
Before:
  operator::A();

After:
  operator ::A();

llvm-svn: 193605
2013-10-29 12:24:23 +00:00
Chandler Carruth da797048d9 Teach the driver to not try to use 'lib32' multilib spellings on ARM
which doesn't use that multilib. As a consequence, fix Clang's support
for cross compiling environments that were relying on this quirk to
ensure the correct library search path ordering.

This also re-instates the new test cases from Rafael's r193528 for
cross-compiling to ARM on Ubuntu 13.10 without any of the changes to the
existing test cases (they were no longer needed).

This solution was the result of a lot of IRC debugging and trying to
understand *exactly* what quirk was being relied upon. It took some time
for me to figure out that it was the use of 'lib32' is a multilib that
was throwing a wrench in the works.

In case you are thinking that its silly to use a multilib of 'lib' at
all, entertainingly, GCC does so as well (you can see it with the
.../lib/../lib/crt1.o pattern it uses), and the 2-phase sequence of
search paths (multilib followed by non-multilib) has observable (if
dubious) consequences. =/ Yuck.

llvm-svn: 193601
2013-10-29 10:27:30 +00:00
Bernard Ogden 18b5701a68 ARM: Add -m[no-]crc to dis/enable CRC subtargetfeature from clang
Allow users to disable or enable CRC subtarget feature.

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

llvm-svn: 193600
2013-10-29 09:47:51 +00:00
Chandler Carruth 4952448b56 Doh, got this turned around. This is in fact the consistent ordering.
llvm-svn: 193596
2013-10-29 08:57:33 +00:00