Commit Graph

32477 Commits

Author SHA1 Message Date
Eric Christopher 19329c402f Formatting.
llvm-svn: 139681
2011-09-14 01:10:50 +00:00
Eli Friedman 2dadd3ebee Fix comment.
llvm-svn: 139678
2011-09-14 00:52:45 +00:00
Chad Rosier 8230116066 [driver] Add support for the COMPILER_PATH environment variable, which adds the
specified path(s) to the list of prefix directories.
rdar://10097714

llvm-svn: 139677
2011-09-14 00:47:55 +00:00
Anna Zaks 2c65eea947 [analyzer] Refactor: Make PathDiagnosticLocation responsible for creating a valid object given an ExploadedNode (the same logic can be reused by other checkers).
llvm-svn: 139672
2011-09-14 00:25:17 +00:00
Eric Christopher 47300ad6e4 Fix typo.
llvm-svn: 139668
2011-09-13 23:45:09 +00:00
Douglas Gregor 3728ea75d9 Assert that the module hash produced after stripping away non-modular options is the same as the module hash before stripping those options.
llvm-svn: 139663
2011-09-13 23:20:27 +00:00
Douglas Gregor 1735f4e752 For modules, use a hash of the compiler version, language options, and
target triple to separate modules built under different
conditions. The hash is used to create a subdirectory in the module
cache path where other invocations of the compiler (with the same
version, language options, etc.) can find the precompiled modules.

llvm-svn: 139662
2011-09-13 23:15:45 +00:00
Argyrios Kyrtzidis 303e513544 [libclang] Remove libclang.darwin.exports, it's not used anymore.
llvm-svn: 139661
2011-09-13 23:12:36 +00:00
John McCall e3ca8eb049 In general, don't look through explicit casts when trying
to find the called declaration.  Explicit casts can radically
change the semantics of a call, and it's no longer really a
builtin call any more than it would be a builtin call if you stored
the function pointer into a variable and called that.

llvm-svn: 139659
2011-09-13 23:08:34 +00:00
John McCall 30e4efd458 Correctly generate IR for casted "builtin" functions, where
the builtin is really just a predefined declaration.  These are
totally valid to cast.

llvm-svn: 139657
2011-09-13 23:05:03 +00:00
Akira Hatanaka 66f6b096f8 O64 will not be supported.
llvm-svn: 139655
2011-09-13 22:47:52 +00:00
Akira Hatanaka 58ad90fa68 mips*-*-psp is no longer supported as a target.
llvm-svn: 139654
2011-09-13 22:46:13 +00:00
Kaelyn Uhrain 858fb61d22 Split the two invalid uses of the unqualified Foobar at line 3 to two lines
so that it is clearer which use triggered which error.

llvm-svn: 139653
2011-09-13 22:31:32 +00:00
Eli Friedman 84d2812111 Re-commit r139643.
Make clang use Acquire loads and Release stores where necessary.

llvm-svn: 139650
2011-09-13 22:21:56 +00:00
Eli Friedman acca089617 Revert r139643 while I look into it; it's breaking selfhost.
llvm-svn: 139648
2011-09-13 22:08:16 +00:00
Argyrios Kyrtzidis 91672b3c03 [libclang] Introduce clang_getPresumedLocation which works like clang_getExpansionLocation
but takes into account #line directives coming from preprocessed files.

Patch by Vinay Sajip!

llvm-svn: 139647
2011-09-13 21:49:08 +00:00
Argyrios Kyrtzidis a98e861939 [PCH] Fix a regression that r139441 introduced (decls were getting passed
to the consumer without being fully deserialized).

The regression was on compiling boost.python and it was too difficult to get a reduced
test case unfortunately.

Also modify the logic of how objc methods are getting passed to the consumer;
codegen depended on receiving objc methods before the implementation decl.
Since the interesting objc methods are ones with a body and such methods only
exist inside an ObjCImplDecl, deserialize and pass to consumer all the methods
of ObCImplDecl when we see one.

Fixes http://llvm.org/PR10922 & rdar://10117105.

llvm-svn: 139644
2011-09-13 21:35:00 +00:00
Eli Friedman f92b2e0714 Make clang use Acquire loads and Release stores where necessary.
llvm-svn: 139643
2011-09-13 21:31:32 +00:00
Eli Friedman 5be3e6ae9d Turn off the generation of unaligned atomic load/store; I'm going to explicitly error out on such cases in the backend, at least for the moment.
llvm-svn: 139640
2011-09-13 20:48:30 +00:00
Douglas Gregor f1312a828a When building a module on-demand, clear out the "non-modular" language
and preprocessor options (such as macro definitions) first.

llvm-svn: 139638
2011-09-13 20:44:41 +00:00
Argyrios Kyrtzidis 4c2131a775 [libclang] Correct annotation and taking of cursor for objc class references
inside the IBOutletCollection attribute.

llvm-svn: 139621
2011-09-13 18:49:56 +00:00
Argyrios Kyrtzidis c179111536 Rename InterFace -> Interface, no functionality change.
llvm-svn: 139620
2011-09-13 18:49:52 +00:00
John McCall 94312285b7 A strong property of block type has "copy" setter semantics, not "retain".
This is consistent with the behavior of assigning into a __strong l-value,
and it's also necessary for ensuring that the ivar doesn't end up a dangling
reference.  We decided not to change the behavior of "retain" properties, but
just to make them warnings/errors when of block type.

llvm-svn: 139619
2011-09-13 18:49:24 +00:00
Argyrios Kyrtzidis 8db67df663 Add the location of the interface reference to IBOutletCollectionAttr.
Depends on a llvm tablegen commit.

llvm-svn: 139618
2011-09-13 18:41:59 +00:00
John McCall 4319286337 Refactoring, mostly to give ObjCPropertyDecls stronger invariants for
their semantic attributes and then to take advantage of that.

llvm-svn: 139615
2011-09-13 18:31:23 +00:00
Douglas Gregor c2ae880070 Switch the serialization of LangOptions over to use the .def file. We
should no longer have the serialization of LangOptions out of sync
with the structure itself (yay).

llvm-svn: 139613
2011-09-13 18:26:39 +00:00
Caitlin Sadowski 427f42e04a Thread safety: Initializing var before exhaustive switch statement to deal with extraneous warning produced by gcc but not clang
llvm-svn: 139611
2011-09-13 18:01:58 +00:00
Argyrios Kyrtzidis 2cb4e3c554 [libclang]
-Allow cursor visitation of an attribute using its source range
-Add C++ 'final' and 'override' attributes as cursor kinds
-Simplify the logic that marks 'final' and 'override' attributes as tokens.

llvm-svn: 139609
2011-09-13 17:39:31 +00:00
Douglas Gregor 79a91418bd Switch LangOptions over to a .def file that describes header of the
language options. Use that .def file to declare the LangOptions class
and initialize all of its members, eliminating a source of annoying
initialization bugs.

AST serialization changes are next up.

llvm-svn: 139605
2011-09-13 17:21:33 +00:00
Chad Rosier dc2b8269d6 [driver] Add follow up comment for r139551 to ensure the unused option is not
removed in the future.
rdar://10110352 and PR10908

llvm-svn: 139602
2011-09-13 16:46:01 +00:00
Argyrios Kyrtzidis 309b4c49e4 Keep the source range of attributes. Depends on a llvm tablegen commit.
llvm-svn: 139600
2011-09-13 16:05:58 +00:00
Argyrios Kyrtzidis 635a9b4dcf Record the full source range of an attribute.
llvm-svn: 139599
2011-09-13 16:05:53 +00:00
Douglas Gregor a057a58048 Add a struct-size check for modules when dealing with module-private fields
llvm-svn: 139597
2011-09-13 15:37:05 +00:00
Francois Pichet 051f5e5cba In Microsoft mode, downgrade "goto into protected scope" from error to warning if we are jumping over a variable initialization via a goto.
This fixes a few errors when parsing MFC code with clang.

llvm-svn: 139595
2011-09-13 10:26:51 +00:00
Chandler Carruth 03faf78953 Switch -Wreturn-type to completely rely on the CFG model of no-return.
This deletes a bunch of crufty code, and allows more logic sharing
between the analyzer and the warnings.

llvm-svn: 139594
2011-09-13 09:53:58 +00:00
Chandler Carruth 75d78232fd Add a bit to the CFGBlock to track when it contains a no-return
CFGElement. This will allow greatly simplifying the logic in
-Wreturn-type.

llvm-svn: 139593
2011-09-13 09:53:55 +00:00
Chandler Carruth a70991bb3f Consolidate the logic for building a no-return CFG block into a single
location with a single comment rather than scattering it in three
places.

llvm-svn: 139592
2011-09-13 09:13:49 +00:00
John McCall 0bef0badf6 Don't use native atomics on ivars whose size is not a power of two,
even on architectures that support unaligned access (which is the
only way this is otherwise legal, given that ivars apparently do
not honor alignment attributes).

llvm-svn: 139590
2011-09-13 07:33:34 +00:00
John McCall 69cdcec11f This test seems pretty low-value.
llvm-svn: 139589
2011-09-13 07:24:27 +00:00
Chandler Carruth ad74725ab5 Enhance the CFG construction to detect no-return destructors for
temporary objects and local variables. When detected, these split the
block, marking the new one as having only the exit block as a successor.
This prevents a large number of false positives in warnings sensitive to
no-return constructs such as -Wreturn-type, and fixes the remainder of
PR10063 along with several variations of this bug that had not been
reported. The test cases are extended across the board to cover these
patterns.

This also checks in a stress test for these types of CFGs. The stress
test declares some 32k variables, a mixture of no-return and normal
destructors. Previously, this resulted in roughly 2500 CFG blocks, but
didn't model any of the no-return destructors. With this patch, it
results in over 33k blocks, many of them now unreachable.

The nice thing about how the analyzer is set up? This causes *no*
regression in performance of building the CFG. It actually in some cases
makes it faster, as best I can benchmark. The analysis for -Wreturn-type
(and any other that cares about no-return code paths) is technically
slower now as it has to look at many more candidate blocks, but it
computes the correct answer. I have more test cases to follow, I think
they all work now. Also I have further work that should dramatically
simplify analyses in the presence of no-return.

llvm-svn: 139586
2011-09-13 06:09:01 +00:00
John McCall bdd8185e22 Handle reference properties correctly in the trivial-getter check.
llvm-svn: 139585
2011-09-13 06:00:03 +00:00
John McCall 0e5c086de4 Always emit bitfield properties using expression behavior, even if they're
atomic.  This is probably something we should warn about.

llvm-svn: 139584
2011-09-13 05:36:29 +00:00
John McCall f4528ae063 Unify the decision of how to emit property getters and setters into a
single code path.  Use atomic loads and stores where necessary.  Load and
store anything of the appropriate size and alignment with primitive
operations instead of going through the call.

llvm-svn: 139580
2011-09-13 03:34:09 +00:00
Douglas Gregor 2b9b464290 When compiling a module on-demand, re-use the diagnostics client
already provided. This required a little bit of clean-up in the way
that VerifyDiagnosticsClient managed ownership of its underlying
"primary" client, because now it will no longer always take ownership.

llvm-svn: 139570
2011-09-13 01:26:44 +00:00
Douglas Gregor faeb1d4658 When an import statement fails to find a module in the module cache,
but there is a corresponding umbrella header in a framework, build the
module on-the-fly so it can be immediately loaded at the import
statement. This is very much proof-of-concept code, with details to be
fleshed out over time.

llvm-svn: 139558
2011-09-12 23:31:24 +00:00
John McCall b923ece770 Privatize the setter/getter call generation methods, plus some minor
modernization.  No functionality change.

llvm-svn: 139555
2011-09-12 23:06:44 +00:00
Chad Rosier c0f3e383c9 [driver] Ignore the '--' option, rather then fail. Do so to match gcc's
behavior.
rdar://10110352 and PR10908

llvm-svn: 139551
2011-09-12 22:43:01 +00:00
Anna Zaks ea8f5725c5 [analyzer] CmpRuns can now optionally delete empty reports.
llvm-svn: 139550
2011-09-12 22:40:36 +00:00
Caitlin Sadowski eecd273951 Thread safety: small formatting change
llvm-svn: 139548
2011-09-12 22:28:41 +00:00
Argyrios Kyrtzidis 01e3c590ae [libclang] For getDeclFromExpr in CIndex.cpp, associate the decl of
a DeclRefExpr, MemberExpr, etc. with a CastExpr if it is ImplicitCast,
since the implicit cast is the one that is invisible in source code.

llvm-svn: 139547
2011-09-12 22:17:26 +00:00