Commit Graph

31942 Commits

Author SHA1 Message Date
Ted Kremenek e19529b3d8 Use the number of parameters in the actual method or function to determine the CallEffects size.
llvm-svn: 188587
2013-08-16 23:14:22 +00:00
David Blaikie 9fdedec489 DebugInfo: Canonicalize namespaces to avoid emitting multiple namespaces with the same name but different lines
Updated test case to not rely on line numbers in more cases (it's hard
to use the @ check syntax for debug info test cases (due to the
interesting ordering of metadata) and this case in particular (given the
hash-line directive)) - left a few in there to cover the line number
information for these.

llvm-svn: 188585
2013-08-16 22:52:07 +00:00
Benjamin Kramer ab3838ab98 RetainCountChecker: Replace some loops with std:: algorithms.
llvm-svn: 188581
2013-08-16 21:57:14 +00:00
Benjamin Kramer 91c9867049 Replace some DenseMap keys with simpler structures that don't need another DenseMapInfo specialization.
llvm-svn: 188580
2013-08-16 21:57:06 +00:00
Ted Kremenek 63234c1bbd Revert r188574. Turns out it isn't needed.
llvm-svn: 188578
2013-08-16 21:54:22 +00:00
David Blaikie 9eddbbd563 DebugInfo: Omit debug info for dynamic classes in TUs that do not have the vtable for that class
This reduces Clang's .dwo (fission debug info) size by 23% over
Clang+LLVM.

llvm-svn: 188576
2013-08-16 20:40:29 +00:00
David Blaikie ab255bb9cf DebugInfo: Contrain the record type parameter for CollectRecordFields
This is the correct type (as is demonstrated by the fact that the caller
didn't need to change) & will be useful in a future patch.

llvm-svn: 188575
2013-08-16 20:40:25 +00:00
Fariborz Jahanian 36362016d3 Need summary info. about arguments to
CF functions coming from static analyzer API.

llvm-svn: 188574
2013-08-16 20:23:36 +00:00
Argyrios Kyrtzidis 4b2b460893 Introduce the clangIDE library.
Libclang has a lot of functionality that is inaccessible.
The purpose of clangIDE is to move most of the functionality of libclang to it so we
can expose it and have libclang be more of a thin C wrapper over clangIDE.

Start by moving the USR generation functionality into clangIDE.

llvm-svn: 188569
2013-08-16 18:17:55 +00:00
Samuel Benzaquen bd7d887f18 Refactor ArgumentAdaptativeMatcher matchers to remove the template from their declaration.
Summary:
Refactor ArgumentAdaptativeMatcher matchers to remove the template from their declaration.
This facilitates dynamic registration. Change the registry code to use the regular overload resolution mechanism for adaptative matchers.

Reviewers: klimek

CC: cfe-commits, revane

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

llvm-svn: 188560
2013-08-16 16:19:42 +00:00
Edwin Vane 19f66290e4 Tweak Replacement comparisons
* Introduce operator< to replace Replacement::Less
* Make operator== and operator< on Replacements non-member functions
* Change order of comparisons in operator< to do string comparisons last

llvm-svn: 188550
2013-08-16 12:18:53 +00:00
Daniel Jasper de0328aea8 Split UnwrappedLineFormatter into individual components.
Goals: Structure code better and make components easier to use for
future features (e.g. column layout for long braced initializers).

No functional changes intended.

llvm-svn: 188543
2013-08-16 11:20:30 +00:00
Evgeniy Stepanov 37b3f73690 Revert r188498.
This change broke release+asserts build with compiler-rt.

llvm-svn: 188539
2013-08-16 10:35:31 +00:00
David Majnemer f0a84f200a Parse: Do not 'HandleTopLevelDecl' on templated functions.
Summary:
HandleTopLevelDecl on a templated function leads us to try and mangle
it.

Reviewers: rsmith

Reviewed By: rsmith

CC: cfe-commits

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

llvm-svn: 188536
2013-08-16 08:29:13 +00:00
Hans Wennborg 2393799609 Windows ToolChain: add VS bin dir to PogramPaths
We have a lot of fancy logic to find Visual Studio, which is currently used
to set the system header include paths.

Use the same code to set the ProgramPaths, which is used for finding programs
such as link.exe. Previously, Clang would just search PATH for link.exe,
but now it should find it if it's able to find Visual Studio.

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

llvm-svn: 188531
2013-08-16 03:15:10 +00:00
Jordan Rose 367843a04c [analyzer] Merge TextPathDiagnostics and ClangDiagPathDiagConsumer.
This once again restores notes to following their associated warnings
in -analyzer-output=text mode. (This is still only intended for use as a
debugging aid.)

One twist is that the warning locations in "regular" analysis output modes
(plist, multi-file-plist, html, and plist-html) are reported at a different
location on the command line than in the output file, since the command
line has no path context. This commit makes -analyzer-output=text behave
like a normal output format, which means that the *command line output
will be different* in -analyzer-text mode. Again, since -analyzer-text is
a debugging aid and lo-fi stand-in for a regular output mode, this change
makes sense.

Along the way, remove a few pieces of stale code related to the path
diagnostic consumers.

llvm-svn: 188514
2013-08-16 01:06:30 +00:00
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
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
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
Hao Liu 0e9837a385 Fix the build failure of Realease version
llvm-svn: 188456
2013-08-15 11:38:54 +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
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
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
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
Shuxin Yang 5f22d5263a revert 188352
llvm-svn: 188353
2013-08-14 04:47:39 +00:00
Shuxin Yang 538a17691c Driver::IsUsingLTO() no longer return true when seeing -emit-llvm.
The rationale for this change is to differentiate following two situations:
  1) clang -c -emit-llvm a.c
  2) clang -c -flto a.c 

Reviewed by Eric Christopher. Thanks a lot!

llvm-svn: 188352
2013-08-14 04:36:53 +00:00
Larisse Voufo d8dd97c0a2 Bug fix: disallow a variable template to be redeclared as a non-templated variable
llvm-svn: 188350
2013-08-14 03:09:19 +00:00
Hans Wennborg be4a6768f1 Driver: Forward -Wl, and -Xlink arguments when using windows linker
Differential Revision: http://llvm-reviews.chandlerc.com/D1394

llvm-svn: 188346
2013-08-14 01:24:35 +00:00
Richard Smith 0d905476f8 Don't produce duplicate notes if we have deduction failure notes when resolving
the address of an overloaded function template.

llvm-svn: 188334
2013-08-14 00:00:44 +00:00
Fariborz Jahanian a802c3526b ObjectiveC [QoI] issue warning if an element of an nsarray
expresison is a concatenated nsstring element.
// rdar://14303083

llvm-svn: 188332
2013-08-13 23:44:55 +00:00
Hans Wennborg 2e27459d6c clang-cl: Support /link option and set target to win32
This adds support for the /link option, which forwards
subsequent arguments to the linker.

The test for this will only work when targetting win32.
Since that's the only target where clang-cl makes sense,
use that target by default.

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

llvm-svn: 188331
2013-08-13 23:38:57 +00:00
Eli Friedman 7a15c4af90 Fix Altivec vector literal parser hack for C++11.
It doesn't make any sense to accept "..." in the argument to a C-style cast,
so use a separate expression list parsing routine which rejects it. PR16874.

llvm-svn: 188330
2013-08-13 23:38:34 +00:00
Nick Lewycky bbd6db8032 Link in the ubsan runtime when building shared objects.
llvm-svn: 188325
2013-08-13 22:32:35 +00:00
Eli Friedman 4e28b26589 sizeof(void) etc. should be a hard error in C++.
PR16872.

llvm-svn: 188324
2013-08-13 22:26:42 +00:00
Hans Wennborg ed1d07282c Handle "--" explicitly in the driver
Anything that comes after -- is treated as an input file. This
used to be handled automagically by the option parsing library,
but after LLVM r188314, we should handle it ourselves.

No functionality change.

llvm-svn: 188316
2013-08-13 21:32:29 +00:00
Richard Smith 1c34fb78e7 Fix implementation of C11 6.2.7/4 and C++11 [dcl.array]p3:
When a local extern declaration redeclares some other entity, the type of that
entity is merged with the prior type if the prior declaration is visible (in C)
or is declared in the same scope (in C++).

 - Make LookupRedeclarationWithLinkage actually work in C++, use it in the right
   set of cases, and make it track whether it found a shadowed declaration.
 - Track whether we found a declaration in the same scope (for C++) including
   across serialization and template instantiation.

llvm-svn: 188307
2013-08-13 18:18:50 +00:00
Fariborz Jahanian c13c1b0f0d ObjectiveC migrator: Fixes a crash and makes couple
of harmless changes.

llvm-svn: 188303
2013-08-13 18:01:42 +00:00
Edwin Vane 349e1c18eb Adding a vector version of tooling::applyAllReplacements
One day soon, tooling::Replacements will be changed from being implemented as
an std::set to being implemented as an std::vector. Until then, some new code
using vectors of Replacements would enjoy having a version of
applyAllReplacements that takes a vector.

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

llvm-svn: 188295
2013-08-13 17:38:19 +00:00
Edwin Vane f59b1a9211 Fixing a conflict detection bug in tooling::deduplicate
If a Replacment is contained within the conflict range being built, the
conflict range would be erroneously shortened. Now fixed. Tests updated to
catch this case.

llvm-svn: 188287
2013-08-13 16:26:44 +00:00
Arnold Schwaighofer 7f994ce294 Move logic to enable the vectorizer to clang
We used to decide whether to really vectorize depending on the optimization
level in PassManagerBuilder.

This patch moves this decision to the clang driver. We look at the optimization
level and whether the f(no-)vectorize is set and decide whether to vectorize.

This allows us to simplify the logic in PassManagerBuilder to just a check for
whether the vectorizer should run or not.

We now do the right thing for:
$ clang -O1 -fvectorize
$ clang -fno-vectorize -O3

llvm-svn: 188280
2013-08-13 15:46:23 +00:00
Samuel Benzaquen 0239b69167 Refactor "MatcherList" into "VariantMatcher" and abstract the notion of a list of matchers for the polymorphic case.
Summary:
Refactor "MatcherList" into "VariantMatcher" and abstract the notion of a list of matchers for the polymorphic case.
This work is to support future changes needed for eachOf/allOf/anyOf matchers. We will add a new type on VariantMatcher.

Reviewers: klimek

CC: cfe-commits, revane

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

llvm-svn: 188272
2013-08-13 14:54:51 +00:00
Daniel Jasper cdaffa45d4 clang-format: Add option for the offset of constructor initializers.
Some coding styles use a different indent for constructor initializers.

Patch by Klemens Baum. Thank you.
Review: http://llvm-reviews.chandlerc.com/D1360

Post review changes: Changed data type to unsigned as a negative indent
width does not make sense and added test for configuration parsing.

llvm-svn: 188260
2013-08-13 10:58:30 +00:00
Robert Lytton 0e07649ae5 Add XCore target
llvm-svn: 188258
2013-08-13 09:43:10 +00:00
David Majnemer e9cab2faa6 Fix typo in comment.
Thanks Kim Gräsman!

llvm-svn: 188257
2013-08-13 09:17:25 +00:00
Daniel Jasper 29a98cfca0 clang-format: Improve boolean expression formatting in macros.
Before:
  #define IF(a, b, c) if (a&&(b == c))

After:
  #define IF(a, b, c) if (a && (b == c))

llvm-svn: 188256
2013-08-13 09:09:09 +00:00
Daniel Jasper 301d017139 clang-format: Slightly adapt line break penalties.
Before:
  aaaaaaaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaaaa)
                               ->aaaaaaaaa());
After:
  aaaaaaaaaaaaaaaaaaaaaaaa(
      aaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaaaa)->aaaaaaaaa());

llvm-svn: 188253
2013-08-13 06:50:04 +00:00
David Majnemer 8eaab6ff8e [-cxx-abi microsoft] Mangle __uuidof correctly into template parameters
Summary:
It seems that __uuidof introduces a global extern "C" declaration of
type __s_GUID.  However, our implementation of __uuidof does not provide
such a declaration and thus must open-code the mangling for __uuidof in
template parameters.

This allows us to codegen scoped COM pointers and other such things.

This fixes PR16836.
Depends on D1356.

Reviewers: rnk, cdavis5x, rsmith

Reviewed By: rnk

CC: cfe-commits

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

llvm-svn: 188252
2013-08-13 06:32:20 +00:00
David Blaikie 80d28de87a Drive by cleanup
llvm-svn: 188251
2013-08-13 04:21:38 +00:00
Larisse Voufo a11bd8a7dc variable templates updated for PCH serialization... Still working on test cases...
llvm-svn: 188249
2013-08-13 02:02:26 +00:00
NAKAMURA Takumi db8d300035 AnalysisBasedWarnings.cpp:: Prune "\param VariableName", possibly copypasto, in comments. [-Wdocumentation]
llvm-svn: 188248
2013-08-13 01:53:21 +00:00
David Majnemer e8fdc06e0d [-cxx-abi microsoft] Mangle TemplateArgument::Declaration for references
Summary:
Properly mangle declarations showing up in template arguments that are
reference parameters.  Fun-fact: undname cannot handle these!

Reviewers: rnk, cdavis5x

Reviewed By: rnk

CC: cfe-commits

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

llvm-svn: 188245
2013-08-13 01:25:35 +00:00
Reid Kleckner 6454d0a0fa Silence a warning from MSVC about not returning a value
llvm-svn: 188237
2013-08-13 00:11:59 +00:00
Reid Kleckner e846deae3c Remove Sema includes from Analysis code to fix layering
This moves a header-only class from Sema to Analysis and puts the option
check in Sema.

Patch by Chris Wailes!

llvm-svn: 188230
2013-08-12 23:49:39 +00:00
Hans Wennborg 13b7fe72a7 clang-cl: Sink /Fe and /Fo diagnostic code into BuildActions
Differential Revision: http://llvm-reviews.chandlerc.com/D1370

llvm-svn: 188226
2013-08-12 23:26:25 +00:00
Fariborz Jahanian dfe6ed9660 ObjectiveC migration. Add couple of routine
, currently unused, for future cf-annotation work.

llvm-svn: 188224
2013-08-12 23:17:13 +00:00
David Blaikie 6b7d060c57 DebugInfo: Simplify declaration building code - relying on the limit debug info checking already in CreateType(RecordType)
llvm-svn: 188222
2013-08-12 23:14:36 +00:00
David Blaikie 4a2b5ef603 DebugInfo: simplify some limited/declaration creation APIs
llvm-svn: 188214
2013-08-12 22:24:20 +00:00
Kaelyn Uhrain 2c351bbc25 Add hooks to ExternalSemaSource for after-the-fact diagnosis of
incomplete types, courtesy of Luke Zarko.

llvm-svn: 188212
2013-08-12 22:11:14 +00:00
Hans Wennborg 812a9ec9c2 Speculative build fix for r188206.
The cmake-clang-x86_64 was upset:
error: 'template<class ImplClass, class RetTy> class clang::ConstStmtVisitor' used without template parameters

llvm-svn: 188211
2013-08-12 22:02:09 +00:00
Hans Wennborg 207fcf0e7b clang-cl: Support the /Fe option
This is used to name the linked output file.

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

llvm-svn: 188210
2013-08-12 21:56:42 +00:00
Eli Friedman 24b3fed69f Fix pretty-printing for unnamed unions.
This is just a couple of minor fixes to account for the existence
of ElaboratedType.

llvm-svn: 188209
2013-08-12 21:54:04 +00:00
Eli Friedman e2358c1deb Fix crash w/BlockDecl and invalid qualified decl.
I'm not really satisfied with the ad-hoc nature of
Sema::diagnoseQualifiedDeclaration, but I'm not sure how to fix it.

Fixes <rdar://problem/14639501>.

llvm-svn: 188208
2013-08-12 21:54:01 +00:00
DeLesley Hutchins 48a317663f Patch by Chris Wailes <chris.wailes@gmail.com>.
Reviewed by delesley, dblaikie.

Add the annotations and code needed to support a basic 'consumed' analysis.

Summary:
This new analysis is based on academic literature on linear types.  It tracks
the state of a value, either as unconsumed, consumed, or unknown.  Methods are
then annotated as CallableWhenUnconsumed, and when an annotated method is
called while the value is in the 'consumed' state a warning is issued.  A value
may be tested in the conditional statement of an if-statement; when this occurs
we know the state of the value in the different branches, and this information
is added to our analysis.  The code is still highly experimental, and the names
of annotations or the algorithm may be subject to change.

llvm-svn: 188206
2013-08-12 21:20:55 +00:00
Kaelyn Uhrain f0aabdadc6 Add hooks for typo correction to ExternalSemaSource, courtesy of Luke Zarko.
llvm-svn: 188196
2013-08-12 19:54:38 +00:00
Hans Wennborg 0d0b19cbe1 clang-cl: Expand warning about /TC and /TP override, and expand test
llvm-svn: 188190
2013-08-12 18:34:17 +00:00
Jack Carter 44ff1e5673 [Mips] MSA frontend option support
This patch adds -mmsa and -mno-msa to the options supported by 
clang to enable and disable support for MSA.

When MSA is enabled, a predefined macro '__mips_msa' is defined to 1.

Patch by Daniel Sanders

llvm-svn: 188184
2013-08-12 17:20:29 +00:00
Benjamin Kramer 3841fa38da SourceManager intialization tweaks.
- Open files before calling stat on them.
- Go through FileManager for getting the buffer of named pipes. It has the
  necessary plumbing to deal with "volatile" files.
- Print the cause when stdin reading fails. The only case I can imagine where
  this happens is when stdin is wired to a device file, so no test case.

llvm-svn: 188178
2013-08-12 13:46:52 +00:00
Daniel Jasper 467ddb161c clang-format: Improve stream-formatting.
Before:
  CHECK(controller->WriteProto(FLAGS_row_key, FLAGS_proto)) << "\""
                                                            << FLAGS_proto
                                                            << "\"";

After:
  SemaRef.Diag(Loc, diag::note_for_range_begin_end)
      << BEF << IsTemplate << Description << E->getType();

llvm-svn: 188175
2013-08-12 12:58:05 +00:00
Daniel Jasper 5903685a28 clang-format: Correctly format alias declarations.
Before:
  template <class CallbackClass>
  using MyCallback = void(CallbackClass::*)(SomeObject * Data);");

After:
  template <class CallbackClass>
  using MyCallback = void (CallbackClass::*)(SomeObject *Data);");

Also fix three wrong indentations.

llvm-svn: 188172
2013-08-12 12:16:34 +00:00
Alexey Samsonov d6e043ba1f Use new llvm::SpecialCaseList API in CodeGenModule
llvm-svn: 188170
2013-08-12 11:48:05 +00:00
Manuel Klimek d57355031c This change fixes the formatting of statements such as catch (E& e).
Previously these were formatting as catch (E & e) because the inner parenthesis
was being marked as an expression.

Patch by Thomas Gibson-Robinson.

llvm-svn: 188153
2013-08-12 03:51:17 +00:00
Richard Smith b3d6c05ea4 Fix misindentation.
llvm-svn: 188151
2013-08-12 02:53:18 +00:00