Commit Graph

47045 Commits

Author SHA1 Message Date
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
Hans Wennborg f3cf49fb15 clang-cl: Consolidate tests for /Fo and /Fe into cl-outputs.c
llvm-svn: 188213
2013-08-12 22:19:13 +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 4ebf57672d Forgot to add unittests/Sema/ before committing r188196 :(
llvm-svn: 188197
2013-08-12 19:57:06 +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 f068d9ff14 This test passes on freebsd after r188178. Not exactly sure why.
llvm-svn: 188182
2013-08-12 16:29:25 +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
Tim Northover 19ae1175ae Fix FileCheck --check-prefix lines.
Various tests had sprung up over the years which had --check-prefix=ABC on the
RUN line, but "CHECK-ABC:" later on. This happened to work before, but was
strictly incorrect. FileCheck is getting stricter soon though.

Patch by Ron Ofir.

llvm-svn: 188174
2013-08-12 12:51: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
Robert Wilhelm a65911a785 Omit llvm:: before StringRef and SmallString. We have using directive in include/clang/Basic/LLVM.h.
llvm-svn: 188139
2013-08-10 13:29:01 +00:00
Robert Wilhelm b869a8f596 Omit llvm:: before SmallVector and SmallVectorImpl. We have using directive in include/clang/Basic/LLVM.h.
llvm-svn: 188138
2013-08-10 12:33:24 +00:00
Serge Pavlov 074a518f03 Fix to PR16225 (Assert-on-invalid: isa<LabelDecl>(D) && "declaration not instantiated in this scope")
Differential Revision: http://llvm-reviews.chandlerc.com/D920

llvm-svn: 188137
2013-08-10 12:00:21 +00:00
Enea Zaffanella 6dbe187262 Added source locs for angled parentheses in class/var template partial specs.
llvm-svn: 188134
2013-08-10 07:24:53 +00:00
Serge Pavlov b716b3ca1f Avoid spurious error messages if parent template class cannot be instantiated
Differential Revision: http://llvm-reviews.chandlerc.com/D924

llvm-svn: 188133
2013-08-10 05:54:47 +00:00
Rafael Espindola 0b8e4a1e21 Fix warning in builds without asserts.
llvm-svn: 188132
2013-08-10 04:25:53 +00:00
Rafael Espindola c7367ffdab Simplify now that llvm::sys::current_path checks $PWD.
llvm-svn: 188128
2013-08-10 01:40:10 +00:00
Jordan Rose 7964ab5a43 [analyzer] Update Open Projects and Potential Checkers pages.
- va_list checker (PR16811 and PR16812)
- Model floating-point values
- Bound bitwise masking operations (PR16615)
- Bound C string length (PR16558 and others)

llvm-svn: 188127
2013-08-10 01:24:35 +00:00
NAKAMURA Takumi d3c9b9f9b4 clang/test/Driver/cl-options.c: Suppress this on cygming due to -fno-builtin.
llvm-svn: 188126
2013-08-10 00:59:43 +00:00
Eli Friedman 8564139c0e Correctly profile CXXPseudoDestructorExprs.
CXXPseudoDestructorExprs may not contain a type.  PR16852.

llvm-svn: 188123
2013-08-09 23:37:05 +00:00
James Dennett ddd36fff49 Expose LambdaIntroducer::DefaultLoc in the AST's LambdaExpr.
Summary:
Source-centric tools need access to the location of a C++11
lambda expression's capture-default ('&' or '=') when it's present.
It's possible for them to find it by re-lexing and re-implementing
rules that Clang's parser has already applied, but the cost of storing
the SourceLocation and making it available to them is 32 bits per
LambdaExpr (a small delta, proportionally), and the simplification in
client code is significant.

Reviewers: rsmith

Reviewed By: rsmith

CC: cfe-commits, klimek, revane

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

llvm-svn: 188121
2013-08-09 23:08:25 +00:00
Richard Trieu 98ca59ed3b Fix typo in template diffing docs.
llvm-svn: 188120
2013-08-09 22:52:48 +00:00
Richard Trieu 4b03d98858 Fix for PR16570: when comparing two function pointers, discard qualifiers when
comparing non-reference function parameters.  The qualifiers don't matter for
comparisons.

This is a re-commit of r187769, which was accidentially reverted in r187770,
with a simplification at the suggestion of Eli Friedman.

llvm-svn: 188112
2013-08-09 21:42:32 +00:00
Argyrios Kyrtzidis 551c83d379 [arcmt] When handling unbridged casts, handle the body of BlockDecl separately because ParentMap does not record
Stmt parent nodes inside a BlockDecl.

Fixes rdar://14686900

llvm-svn: 188101
2013-08-09 20:20:25 +00:00
Robert Wilhelm 16e94b91ef Omit llvm:: before ArrayRef, as we have using llvm::ArrayRef in include/clang/Basic/LLVM.h.
llvm-svn: 188089
2013-08-09 18:02:13 +00:00
Benjamin Kramer 7a7285cc24 Remove "static" on simple temporary StringRef.
llvm-svn: 188088
2013-08-09 17:51:03 +00:00
Hans Wennborg 32e3b720b4 clang-cl: Don't pass /defaultlib to the linker
Since r187945, clang-cl will add the runtime library dependency to
the .obj file.

llvm-svn: 188086
2013-08-09 17:38:42 +00:00
David Blaikie fd07c604a9 Only emit debug info for implicit members that actually get codegen, not just ODR use.
This includes special members (copy/default ctor, copy assign, default
ctor) and template specializations for member function templates.

Good for a 5% decrease (1.80 to 1.71 GB) in size on Clang+LLVM's .dwo
files (when using fission).

llvm-svn: 188085
2013-08-09 17:20:05 +00:00
Benjamin Kramer 604e848655 Add a convenient way to compare GCCVersions without creating temporary objects.
No functionality change.

llvm-svn: 188084
2013-08-09 17:17:48 +00:00
Benjamin Kramer 27bc504285 DirectIvarAssignment: Replace vtable'd objects with simple functions.
Avoids unnecessary static constructors.

llvm-svn: 188083
2013-08-09 17:17:42 +00:00
Daniel Dunbar 94ec6cc110 [tests] Update to use lit_config and lit package, as appropriate.
llvm-svn: 188072
2013-08-09 14:43:04 +00:00
Alexey Samsonov 71c197b81c Fixup for r188058: assume hasAsanZeroBaseShadow() is false if ASan is not needed
llvm-svn: 188068
2013-08-09 10:56:42 +00:00
Benjamin Kramer 588b35ed8f Add lrint to the list of math builtins. It never sets errno so we can mark it as readnone.
llvm-svn: 188065
2013-08-09 10:12:30 +00:00
Benjamin Kramer 989ab8b5a0 Put back a microoptimization with a comment to make it more obvious.
llvm-svn: 188063
2013-08-09 09:39:17 +00:00
David Majnemer 89085340be Sema: Assertion failure during CodeGen in CodeGenModule::EmitUuidofInitializer
Make sure we can properly generate code when the UUID has curly braces
on it, strip the curly braces at the sema layer.

This fixes PR16813.

llvm-svn: 188061
2013-08-09 08:56:20 +00:00