Commit Graph

47128 Commits

Author SHA1 Message Date
Eli Friedman 9ee175d8f0 Don't allow unary negation on scoped enums.
PR16900.

llvm-svn: 188511
2013-08-16 00:09:18 +00:00
Eli Friedman 2a1d9a9290 Fix for dependent contexts in alias templates.
When we are parsing a type for an alias template, we are not entering
the context, so we can't look into dependent classes.  Make sure the
parser handles this correctly.

PR16904.

llvm-svn: 188510
2013-08-15 23:59:20 +00:00
DeLesley Hutchins 9f5193cf61 Thread Safety Analysis: fix bug when using TryLock with && and || expressions.
llvm-svn: 188505
2013-08-15 23:06:33 +00:00
David Blaikie ae01946afa DebugInfo: CollectRecordStaticField -> CreateRecordStaticField to return its result.
llvm-svn: 188501
2013-08-15 22:50:29 +00:00
David Blaikie 952dac3b7f Remove unnecessary explicit cast.
llvm-svn: 188500
2013-08-15 22:42:12 +00:00
David Blaikie 6dc689670c DebugInfo: Split out the implementation of getStaticDataMemberDeclaration for future use
llvm-svn: 188498
2013-08-15 22:30:23 +00:00
Fariborz Jahanian f63f0bf395 ObjetiveC migrator: fix the test in my last patch
to define real CF_RETURNS_RETAINED/CF_NO_RETURNS_RETAINED
pairs.

llvm-svn: 188497
2013-08-15 22:26:10 +00:00
David Blaikie b840c48de2 Fix assert added in r188494
llvm-svn: 188496
2013-08-15 22:18:13 +00:00
Eli Friedman 89fe0d5842 Properly track l-paren of a CXXFucntionalCastExpr.
In addition to storing more useful information in the AST, this
fixes a semantic check in template instantiation which checks whether
the l-paren location is valid.

Fixes PR16903.

llvm-svn: 188495
2013-08-15 22:02:56 +00:00
David Blaikie 35b22f6985 DebugInfo: Remove unused conditional
llvm-svn: 188494
2013-08-15 21:55:56 +00:00
Fariborz Jahanian 84ac1ded83 ObjectiveC migrator. Start annotating CF functions
with CF_RETURNS_RETAINED/CF_RETURNS_NOT_RETAINED as
appropriate.

llvm-svn: 188493
2013-08-15 21:44:38 +00:00
David Blaikie a0ef9fa6bf DebugInfo: Make CGDebugInfo::getStaticDataMemberDeclaration's argument type match the semantics
Rather than having a cast immediately inside the function, push that
type requirement out to the callers.

llvm-svn: 188492
2013-08-15 21:42:43 +00:00
David Blaikie 6a7234472e DebugInfo: Add a FIXME, remove a FIXME.
(the removed FIXME no longer applies since we made this debug info
optimization not apply to C)

llvm-svn: 188491
2013-08-15 21:21:19 +00:00
Renato Golin 3d510b3db8 make arm-use-movt available for all ARM
This updates clang according to a pending patch for llvm to
rename of the -arm-darwin-use-movt to arm-use-movt to make
it available for all of ARM.

note: please apply this close to the llvm change.

Patch by Jeroen Hofstee.

llvm-svn: 188488
2013-08-15 20:54:45 +00:00
David Blaikie b2e86eb64a DebugInfo: Unify & optimize the lazy addition of record types
Rather than going through the whole getOrCreateType machinery to
manifest a type, cut straight to the implementation because we know we
have to do work.

While the previous implementation was sufficient for the two cases
(completeness and required completeness) we have already (the general
machinery could inspect the type for those attributes & go down the full
definition path), a pending change (to emit info for types when we emit
their vtables) won't have that luxury & we'll need to force the creation
rather than relying on the general purpose routine.

llvm-svn: 188486
2013-08-15 20:49:17 +00:00
David Blaikie 4e7ef80e68 DebugInfo: Revert change to the return type of createRecordFwdDecl
It still does only return DICompositeType, but I've no need to make that
change right now.

llvm-svn: 188482
2013-08-15 20:17:25 +00:00
David Majnemer bbecd09658 CodeGen: __uuidof should work even with an incomplete _GUID type
Summary:
We would crash in CodeGen::CodeGenModule::EmitUuidofInitializer
because our attempt to enter CodeGen::CodeGenModule::EmitConstantValue
will be foiled: the type of the constant value is incomplete.

Instead, create an unnamed type with the proper layout on all platforms.
Punt the problem of wrongly defined struct _GUID types to the user.
(It's impossible because the TU may never get to see the type and thus
we can't verify that it is suitable.)

This fixes PR16856.

Reviewers: rsmith, rnk, thakis

Reviewed By: rnk

CC: cfe-commits

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

llvm-svn: 188481
2013-08-15 19:59:14 +00:00
Fariborz Jahanian 313ae7009e Add another test to my last patch (NS_OPTION vs. NS_ENUM)
ObjectiveC migration.

llvm-svn: 188480
2013-08-15 19:27:42 +00:00
Michael Gottesman b260f04afc [autotools->cmake] Added variable CLANG_VENDOR_UTI.
llvm-svn: 188479
2013-08-15 19:22:36 +00:00
Michael Gottesman 46d67de84d [autotools->cmake] Added CMake support for the preprocessor variable CLANG_REPOSITORY_STRING.
This is a patch in a longer series of patches to add
capabilities/definitions that are present in the Autotools build chain
and not in the CMake build chain to the CMake build chain.

*NOTE* I am hacking on this in my free time. I will annotate each commit
with the [autotools->cmake] header.

llvm-svn: 188478
2013-08-15 19:22:33 +00:00
David Blaikie d18fcc7a22 DebugInfo: remove unnecessary type registration
This happens in the caller a few frames up anyway.

llvm-svn: 188475
2013-08-15 18:59:44 +00:00
David Blaikie d816e2d3b0 DebugInfo: Don't create duplicate forward declaration metadata unnecessarily.
No functionality change, at best a slight (questionable) optimization,
but necessary for correctness of future work.

llvm-svn: 188474
2013-08-15 18:59:40 +00:00
Fariborz Jahanian 0b48e7c6bd Fixes a gross conditional in my last patch.
- This line, and those below, will be ignored--

M    lib/ARCMigrate/ObjCMT.cpp

llvm-svn: 188473
2013-08-15 18:58:00 +00:00
Fariborz Jahanian be7bc11f94 ObjectiveC migrator: In deciding NS_OPTION over
NS_ENUM, at least one power of 2 enumerator 
must be greater than two.

llvm-svn: 188470
2013-08-15 18:46:37 +00:00
Jordan Rose 2f8b0229cb [analyzer] If realloc fails on an escaped region, that region doesn't leak.
When a region is realloc()ed, MallocChecker records whether it was known
to be allocated or not. If it is, and the reallocation fails, the original
region has to be freed. Previously, when an allocated region escaped,
MallocChecker completely stopped tracking it, so a failed reallocation
still (correctly) wouldn't require freeing the original region. Recently,
however, MallocChecker started tracking escaped symbols, so that if it were
freed we could check that the deallocator matched the allocator. This
broke the reallocation model for whether or not a symbol was allocated.

Now, MallocChecker will actually check if a symbol is owned, and only
require freeing after a failed reallocation if it was owned before.

PR16730

llvm-svn: 188468
2013-08-15 17:22:06 +00:00
DeLesley Hutchins 16b4ff5c4d Thread safety analysis: move warnings within lock/unlock functions out of beta.
llvm-svn: 188465
2013-08-15 15:31:25 +00:00
Jack Carter 24bef98f96 [Mips][msa] Add support for half
Add support for half (a.k.a. __fp16) in builtin descriptions. 
The second argument to BUILTIN() now accepts 'h' to represent half.

Patch by Daniel Sanders

llvm-svn: 188464
2013-08-15 15:16:57 +00:00
Joerg Sonnenberger 51f358209f Build unwind tables by default on NetBSD.
llvm-svn: 188463
2013-08-15 15:08:33 +00:00
Joerg Sonnenberger 88d4c53e7d Use the integrated assembler on NetBSD/powerpc by default.
llvm-svn: 188462
2013-08-15 15:04:56 +00:00
Jack Carter 77dce2f905 [Mips][msa] Added most builtins from add.a to xori
Includes:
add.a, adds_a, adds_s, adds_u, addv, addvi, andi.b, asub_[su], ave_[su],
aver_[su], bclr, bclri, bins[lr], bins[lr]i, bmnzi, bmzi, bneg, bnegi, bset,
bseti, c(eq|ne), c(eq|ne)i, cl[et]_[su], cl[et]i_[su], copy_[su].[bhw],
div_[su], dotp_[su], dpadd_[su], dpsub_[su], fadd, fceq, fclass, fcl[et], fcne,
fdiv, fexp2, ffint_[su], ffql, ffqr, fill, flog2, fmadd, fmax, fmax_a, fmin,
fmin_a, fmsub, fmul, frint, fseq, fsle, fslt, fsne, fsqr, fsub, ftint_[su],
ftq, ilvev, ilvl, ilvod, ilvr, ldi, frcp, frsqrt, madd_q, maddr_q, maddv,
max_[asu], maxi_[su], min_[asu], mini_[su], mod_[su], msub_q, msubr_q, msubv,
mul_q, mulr_q, mulv, nloc, nlzc, nori, ori, pckev, pckod, pcnt, sat_[su], shf,
sld, sldi, sll, slli, splat, splati, sr[al], sr[al]i, subs_[su], subv, subvi,
xori


Patch by Daniel Sanders

llvm-svn: 188461
2013-08-15 14:47:02 +00:00
Evgeniy Stepanov fd75a2ca37 Update sanitizer attribute documentation to match behaviour change in r187967.
llvm-svn: 188459
2013-08-15 13:57:11 +00:00
Hao Liu 0e9837a385 Fix the build failure of Realease version
llvm-svn: 188456
2013-08-15 11:38:54 +00:00
David Majnemer efd8be3158 Add back a test that was removed in r188450
llvm-svn: 188453
2013-08-15 08:34:07 +00:00
Hao Liu 4efa1402fe Clang and AArch64 backend patches to support shll/shl and vmovl instructions and ACLE functions
llvm-svn: 188452
2013-08-15 08:26:30 +00:00
David Majnemer 6dda7bb08d [-cxx-abi microsoft] Mangle member pointers better
Summary:
There were several things going wrong:
- We mangled in useless qualifiers like "volatile void" return types.
- We didn't propagate 64-bit pointer markers sufficiently.
- We mangled qualifiers belonging to the pointee incorrectly.

This fixes PR16844 and PR16848.

Reviewers: rnk, whunt

Reviewed By: rnk

CC: cfe-commits

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

llvm-svn: 188450
2013-08-15 08:13:23 +00:00
Stephen Lin 4362261b00 CHECK-LABEL-ify some code gen tests to improve diagnostic experience when tests fail.
llvm-svn: 188447
2013-08-15 06:47:53 +00:00
Stefanus Du Toit 27afa83068 Add a bit of explanation for FrontendActionFactory.
Also use the more common "derive from" in place of "extend" in another
comment.

llvm-svn: 188440
2013-08-15 00:35:46 +00:00
Stefanus Du Toit 403f6ddce1 Add ctorInitializer to the dynamic AST Matcher registry.
llvm-svn: 188439
2013-08-15 00:33:08 +00:00
Fariborz Jahanian 8181caa44e ObjectiveC [Sema]. This patch makes sure that all inherited
properties (direct or indirect) setter/getter (or declared 
methods as well) are seen by the method implementation type 
matching logic before declaration of method in super class 
is seen. This fixes the warning coming out of that method mismatch.
// rdar://14650159

llvm-svn: 188438
2013-08-14 23:58:55 +00:00
Ted Kremenek 71c080f625 [static analyzer] add a simple "CallEffects" API to query the retain count semantics of a method.
This is intended to be a simplified API, whose internals are
deliberately less efficient for the purpose of a simplified interface,
for use with clients that want to query the analyzer's heuristics for
determining retain count semantics.

There are no immediate clients, but it is intended to be used
by the ObjC modernizer.

llvm-svn: 188433
2013-08-14 23:41:49 +00:00
Ted Kremenek 243c08585b [static analyzer] Factor out ArgEffect and RetEffect into public header file.
This is a WIP change to allow other clients to query the retain count
heuristics of the static analyzer.

llvm-svn: 188432
2013-08-14 23:41:46 +00:00
Adrian Prantl e1f1f20e92 Relax testcase for r188400 to not test for forward-slashes as path separators.
llvm-svn: 188414
2013-08-14 22:10:17 +00:00
Richard Smith c58f38f220 PR16875: The return type of a dependent function type is visible when it's
referenced as a member of the current instantiation. In that case, deduce the
type of the function to a dependent type rather than exposing an undeduced auto
type to the rest of the current instantiation.

The standard doesn't really say that the type is dependent in this case; I'll
bring this up with CWG.

llvm-svn: 188410
2013-08-14 20:16:31 +00:00
Larisse Voufo dbd6577964 Bug fix: note diagnosis on expression narrowing should say "variable template" instead of "static data member" when appropriate
llvm-svn: 188409
2013-08-14 20:15:02 +00:00
Shuxin Yang 9b49f22500 Fix grammar mistake.
Thank Richard Smith for figuring out this problem.

llvm-svn: 188408
2013-08-14 20:07:23 +00:00
Shuxin Yang 83930ac0b7 Do no use -emit-llvm for -flto.
Tested on multiple OSes.

llvm-svn: 188406
2013-08-14 19:45:49 +00:00
Benjamin Kramer 9f56828c5d Testcase for r188400.
llvm-svn: 188405
2013-08-14 19:45:27 +00:00
Peter Collingbourne 276be3c57c Add support for -fsanitize-blacklist and default blacklists for DFSan.
Also add some documentation.

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

llvm-svn: 188403
2013-08-14 18:54:18 +00:00
Benjamin Kramer a97e4d1376 Enhance the clang -v gcc debug printing to skip obviously bad and duplicate paths.
Otherwise it lists all files (e.g. shared libraries) that happen to be in the
same paths the GCC installations usually reside in.

On a x86_64 Debian 7 system with i386 multilibs.
before: clang -v 2>&1|wc -l
        3059
after:  clang -v 2>&1|wc -l
        10

llvm-svn: 188400
2013-08-14 18:38:51 +00:00
Daniel Dunbar eff4a95e4b [tests] Reapply r188354, ensure subsitution string is ascii.
- Now fixed to ensure substitution value isn't of unicode type on Python 2.6-7.

llvm-svn: 188384
2013-08-14 16:32:20 +00:00