Commit Graph

52139 Commits

Author SHA1 Message Date
Sylvestre Ledru d08e5b9655 Fix the method len of the CompletionString object. Patch by Christopher Greene
llvm-svn: 207348
2014-04-27 04:42:55 +00:00
NAKAMURA Takumi 7c301b4b86 c-arcmt-test/Makefile: Update USEDLIBS for -static.
llvm-svn: 207340
2014-04-27 03:40:51 +00:00
Argyrios Kyrtzidis 357b36a2c0 [SemaObjC] Fix ObjCInterfaceDecl::inheritsDesignatedInitializers(), if there are no
designated initializers in the super class hierarchy then it should return false.

rdar://16692535

llvm-svn: 207332
2014-04-26 21:28:41 +00:00
Argyrios Kyrtzidis ea75aad379 [Sema] Adjust Sema::getCurBlock()/getCurLambda() to take into account that we may have
switch CurContext due to class template instantiation.

Fixes crash of the included test case.
rdar://16527205

llvm-svn: 207325
2014-04-26 18:29:13 +00:00
Alp Toker 87d3975369 libclang: remove 'CXDiagnostic_Remark'
The change was landed without review or test cases.

It trivially broke almost any stable application checking for Severity >=
CXDiagnostic_Error or indeed any other kind of severity comparison upon
encountering a 'remark'.

Mapped to CXDiagnostic_Warning until a workable solution is proposed to the
list that preserves API stability.

(It's also not clear why the rest of r202475 wasn't simply implemented as a
modifier to the existing 'warning' level.)

llvm-svn: 207319
2014-04-26 14:43:53 +00:00
Nick Lewycky 0c2986f78e Add mangling for attribute enable_if. The demangling patch for libcxxabi is still in review.
llvm-svn: 207296
2014-04-26 00:14:00 +00:00
Warren Hunt f0ffdb2e60 Fixed Assert In CGRecordLowering
Prior to this patch, CGRecordLower assumed that virtual bases could not 
be placed before the nvsize of an object.  This isn't true in Itanium 
mode, virtual bases are placed at dsize rather than vnsize and in the 
case of zero sized non-virtual bases nvsize can be larger than dsize.  
This patch fixes CGRecordLowering to avoid an assert and to clip 
bitfields properly in this case.  A test case is included.

llvm-svn: 207280
2014-04-25 21:56:30 +00:00
Saleem Abdulrasool b9f07e3dbc CodeGen: add __yield intrinsic for ARM
The __yield intrinsic generates a hint instruction to indicate that the thread
is not performing any useful operations at the moment.  This is for
compatibility with MSVC, although, the intrinsic is also part of the ACLE, and
is enabled globally as a result.

llvm-svn: 207275
2014-04-25 21:13:29 +00:00
Benjamin Kramer 694acb3375 Make test pass on 32 bit architectures.
llvm-svn: 207268
2014-04-25 20:49:10 +00:00
Benjamin Kramer 1adc8c3391 Print detailed vector type information on diagnostics.
We never aka vector types because our attributed syntax for it is less
comprehensible than the typedefs. This leaves the user in the dark when
the typedef isn't named that well.

Example:
  v2s v; v4f w;
  w = v;

The naming in this cases isn't even that bad, but the error we give is
useless without looking up the actual typedefs.
t.c:6:5: error: assigning to 'v4f' from incompatible type 'v2s'

Now:
t.c:6:5: error: assigning to 'v4f' (vector of 4 'float' values) from
    incompatible type 'v2s' (vector of 2 'int' values)

We do this for all diagnostics that print a vector type.

llvm-svn: 207267
2014-04-25 20:41:38 +00:00
Nico Weber e68b847fdb Fix leak of GlobalModuleIndex::IdentifierIndex, found by LSan.
llvm-svn: 207262
2014-04-25 19:45:23 +00:00
Richard Smith 6c6ef822b0 PR19558: don't produce an "unused variable" warning for a variable template partial specialization.
llvm-svn: 207260
2014-04-25 19:21:40 +00:00
Saleem Abdulrasool 0fd930e86c CodeGen: replace use of @llvm.arm.sevl with @llvm.arm.hint
Use the new generic @llvm.arm.hint hint intrinsic rather than the specialised
@llvm.arm.sevl hint instruction.

llvm-svn: 207243
2014-04-25 17:25:46 +00:00
David Majnemer 01bbd1b1c3 CodeGen: Cleanup variable linkage calculation
Almost all linkage calculation for VarDecls occured inside of
GetLLVMLinkageVarDefinition except for static data members.  Centralize
the logic so that it can be more readily reused.

No functionality change.

llvm-svn: 207241
2014-04-25 17:08:41 +00:00
David Majnemer f6acb76cb6 CodeGen: Refactor linkage/visibility calculation
It turns out that linkage and visibility have rather similar logic for
both functions and non-variable globals.  Split the calculation out so
that both sides may share this code.

No functionality change.

llvm-svn: 207239
2014-04-25 17:07:16 +00:00
David Blaikie 103a2de0b4 Push unique_ptr ownership of ASTUnits further back into their factories.
llvm-svn: 207237
2014-04-25 17:01:33 +00:00
Hans Wennborg 26a4430ee5 clang-cl: /fallback only applies to C or C++ files
We would previously hit an assert if using /fallback with an .ll file.

llvm-svn: 207234
2014-04-25 16:44:17 +00:00
Hans Wennborg bbb5f07626 clang-cl: pass -debug flag to the linker when compiling with debug info
llvm-svn: 207233
2014-04-25 16:24:19 +00:00
David Blaikie 39808ff901 Improve ownership of ASTUnits in libTooling by using std::unique_ptr.
llvm-svn: 207229
2014-04-25 14:49:37 +00:00
Rafael Espindola f828526268 Revert "Reland r206934 with a hopefully fixed test"
This reverts commit r207155.
The test was still failing.

llvm-svn: 207225
2014-04-25 13:29:03 +00:00
Kostya Serebryany d0f841ce4a fix a test-only leak found by lsan, PR19521
llvm-svn: 207223
2014-04-25 12:58:42 +00:00
Justin Bogner 3212b18bbf CodeGen: Avoid instrumenting implicit Decls more effectively
We don't assign counters for implicit Decls, but we were emitting code
to increment the (non-existent) counters and adding empty counter
lists in the output. This fixes the checks in assignRegionCounters and
emitInstrumentationData to do the right thing, and adds an assert for
the pathological case of emitting zero counters.

llvm-svn: 207203
2014-04-25 07:20:05 +00:00
Saleem Abdulrasool 05f9613610 bindings: expose C++ access specifiers
Expose the enum CX_CXXAccessSpecifier in the python bindings as a property of
the cursor.  If access specifier is not applicable to the node, return the
INVALID specifier rather than raising an exception.

Patch by Tamás Szeli!

llvm-svn: 207173
2014-04-25 02:58:03 +00:00
Reid Kleckner 02fefcfc3b Reland r206934 with a hopefully fixed test
llvm-svn: 207155
2014-04-24 23:06:17 +00:00
Richard Smith eb36ddf462 If we see an explicit instantiation declaration or definition of a function
after we've already instantiated a definition for the function, pass it to the
ASTConsumer again so that it knows the specialization kind has changed and can
update the function's linkage.

This only matters if we instantiate the definition of the function before we
reach the end of the TU; this can happen in at least three different ways:
C++11 constexpr functions, C++14 deduced return types, and functions
instantiated within modules.

llvm-svn: 207152
2014-04-24 22:45:46 +00:00
Nico Weber d19e6a7e54 MicrosoftVTableContext: Don't leak VPtrInfos. Found by LSan, PR19522.
llvm-svn: 207138
2014-04-24 19:52:12 +00:00
Nico Weber 655af097a1 Fix a tiny test-only leak, found by LSan.
llvm-svn: 207137
2014-04-24 19:04:10 +00:00
Hans Wennborg ac156e2225 Intrin.h: remove __rdtsc and __rdtscp declarations
Since r207132, these are defined in ia32intrin.h.

llvm-svn: 207134
2014-04-24 18:40:06 +00:00
Andrea Di Biagio 7ceec07cf6 [X86] Add Clang support for intrinsics __rdtsc and __rdtscp.
This patch:
 1. Adds a definition for two new GCCBuiltins in BuiltinsX86.def:
   __builtin_ia32_rdtsc;
   __builtin_ia32_rdtscp;

 2. Replaces the already existing definition of intrinsic __rdtsc in
    ia32intrin.h with a simple call to the new GCC builtin __builtin_ia32_rdtsc.

 3. Adds a definition for the new intrinsic __rdtscp in ia32intrin.h

llvm-svn: 207132
2014-04-24 18:26:35 +00:00
Jordan Rose 7d2a5e6862 Squelch leak found by LSan by handling missing switch case.
Also, use the enum type in the switch so this doesn't happen again.

PR19523

llvm-svn: 207128
2014-04-24 17:27:18 +00:00
Daniel Sanders 81ea601b54 [mips] Support 128-bit int in N32 ABI by overriding TargetInfo::hasInt128Type()
Summary: The condition in the base class is rather strange. It says a target has the 128-bit integer type if the size of a pointer is >= 64-bits. N32 has 32-bit pointers but 64-bit integers. I'm a bit reluctant to change this for all targets so this patch makes the method virtual and overrides it for MIPS64.

Reviewers: atanasyan

Reviewed By: atanasyan

Subscribers: llvm-commits

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

llvm-svn: 207121
2014-04-24 16:05:26 +00:00
Tim Northover f4aee52345 AArch64: update tests to new way of printing NEON lists.
llvm-svn: 207117
2014-04-24 14:06:31 +00:00
NAKAMURA Takumi 3f27673e40 CommentToXMLConverter: Don't use "default" to method(s). It is unavailable in msc17.
llvm-svn: 207107
2014-04-24 12:44:34 +00:00
Daniel Sanders ff1c044ada [mips] Correct size_t and ptrdiff_t for N32.
Summary:
Correct size_t to be unsigned int and ptrdiff_t to be signed long. The types were the correct size before this change but
the exact type matters for name mangling and exception handling in C++.

Reviewers: atanasyan

Reviewed By: atanasyan

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

llvm-svn: 207093
2014-04-24 09:58:52 +00:00
Dmitri Gribenko 4f4dd17d05 Comment to XML conversion: use unique_ptr for SimpleFormatContext
llvm-svn: 207087
2014-04-24 07:52:31 +00:00
Argyrios Kyrtzidis edfe07fca0 Simplify leak fix of r207076, by just disposing the previous CXString.
llvm-svn: 207081
2014-04-24 06:05:40 +00:00
Nico Weber dc493cf13b Don't leak _all_ directives in -verify mode. Found by LSan, PR19520.
llvm-svn: 207079
2014-04-24 05:39:55 +00:00
Nico Weber 568dacc4aa Don't leak invalid RegexDirectives. Probably a small part of PR19520.
llvm-svn: 207077
2014-04-24 05:32:03 +00:00
Nico Weber aacf0313a5 Fix two leaks found by LSan.
A CursorPlatformAvailability can have several "unavailable" attributes, don't
leak all but the first.  I'm not sure if there can be several "deprecate"ds too,
but add the same logic there to keep the two code paths looking the same.

llvm-svn: 207076
2014-04-24 05:16:45 +00:00
Nico Weber dbd07fadae Fix two leaks found by LSan (one is test-only).
The result of llvm::MemoryBuffer::getMemBuffer() needs to be freed. Don't
pass "don't free" flag to overrideFileContents() to fix.

llvm-svn: 207075
2014-04-24 04:58:41 +00:00
Nico Weber 4fcf0c7b29 Fix two test-only leaks found by LSan.
The result of getBufferForFile() must be freed.
(Should we change functions that expect the caller to assume ownership so
that they return unique_ptrs instead? Then the type system makes sure we get
this right.)

llvm-svn: 207074
2014-04-24 04:26:18 +00:00
Nico Weber 82098cb6df Fix two leaks in c-index-test found by LSan.
The result of clang_getCursorSpelling() needs to be clang_getCursorSpelling()ed.

llvm-svn: 207073
2014-04-24 04:14:12 +00:00
Nico Weber 52fbbb16a1 Fix four more test-only leaks found by LSan.
Tool::run() doesn't take ownership of the passed action.

llvm-svn: 207071
2014-04-24 03:48:09 +00:00
Nico Weber 1f29ccf3fb Revert the "don't leak" part of r207065, looks like the bots don't like it :-/
http://bb.pgr.jp/builders/cmake-clang-x86_64-linux/builds/22506

llvm-svn: 207070
2014-04-24 03:31:27 +00:00
Nico Weber 7c3ccb032e Fix 3 test-only leaks found by LSan.
llvm-svn: 207068
2014-04-24 03:30:22 +00:00
Nico Weber 7deebef657 More spellchecking for Index.h
llvm-svn: 207067
2014-04-24 03:17:47 +00:00
Nico Weber dd9c19fe94 compeltions are never appropriate.
llvm-svn: 207066
2014-04-24 03:06:18 +00:00
Nico Weber 7de358e936 Don't leak objects in load-from-ast path unless DisableFree is set.
Also update a comment to match a code change that was done in r110978.

llvm-svn: 207065
2014-04-24 02:42:04 +00:00
Richard Smith f17fdbd791 When two templates get merged together, also merge their pattern declarations
together. This is extremely hairy, because in general we need to have loaded
both the template and the pattern before we can determine whether either should
be merged, so we temporarily violate the rule that all merging happens before
reading a decl ends, but *only* in the case where a template's pattern is being
loaded while loading the template itself.

In order to accomodate this for class templates, delay loading the injected
class name type for the pattern of the template until after we've loaded the
template itself, if we happen to load the template first.

llvm-svn: 207063
2014-04-24 02:25:27 +00:00
Michael J. Spencer 807cf41e2f Fix test to not depend on llvm optimizations.
llvm-svn: 207062
2014-04-24 02:16:29 +00:00