Commit Graph

54382 Commits

Author SHA1 Message Date
Argyrios Kyrtzidis a2a1e53085 [libclang] Fixup the cursor spelling range for C++ destructors, operator overloads, and conversion functions.
Patch by Craig Tenenbaum!

llvm-svn: 216480
2014-08-26 20:23:26 +00:00
Alexey Samsonov 96fd0a48ec Fix an incorrect assert condition added in r216410.
llvm-svn: 216479
2014-08-26 20:18:26 +00:00
Rafael Espindola 16e1ba1e0b Return a std::unique_ptr from getBufferForFile. NFC.
llvm-svn: 216478
2014-08-26 20:17:44 +00:00
Reid Kleckner 64ecbe22aa Ignore -fdevirtualize and -fdevirtualize-speculatively for gcc compat
llvm-svn: 216477
2014-08-26 19:57:01 +00:00
Rafael Espindola 6406f7b8e0 Return a std::unique_ptr from getBufferForFile. NFC.
llvm-svn: 216476
2014-08-26 19:54:40 +00:00
Quentin Colombet bb9a858b25 [test/CodeGen/ARM] Update arm_neon_intrinsics test case to actually test the
lowering of the intrinsics.
Prior to this commit, most of the copy-related intrinsics could be optimized
away. The situation is still not ideal as there are several possibilities to
lower a given intrinsic. Currently, we match LLVM behavior.

llvm-svn: 216474
2014-08-26 18:43:31 +00:00
Joerg Sonnenberger a43604ad50 Convert MC command line flag for fatal assembler warnings into a proper
flag.

llvm-svn: 216472
2014-08-26 18:40:25 +00:00
Fariborz Jahanian 840438bb06 c11- Check for c11 language option as documentation says
feature is c11 about nested struct declarations must have
struct-declarator-list. Without this change, code
which was meant for c99 breaks. rdar://18125536

llvm-svn: 216469
2014-08-26 18:13:47 +00:00
Rafael Espindola ef872a88f2 Update for llvm api change.
llvm-svn: 216467
2014-08-26 17:29:49 +00:00
Aaron Ballman d71a5c7277 Switching from std::vector to llvm::ArrayRef per post-commit review suggestion.
llvm-svn: 216463
2014-08-26 17:05:57 +00:00
Aaron Ballman cc7f4aa2a7 Some versions of MSVC do not support initializer list construction of vectors, so this fixes a broken build from r216385.
llvm-svn: 216457
2014-08-26 14:17:25 +00:00
Aaron Ballman c0a596eabd This test was updated in r216397, but was failing on Windows due to mixed path separators as well as case sensitivity of the "no" in "no such file or directory." Rather than revert this file back to its original form, I've made some incredibly ugly regexes so that it will pass everywhere.
Note, the path this test reports a failure on (for my Windows setup) is: E:\llvm\llvm\tools\clang\test\Frontend/doesnotexist/somename

llvm-svn: 216456
2014-08-26 14:09:25 +00:00
Yi Kong 6891746cd8 arm_acle: Add mappings for dbg intrinsic
This completes all ACLE hint intrinsics.

llvm-svn: 216453
2014-08-26 12:48:11 +00:00
Yi Kong 1d268af094 ARM: Add dbg builtin intrinsic
llvm-svn: 216452
2014-08-26 12:48:06 +00:00
Daniel Jasper ad981f888a clang-format: New option SpacesInSquareBrackets.
Before:
  int a[5];
  a[3] += 42;

After:
  int a[ 5 ];
  a[ 3 ] += 42;

Fixes LLVM bug #17887 (http://llvm.org/bugs/show_bug.cgi?id=17887).

Patch by Marek Kurdej, thank you!

llvm-svn: 216449
2014-08-26 11:41:14 +00:00
Timur Iskhodzhanov 6903e10ddf [ASan/Win] Add an extra thunk.lib to handle stack-use-after-return option
With this patch, "check-asan" passes all the tests with both MT and MD ASan RTL if you set COMPILER_RT_BUILD_SHARED_ASAN to ON
(PR20214)

llvm-svn: 216447
2014-08-26 10:08:24 +00:00
Yi Kong 0705e0065e arm_acle: Implement swap intrinsic
Insert the LDREX/STREX instruction sequence specified in ARM ACLE 2.0,
as SWP instruction is deprecated since ARMv6.

llvm-svn: 216446
2014-08-26 09:50:54 +00:00
Daniel Jasper 610381ff07 clang-format: Improve handling of block comments in braced lists.
Before:
  std::vector<int> v = {
      1, 0 /* comment */
  };

After:
  std::vector<int> v = {1, 0 /* comment */};

llvm-svn: 216445
2014-08-26 09:37:52 +00:00
Richard Trieu 11fd079b6e Passing a variable to std::move now counts as a use for -Wuninitialized
llvm-svn: 216438
2014-08-26 04:30:55 +00:00
Richard Smith 43ccec8e53 [modules] Track the described template in an alias declaration that is the
pattern of an alias template declaration. Use this to merge alias templates
properly when they're members of class template specializations.

llvm-svn: 216437
2014-08-26 03:52:16 +00:00
Kostya Serebryany 4ee6904288 [clang/asan] call __asan_poison_cxx_array_cookie after operator new[]
Summary:
PR19838
When operator new[] is called and an array cookie is created
we want asan to detect buffer overflow bugs that touch the cookie.
For that we need to
  a) poison the shadow for the array cookie (call __asan_poison_cxx_array_cookie).
  b) ignore the legal accesses to the cookie generated by clang (add 'nosanitize' metadata)

Reviewers: timurrrr, samsonov, rsmith

Reviewed By: rsmith

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D4774

llvm-svn: 216434
2014-08-26 02:29:59 +00:00
Richard Smith 87dacc7922 Fix typo.
llvm-svn: 216417
2014-08-25 23:33:46 +00:00
Alexey Samsonov 525bf650cc Pass actual CXXConstructExpr instead of argument iterators
into EmitSynthesizedCXXCopyCtorCall. No functionality change.

llvm-svn: 216410
2014-08-25 21:58:56 +00:00
Fariborz Jahanian 4229228389 Objective-C. Allow [super initialize] in an +initialize
implementation but not anywhere else.
rdar://16628028

llvm-svn: 216408
2014-08-25 21:27:38 +00:00
Fariborz Jahanian be7bf7285b Objective-C modernization. Convert -initWithUTF8String messaging
with auto-boxing syntax for literals. rdar://18080352

llvm-svn: 216405
2014-08-25 20:22:25 +00:00
Alexey Samsonov a5bf76bdf3 Pass actual CallExpr instead of CallExpr-specific iterators
into EmitCXXMemberOrOperatorCall methods. In the end we want
to make declaration visible in EmitCallArgs() method, that
would allow us to alter CodeGen depending on function/parameter
attributes.

No functionality change.

llvm-svn: 216404
2014-08-25 20:17:35 +00:00
Rafael Espindola dae941a6c8 Update for llvm api change.
llvm-svn: 216397
2014-08-25 18:17:04 +00:00
Will Dietz dff50cbe26 ASTVector: Fix return value of various insert() methods.
Error caught using -fsanitize=pointer-overflow.

Expand ASTVectorTest to verify basic behavior,
test fails without functionality in this patch.

llvm-svn: 216385
2014-08-25 16:09:51 +00:00
Timur Iskhodzhanov 664dff4db7 Follow-up to r216380: update test expectations
llvm-svn: 216381
2014-08-25 12:19:12 +00:00
Timur Iskhodzhanov ea3ce790dc [ASan] Rename the ASan dynamic RT
Reviewed at http://reviews.llvm.org/D5026

llvm-svn: 216380
2014-08-25 11:44:06 +00:00
Manuel Klimek 3fe8a38110 Add hasAttr matcher for declarations.
Delete special-case CUDA attribute matchers.

Patch by Jacques Pienaar.

llvm-svn: 216379
2014-08-25 11:23:50 +00:00
Daniel Jasper 4b3ba214d0 clang-format: Understand sequenced casts.
This fixed llvm.org/PR20712.

Before:
  int i = (int)(int) -2;

After:
  int i = (int)(int)-2;

llvm-svn: 216378
2014-08-25 09:36:07 +00:00
Daniel Jasper 7189fb2cf9 clang-format: Improve formatting of nested builder-type calls.
Before:
  f(FirstToken->WhitespaceRange.getBegin().getLocWithOffset(
      First->LastNewlineOffset));

After:
  f(FirstToken->WhitespaceRange.getBegin()
        .getLocWithOffset(First->LastNewlineOffset));

llvm-svn: 216377
2014-08-25 08:48:17 +00:00
Craig Topper c6914d068f Use range based for loops to avoid needing to re-mention SmallPtrSet size.
llvm-svn: 216370
2014-08-25 04:15:02 +00:00
Richard Smith 88126a25eb [modules] Fix false report of an ODR violation when merging friend
declarations. We can't expect to find them in the canonical definition
of the class, because that's not where they live.

This means we no longer reject real ODR violations with friend declarations,
but we weren't consistently doing so anyway.

llvm-svn: 216369
2014-08-25 02:10:01 +00:00
Nikola Smiljanic 92516a8e7a PR20716 - Crash when recovering from type in known dependent base.
llvm-svn: 216352
2014-08-24 23:28:47 +00:00
Dylan Noblesmith cdd3151987 Frontend: unique_ptr-ify
NFC.

llvm-svn: 216347
2014-08-24 18:59:52 +00:00
Hal Finkel 3a1f4c77df Move __vector long deprecation checking into DeclSpec::Finish
__vector long is deprecated, but __vector long long is not. As a result, we
cannot check for __vector long (to issue the deprecation warning) as we parse
the type because we need to know how many 'long's we have first.
DeclSpec::Finish seems like a more-appropriate place to perform the check
(which places it with several other similar Altivec vector checks).

Fixes PR20720.

llvm-svn: 216342
2014-08-24 04:50:19 +00:00
Hal Finkel 6208251923 Implement __builtin_signbitl for PowerPC
PowerPC uses the special PPC_FP128 type for long double on Linux, which is
composed of two 64-bit doubles. The higher-order double (which contains the
overall sign) comes first, and so the __builtin_signbitl implementation
requires special handling to extract the sign bit.

Fixes PR20691.

llvm-svn: 216341
2014-08-24 03:47:06 +00:00
Hans Wennborg c2b7f7a6ab Don't assert on different DLL attributes in template and explicit instantiation (PR20137)
We would previously assert (a decl cannot have two DLL attributes) on this code:

  template <typename T> struct __declspec(dllimport) S { T f() { return T(); } };
  template struct __declspec(dllexport) S<int>;

The problem was that when instantiating, we would take the attribute from the
template even if the instantiation itself already had an attribute.

Also, don't inherit DLL attributes from the template to its members before
instantiation, as the attribute may change.

I couldn't figure out what MinGW does here, so I'm leaving that open. At least
we're not asserting anymore.

llvm-svn: 216340
2014-08-24 00:12:36 +00:00
Hans Wennborg ffb55639e7 Add another test for DLL attribute inheritance to partial specializations
llvm-svn: 216337
2014-08-23 23:00:29 +00:00
Hans Wennborg 7e0dab0363 Fix CodeGenCXX/dllexport.cpp test. Somehow this slipped out of my previous commit.
llvm-svn: 216334
2014-08-23 22:46:24 +00:00
Hans Wennborg 205c39bb6b MS ABI: Inherit DLL attributes to partial class template specializations
llvm-svn: 216333
2014-08-23 22:34:43 +00:00
Hans Wennborg 2f9e293e37 checkDLLAttribute: remove a redundant dyn_cast
The same dyn_cast was done earlier in the function. No functionality change.

llvm-svn: 216326
2014-08-23 21:10:39 +00:00
David Majnemer 58e4ea904b CodeGen: Skip unnamed bitfields when handling designated initializers
We would accidently initialize unnamed bitfields instead of the
following field.

llvm-svn: 216313
2014-08-23 01:48:50 +00:00
Richard Smith 88ebade8d9 [modules] When merging a tag declaration that has a typedef name for linkage
purposes, look for other typedefs with that same name and merge into their
named tag declaration if there is one.

llvm-svn: 216312
2014-08-23 01:45:27 +00:00
Richard Smith 234ff47366 [modules] Put class template declarations into the scope in which they're
declared, rather than putting them into the template parameter scope. We
previously had *no record* in the scope for class template declarations, once
those declarations completed and their template parameter scopes were popped.
This in turn caused us to be unable to merge class template declarations that
were declared in the global scope (where we use scope lookup rather than
DeclContext lookup for merging), when loading a module.

llvm-svn: 216311
2014-08-23 00:49:01 +00:00
Richard Trieu 7ec1a318ff Fix a bad location in -Wparentheses fix-it hint
The code used getLocStart() instead of getLocEnd().  This works for single
token expressions, but breaks if the expression is longer.

llvm-svn: 216306
2014-08-23 00:30:57 +00:00
Fariborz Jahanian 4bf437ecd8 Objective-C. Warn when @encode'ing provides an incomplete
type encoding because in certain cases, such as for vector
types, because we still haven't designed encoding for them.
rdar://9255564

llvm-svn: 216301
2014-08-22 23:17:52 +00:00
David Blaikie 8608466148 DebugInfo: Test that the loop backedge in a range-for is attribute to the loop header.
This already works, but somewhat by accident (due to the order of
emission in clang, the location is set to the loop header (during the
emission of the iteratior increment) before the loop backedge is
emitted), so let's just add a test for symmetry and future-proofing.

llvm-svn: 216298
2014-08-22 22:29:50 +00:00