Commit Graph

27417 Commits

Author SHA1 Message Date
Daniel Jasper 74351ff4ac Only report first error when no compilation database is found.
Review: http://llvm-reviews.chandlerc.com/D62
llvm-svn: 165933
2012-10-15 13:12:24 +00:00
Bill Wendling 4f0c080b93 Use enum values instead of magic numbers for indexing into the attribute list.
llvm-svn: 165925
2012-10-15 07:31:59 +00:00
Douglas Gregor 5952766628 Introduce the notion of excluded headers into the module map
description. Previously, one could emulate this behavior by placing
the header in an always-unavailable submodule, but Argyrios guilted me
into expressing this idea properly.

llvm-svn: 165921
2012-10-15 06:28:11 +00:00
Bill Wendling 311c832fda Attributes Rewrite
Convert the uses of the Attributes class over to the new format. The
Attributes::get method call now takes an LLVM context so that the attributes
object can be uniquified and stored.

llvm-svn: 165918
2012-10-15 04:47:45 +00:00
Richard Smith 6b4ebcc653 At -O0, emit an @llvm.trap() call at the end of a value-returning function which
fails to return a value, to make debugging this issue easier.

llvm-svn: 165914
2012-10-15 00:23:07 +00:00
Benjamin Kramer 13afbf42d8 Make sure temporary files are deleted when recovering from a crash when compiling modules.
llvm-svn: 165911
2012-10-14 19:50:53 +00:00
Benjamin Kramer 3c717b459b Delete temporary output files when an error occurs during PCH reading.
This reduces the spam make test leaves behind in /tmp. The assert isn't
particularly useful because it's not run with -disable-free (the default when
using the clang driver) but should cover all -cc1 tests.

llvm-svn: 165910
2012-10-14 19:21:21 +00:00
Bill Wendling 0120167c20 Remove operator cast method in favor of querying with the correct method.
llvm-svn: 165900
2012-10-14 08:54:39 +00:00
Bill Wendling ccf94c9e02 Use the Builder to create the stack alignment attribute.
llvm-svn: 165888
2012-10-14 03:28:14 +00:00
Nico Weber 636fc09960 "Implement" codegen support for __noop().
Eli discovered that __noop's sema behavior also needs some love. I filed
PR14081 for that and intend to improve it.

llvm-svn: 165886
2012-10-13 22:30:41 +00:00
Nico Weber cc51c2f2dc Simplify. Suggestion by Sean Silva.
llvm-svn: 165885
2012-10-13 21:56:05 +00:00
Jordan Rose 690c063b73 [analyzer] Remove the "direct bindings only" Environment lookup.
This was only used by OSAtomicChecker and makes it more
difficult to update values for expressions that the environment
may look through instead (it's not the same as IgnoreParens).
With this gone, we can have bindExpr bind to the inner
expression that getSVal will find.

Groundwork for <rdar://problem/12137950>

llvm-svn: 165866
2012-10-13 05:05:20 +00:00
Jordan Rose 88b690dd2e [analyzer] Remove unneeded 'inlineCall' checker callback.
I believe the removed assert in CheckerManager says it best:

	InlineCall is a special hacky callback to allow intrusive
	evaluation of the call (which simulates inlining). It is
	currently only used by OSAtomicChecker and should go away
	at some point.

OSAtomicChecker has gone away; inlineCall can now go away as well!

llvm-svn: 165865
2012-10-13 05:05:13 +00:00
Chad Rosier ce17b0f5b8 Update for r165858.
llvm-svn: 165859
2012-10-13 00:26:22 +00:00
Chad Rosier aac08d2c3d [ms-inline asm] Remove a bunch of parsing code from the front-end.
llvm-svn: 165851
2012-10-12 23:32:10 +00:00
Eli Friedman d13b41e32a Add TargetInfo for r600.
Patch by Tom Stellard.

llvm-svn: 165850
2012-10-12 23:32:00 +00:00
Eli Friedman 9ee2d04753 Make -mms-bitfields behave consistently.
Patch by Jeremiah Zanin.

llvm-svn: 165849
2012-10-12 23:29:20 +00:00
Richard Smith f9a1e4ab7d -fcatch-undefined-behavior: Trap undefined behavior due to conversions to or
from a floating-point type where the source value is not in the range of
representable values of the destination type.

llvm-svn: 165843
2012-10-12 22:57:06 +00:00
Ted Kremenek be4008472d Move assertion to not crash tests.
llvm-svn: 165842
2012-10-12 22:56:45 +00:00
Ted Kremenek 26a3661a10 Silence static analyzer issue by documenting that in this context
that a DeclRefExpr can never return a null decl.  We possibly should
hoist this into getDecl() itself.

llvm-svn: 165841
2012-10-12 22:56:42 +00:00
Ted Kremenek b045b01840 Silence null dereference warnings by documenting context-specific
invariants using assertions.

llvm-svn: 165840
2012-10-12 22:56:40 +00:00
Ted Kremenek d0b9770399 Fix potential crash in ObjCContainersChecker by properly validating
the number of arguments.

llvm-svn: 165838
2012-10-12 22:56:36 +00:00
Ted Kremenek bd1d7fa460 Silence dead store warning. It is conceptually possible we will
add more code that references SourceFile, so removing the dead store
doesn't seem appropriate for the long term.

llvm-svn: 165837
2012-10-12 22:56:33 +00:00
Ted Kremenek b9f7aa46dd Fix potential null deference in CFG printer.
llvm-svn: 165836
2012-10-12 22:56:31 +00:00
Ted Kremenek 451c4d51ae Remove dead store.
llvm-svn: 165835
2012-10-12 22:56:26 +00:00
Chad Rosier 7d1ec922ff Update for r165833.
llvm-svn: 165834
2012-10-12 22:53:52 +00:00
Eli Friedman 8e23642cd1 Fix -ast-print for uses of operator->.
Patch by Grzegorz Jablonski.

llvm-svn: 165832
2012-10-12 22:45:14 +00:00
DeLesley Hutchins 6c6e8599bd Fix warnings introduced by r165826.
llvm-svn: 165829
2012-10-12 21:49:04 +00:00
DeLesley Hutchins 2d0881b577 Thread-safety analysis: support multiple thread-safety attributes on
declarations.

llvm-svn: 165826
2012-10-12 21:38:12 +00:00
Chad Rosier 941faac455 [ms-inline asm] Remove a bunch of parsing code from the front-end, which will be
reimplemented in the AsmParser where it belongs.

llvm-svn: 165825
2012-10-12 21:37:00 +00:00
Douglas Gregor 056396ae8c Sanitize the names of modules determined based on the names of headers
or directories, to make sure that they are identifiers that are not
keywords in any dialect. Fixes <rdar://problem/12489495>.

llvm-svn: 165821
2012-10-12 21:15:50 +00:00
David Blaikie 04ea41c39a Fix typo correction of one qualified name to another.
When suggesting "foo::bar" as a correction for "fob::bar" we mistakenly
replaced only "bar" with "foo::bar" producing "fob::foo::bar" which was broken.

This corrects that replacement in as many places as I could find & provides
test cases for all those cases I could find a test case for. There are a couple
that don't seem to be reachable (one looks entirely dead, the other just
doesn't seem to ever get called with a namespace to namespace change).

Review by Richard Smith ( http://llvm-reviews.chandlerc.com/D57 ).

llvm-svn: 165817
2012-10-12 20:00:44 +00:00
Bill Schmidt 84d3779819 This patch addresses PR13948.
For 64-bit PowerPC SVR4, an aggregate containing only one
floating-point field (float, double, or long double) must be passed in
a register as though just that field were present.  This patch
addresses the issue during Clang code generation by specifying in the
ABIArgInfo for the argument that the underlying type is passed
directly in a register.  The included test case verifies flat and
nested structs for the three data types.

llvm-svn: 165816
2012-10-12 19:26:17 +00:00
Richard Trieu f20d90582f Change (!ptr != 0) to (!ptr) to make the code more readable.
No functional change.

llvm-svn: 165811
2012-10-12 17:48:40 +00:00
Argyrios Kyrtzidis 5c2021bf2a Handle a "#pragma options align" inside a class.
llvm-svn: 165810
2012-10-12 17:39:59 +00:00
Fariborz Jahanian e87f41f43e Add dump support for comments coming from
overridden symbols. OK'ed off-line by Doug. 
// rdar://12378793

llvm-svn: 165807
2012-10-12 17:28:36 +00:00
Benjamin Kramer 25a3470371 Remove unused variable.
llvm-svn: 165793
2012-10-12 14:01:58 +00:00
Argyrios Kyrtzidis 3b1a77969d [PCH] We only need to record C++ overridden methods once for the canonical decl.
llvm-svn: 165788
2012-10-12 05:31:40 +00:00
Ted Kremenek 6fdefb5495 Conditionally use an integral cast for BodyFarm support for OSAtomicCompareAndSwap if the return type is not a boolean.
llvm-svn: 165774
2012-10-12 00:18:19 +00:00
Douglas Gregor cfa46a82b8 Track which particular submodule #undef's a macro, so that the actual
#undef only occurs if that submodule is imported.

llvm-svn: 165773
2012-10-12 00:16:50 +00:00
Chad Rosier 98b4164503 Remove dead code introduced in r165751.
llvm-svn: 165772
2012-10-12 00:02:48 +00:00
Fariborz Jahanian 42e31323b6 search for overridden methods with comment when overriding method
has none of its own. Factor in Doug's comments.
// rdar://12378793

llvm-svn: 165771
2012-10-11 23:52:50 +00:00
Sean Silva e2bb2ff576 Remove pointless classof()'s.
Updates to llvm/Support/Casting.h have rendered these classof()'s
irrelevant.

llvm-svn: 165770
2012-10-11 23:31:23 +00:00
David Blaikie c2ff8e125a Provide a fixit when taking the address of an unqualified member function.
This only applies if the type has a name. (we could potentially do something
crazy with decltype in C++11 to qualify members of unnamed types but that
seems excessive)

It might be nice to also suggest a fixit for "&this->i", "&foo->i",
and "&foo.i" but those expressions produce 'bound' member functions that have
a different AST representation & make error recovery a little trickier. Left
as future work.

llvm-svn: 165763
2012-10-11 22:55:07 +00:00
Chad Rosier dc12c45058 [ms-inline asm] Remove a bunch of parsing code from the front-end, which will be
reimplemented in the AsmParser where it belongs.

llvm-svn: 165752
2012-10-11 21:44:41 +00:00
Chad Rosier e66f42634f [ms-inline asm] Lookup the IdentifierInfo using the Idents table and remove the
now unused static helper function.

The test case needs to be remove temporarily until I can better filter memory
operands that aren't actual variable reference.

llvm-svn: 165751
2012-10-11 21:28:29 +00:00
Douglas Gregor 5968b1b71f Diagnose the expansion of ambiguous macro definitions. This can happen
only with modules, when two disjoint modules #define the same
identifier to different token sequences.

llvm-svn: 165746
2012-10-11 21:07:39 +00:00
Ted Kremenek c9822ebc97 Remove OSAtomicChecker.
llvm-svn: 165744
2012-10-11 20:58:21 +00:00
Ted Kremenek 089ffd0889 Switch over to BodyFarm implementation of OSAtomicCompareAndSwap and
objc_atomicCompareAndSwap.

llvm-svn: 165743
2012-10-11 20:58:18 +00:00
Ted Kremenek fa0a0b6628 Teach GetBaseType() about BlockPointerTypes.
llvm-svn: 165742
2012-10-11 20:58:14 +00:00