]> granicus.if.org Git - clang/log
clang
13 years agoO64 will not be supported.
Akira Hatanaka [Tue, 13 Sep 2011 22:47:52 +0000 (22:47 +0000)]
O64 will not be supported.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139655 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agomips*-*-psp is no longer supported as a target.
Akira Hatanaka [Tue, 13 Sep 2011 22:46:13 +0000 (22:46 +0000)]
mips*-*-psp is no longer supported as a target.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139654 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoSplit the two invalid uses of the unqualified Foobar at line 3 to two lines
Kaelyn Uhrain [Tue, 13 Sep 2011 22:31:32 +0000 (22:31 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139653 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoRe-commit r139643.
Eli Friedman [Tue, 13 Sep 2011 22:21:56 +0000 (22:21 +0000)]
Re-commit r139643.

Make clang use Acquire loads and Release stores where necessary.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139650 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoRevert r139643 while I look into it; it's breaking selfhost.
Eli Friedman [Tue, 13 Sep 2011 22:08:16 +0000 (22:08 +0000)]
Revert r139643 while I look into it; it's breaking selfhost.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139648 91177308-0d34-0410-b5e6-96231b3b80d8

13 years ago[libclang] Introduce clang_getPresumedLocation which works like clang_getExpansionLoc...
Argyrios Kyrtzidis [Tue, 13 Sep 2011 21:49:08 +0000 (21:49 +0000)]
[libclang] Introduce clang_getPresumedLocation which works like clang_getExpansionLocation
but takes into account #line directives coming from preprocessed files.

Patch by Vinay Sajip!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139647 91177308-0d34-0410-b5e6-96231b3b80d8

13 years ago[PCH] Fix a regression that r139441 introduced (decls were getting passed
Argyrios Kyrtzidis [Tue, 13 Sep 2011 21:35:00 +0000 (21:35 +0000)]
[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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139644 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoMake clang use Acquire loads and Release stores where necessary.
Eli Friedman [Tue, 13 Sep 2011 21:31:32 +0000 (21:31 +0000)]
Make clang use Acquire loads and Release stores where necessary.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139643 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoTurn off the generation of unaligned atomic load/store; I'm going to explicitly error...
Eli Friedman [Tue, 13 Sep 2011 20:48:30 +0000 (20:48 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139640 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoWhen building a module on-demand, clear out the "non-modular" language
Douglas Gregor [Tue, 13 Sep 2011 20:44:41 +0000 (20:44 +0000)]
When building a module on-demand, clear out the "non-modular" language
and preprocessor options (such as macro definitions) first.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139638 91177308-0d34-0410-b5e6-96231b3b80d8

13 years ago[libclang] Correct annotation and taking of cursor for objc class references
Argyrios Kyrtzidis [Tue, 13 Sep 2011 18:49:56 +0000 (18:49 +0000)]
[libclang] Correct annotation and taking of cursor for objc class references
inside the IBOutletCollection attribute.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139621 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoRename InterFace -> Interface, no functionality change.
Argyrios Kyrtzidis [Tue, 13 Sep 2011 18:49:52 +0000 (18:49 +0000)]
Rename InterFace -> Interface, no functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139620 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoA strong property of block type has "copy" setter semantics, not "retain".
John McCall [Tue, 13 Sep 2011 18:49:24 +0000 (18:49 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139619 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd the location of the interface reference to IBOutletCollectionAttr.
Argyrios Kyrtzidis [Tue, 13 Sep 2011 18:41:59 +0000 (18:41 +0000)]
Add the location of the interface reference to IBOutletCollectionAttr.
Depends on a llvm tablegen commit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139618 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoRefactoring, mostly to give ObjCPropertyDecls stronger invariants for
John McCall [Tue, 13 Sep 2011 18:31:23 +0000 (18:31 +0000)]
Refactoring, mostly to give ObjCPropertyDecls stronger invariants for
their semantic attributes and then to take advantage of that.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139615 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoSwitch the serialization of LangOptions over to use the .def file. We
Douglas Gregor [Tue, 13 Sep 2011 18:26:39 +0000 (18:26 +0000)]
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).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139613 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoThread safety: Initializing var before exhaustive switch statement to deal with extra...
Caitlin Sadowski [Tue, 13 Sep 2011 18:01:58 +0000 (18:01 +0000)]
Thread safety: Initializing var before exhaustive switch statement to deal with extraneous warning produced by gcc but not clang

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139611 91177308-0d34-0410-b5e6-96231b3b80d8

13 years ago[libclang]
Argyrios Kyrtzidis [Tue, 13 Sep 2011 17:39:31 +0000 (17:39 +0000)]
[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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139609 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoSwitch LangOptions over to a .def file that describes header of the
Douglas Gregor [Tue, 13 Sep 2011 17:21:33 +0000 (17:21 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139605 91177308-0d34-0410-b5e6-96231b3b80d8

13 years ago[driver] Add follow up comment for r139551 to ensure the unused option is not
Chad Rosier [Tue, 13 Sep 2011 16:46:01 +0000 (16:46 +0000)]
[driver] Add follow up comment for r139551 to ensure the unused option is not
removed in the future.
rdar://10110352 and PR10908

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139602 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoKeep the source range of attributes. Depends on a llvm tablegen commit.
Argyrios Kyrtzidis [Tue, 13 Sep 2011 16:05:58 +0000 (16:05 +0000)]
Keep the source range of attributes. Depends on a llvm tablegen commit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139600 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoRecord the full source range of an attribute.
Argyrios Kyrtzidis [Tue, 13 Sep 2011 16:05:53 +0000 (16:05 +0000)]
Record the full source range of an attribute.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139599 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd a struct-size check for modules when dealing with module-private fields
Douglas Gregor [Tue, 13 Sep 2011 15:37:05 +0000 (15:37 +0000)]
Add a struct-size check for modules when dealing with module-private fields

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139597 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoIn Microsoft mode, downgrade "goto into protected scope" from error to warning if...
Francois Pichet [Tue, 13 Sep 2011 10:26:51 +0000 (10:26 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139595 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoSwitch -Wreturn-type to completely rely on the CFG model of no-return.
Chandler Carruth [Tue, 13 Sep 2011 09:53:58 +0000 (09:53 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139594 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd a bit to the CFGBlock to track when it contains a no-return
Chandler Carruth [Tue, 13 Sep 2011 09:53:55 +0000 (09:53 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139593 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoConsolidate the logic for building a no-return CFG block into a single
Chandler Carruth [Tue, 13 Sep 2011 09:13:49 +0000 (09:13 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139592 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoDon't use native atomics on ivars whose size is not a power of two,
John McCall [Tue, 13 Sep 2011 07:33:34 +0000 (07:33 +0000)]
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).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139590 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoThis test seems pretty low-value.
John McCall [Tue, 13 Sep 2011 07:24:27 +0000 (07:24 +0000)]
This test seems pretty low-value.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139589 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoEnhance the CFG construction to detect no-return destructors for
Chandler Carruth [Tue, 13 Sep 2011 06:09:01 +0000 (06:09 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139586 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoHandle reference properties correctly in the trivial-getter check.
John McCall [Tue, 13 Sep 2011 06:00:03 +0000 (06:00 +0000)]
Handle reference properties correctly in the trivial-getter check.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139585 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAlways emit bitfield properties using expression behavior, even if they're
John McCall [Tue, 13 Sep 2011 05:36:29 +0000 (05:36 +0000)]
Always emit bitfield properties using expression behavior, even if they're
atomic.  This is probably something we should warn about.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139584 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoUnify the decision of how to emit property getters and setters into a
John McCall [Tue, 13 Sep 2011 03:34:09 +0000 (03:34 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139580 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoWhen compiling a module on-demand, re-use the diagnostics client
Douglas Gregor [Tue, 13 Sep 2011 01:26:44 +0000 (01:26 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139570 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoWhen an import statement fails to find a module in the module cache,
Douglas Gregor [Mon, 12 Sep 2011 23:31:24 +0000 (23:31 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139558 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoPrivatize the setter/getter call generation methods, plus some minor
John McCall [Mon, 12 Sep 2011 23:06:44 +0000 (23:06 +0000)]
Privatize the setter/getter call generation methods, plus some minor
modernization.  No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139555 91177308-0d34-0410-b5e6-96231b3b80d8

13 years ago[driver] Ignore the '--' option, rather then fail. Do so to match gcc's
Chad Rosier [Mon, 12 Sep 2011 22:43:01 +0000 (22:43 +0000)]
[driver] Ignore the '--' option, rather then fail. Do so to match gcc's
behavior.
rdar://10110352 and PR10908

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139551 91177308-0d34-0410-b5e6-96231b3b80d8

13 years ago[analyzer] CmpRuns can now optionally delete empty reports.
Anna Zaks [Mon, 12 Sep 2011 22:40:36 +0000 (22:40 +0000)]
[analyzer] CmpRuns can now optionally delete empty reports.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139550 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoThread safety: small formatting change
Caitlin Sadowski [Mon, 12 Sep 2011 22:28:41 +0000 (22:28 +0000)]
Thread safety: small formatting change

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139548 91177308-0d34-0410-b5e6-96231b3b80d8

13 years ago[libclang] For getDeclFromExpr in CIndex.cpp, associate the decl of
Argyrios Kyrtzidis [Mon, 12 Sep 2011 22:17:26 +0000 (22:17 +0000)]
[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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139547 91177308-0d34-0410-b5e6-96231b3b80d8

13 years ago[analyzer] CmpRuns.cmpScanBuildResults() should be easy to call from other modules.
Anna Zaks [Mon, 12 Sep 2011 21:32:41 +0000 (21:32 +0000)]
[analyzer] CmpRuns.cmpScanBuildResults() should be easy to call from other modules.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139543 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoRename CmpRuns into CmpRuns.py so that it could be used as a module.
Anna Zaks [Mon, 12 Sep 2011 21:07:18 +0000 (21:07 +0000)]
Rename CmpRuns into CmpRuns.py so that it could be used as a module.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139540 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoIntroduce a cc1-level option to provide the path to the module cache,
Douglas Gregor [Mon, 12 Sep 2011 20:41:59 +0000 (20:41 +0000)]
Introduce a cc1-level option to provide the path to the module cache,
where the compiler will look for module files. Eliminates the
egregious hack where we looked into the header search paths for
modules.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139538 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoKill off an irrelevant FIXME
Douglas Gregor [Mon, 12 Sep 2011 18:58:37 +0000 (18:58 +0000)]
Kill off an irrelevant FIXME

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139523 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoBy popular demand, enumerate all builtin types!
Devang Patel [Mon, 12 Sep 2011 18:50:21 +0000 (18:50 +0000)]
By popular demand, enumerate all builtin types!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139521 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoRefactor CheckAdditionOperands() to use early return for pointer addition.
Richard Trieu [Mon, 12 Sep 2011 18:37:54 +0000 (18:37 +0000)]
Refactor CheckAdditionOperands() to use early return for pointer addition.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139520 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoDiagnose attempt to mark function-local declarations as __module_private__.
Douglas Gregor [Mon, 12 Sep 2011 18:37:38 +0000 (18:37 +0000)]
Diagnose attempt to mark function-local declarations as __module_private__.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139519 91177308-0d34-0410-b5e6-96231b3b80d8

13 years ago[analyzer] Simplify the test, use generic/more descriptive names.
Anna Zaks [Mon, 12 Sep 2011 18:28:35 +0000 (18:28 +0000)]
[analyzer] Simplify the test, use generic/more descriptive names.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139516 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd an assert so that new builtins do not sneak without proper debug info.
Devang Patel [Mon, 12 Sep 2011 18:24:46 +0000 (18:24 +0000)]
Add an assert so that new builtins do not sneak without proper debug info.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139514 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoUpdate test to fix windows buildbot.
Devang Patel [Mon, 12 Sep 2011 18:11:52 +0000 (18:11 +0000)]
Update test to fix windows buildbot.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139513 91177308-0d34-0410-b5e6-96231b3b80d8

13 years ago[libclang] In ASTUnit::Parse copy the CompilerInvocation object instead of
Argyrios Kyrtzidis [Mon, 12 Sep 2011 18:09:38 +0000 (18:09 +0000)]
[libclang] In ASTUnit::Parse copy the CompilerInvocation object instead of
modifying directly for the preamble.

This avoids an awful, hard to find, bug where "PreprocessorOpts.DisablePCHValidation = true"
would be persistent for subsequent reparses of the translation unit which would result
in defines, present in command-line but not in the PCH, being ignored.

Fixes rdar://9615399.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139512 91177308-0d34-0410-b5e6-96231b3b80d8

13 years ago[libclang] Make c-index-test check CINDEXTEST_REMAP_AFTER_TRIAL environment variable,
Argyrios Kyrtzidis [Mon, 12 Sep 2011 18:09:31 +0000 (18:09 +0000)]
[libclang] Make c-index-test check CINDEXTEST_REMAP_AFTER_TRIAL environment variable,
which when set it determines the trial number after which the remapping of files should
take effect.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139511 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFix two comments from warn to emit error to match the actual diagnostic used.
Richard Trieu [Mon, 12 Sep 2011 18:08:02 +0000 (18:08 +0000)]
Fix two comments from warn to emit error to match the actual diagnostic used.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139510 91177308-0d34-0410-b5e6-96231b3b80d8

13 years ago[analyzer] Fix a failure encountered while analyzing bind (radar://10105448).
Anna Zaks [Mon, 12 Sep 2011 18:07:30 +0000 (18:07 +0000)]
[analyzer] Fix a failure encountered while analyzing bind (radar://10105448).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139509 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoDoxygen comments.
Anna Zaks [Mon, 12 Sep 2011 17:57:20 +0000 (17:57 +0000)]
Doxygen comments.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139508 91177308-0d34-0410-b5e6-96231b3b80d8

13 years ago[analyzer] Fix a new failure encountered while building Adium exposed as a result...
Anna Zaks [Mon, 12 Sep 2011 17:56:08 +0000 (17:56 +0000)]
[analyzer] Fix a new failure encountered while building Adium exposed as a result of r138196(radar://10087620). ObjectiveC property of type int has a value of type ObjCPropRef, which is a Loc.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139507 91177308-0d34-0410-b5e6-96231b3b80d8

13 years ago[analyzer] Test for -analyze-function on ObjectiveC to accompany r139439.
Anna Zaks [Mon, 12 Sep 2011 17:48:08 +0000 (17:48 +0000)]
[analyzer] Test for -analyze-function on ObjectiveC to accompany r139439.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139506 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFix debug info encodings for char16_t and char32_t.
Devang Patel [Mon, 12 Sep 2011 17:11:58 +0000 (17:11 +0000)]
Fix debug info encodings for char16_t and char32_t.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139502 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAllow __module_private__ on fields
Douglas Gregor [Mon, 12 Sep 2011 16:11:24 +0000 (16:11 +0000)]
Allow __module_private__ on fields

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139499 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoRemove the restriction on module-private friends. Since the friend
Douglas Gregor [Mon, 12 Sep 2011 15:48:15 +0000 (15:48 +0000)]
Remove the restriction on module-private friends. Since the friend
declaration may be the first declaration, we want the ability to that
declaration to be marked module-private.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139497 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoOnly predefine the __EXCEPTIONS macro if C++ exceptions are turned on.
Douglas Gregor [Mon, 12 Sep 2011 15:17:19 +0000 (15:17 +0000)]
Only predefine the __EXCEPTIONS macro if C++ exceptions are turned on.
Only predefine the OBJC_ZEROCOST_EXCEPTIONS macro if Objective-C
exceptions are turned on. Fixes PR10910.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139496 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoSilence ?: precendence warning when parenthesis are present.
Hans Wennborg [Mon, 12 Sep 2011 12:07:30 +0000 (12:07 +0000)]
Silence ?: precendence warning when parenthesis are present.

Fixes PR10898. The warning should be silent when there are parenthesis
around the condition expression.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139492 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoSilence "end of non-void function" warnings with llvm_unreachable and add an assert.
Benjamin Kramer [Sat, 10 Sep 2011 21:52:04 +0000 (21:52 +0000)]
Silence "end of non-void function" warnings with llvm_unreachable and add an assert.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139474 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoobjc rewriter - more fixes to support compiling the rewritten
Fariborz Jahanian [Sat, 10 Sep 2011 17:01:56 +0000 (17:01 +0000)]
objc rewriter - more fixes to support compiling the rewritten
test case having instancetype. Fix in rewriter is unrelated to
using of instancetype. Test case uses other feature not yet
supported in the rewriter. There is more work to do, but this
is an ongoing task and not urgent at this time.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139473 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoremove pedantic ;
Chris Lattner [Sat, 10 Sep 2011 16:13:42 +0000 (16:13 +0000)]
remove pedantic ;

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139472 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoModernize and comment; no functionality change.
John McCall [Sat, 10 Sep 2011 09:30:49 +0000 (09:30 +0000)]
Modernize and comment;  no functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139470 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoSimplify the generation of Objective-C setters, at least a little.
John McCall [Sat, 10 Sep 2011 09:17:20 +0000 (09:17 +0000)]
Simplify the generation of Objective-C setters, at least a little.
Use a more portable heuristic for deciding when to emit a single
atomic store;  it's possible that I've lost information here, but
I'm not sure how much of the logic before was intentionally arch-specific
and how much was just not quite consistent.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139468 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoRename the ARC cast kinds to start with "ARC".
John McCall [Sat, 10 Sep 2011 06:18:15 +0000 (06:18 +0000)]
Rename the ARC cast kinds to start with "ARC".

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139466 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoCorrectly referring to the null pointer as 'null' not the macro 'NULL' in the boolean...
David Blaikie [Sat, 10 Sep 2011 05:47:59 +0000 (05:47 +0000)]
Correctly referring to the null pointer as 'null' not the macro 'NULL' in the boolean conversion diagnostic message.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139465 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoMake this test portable on Win32.
Julien Lerouge [Sat, 10 Sep 2011 05:46:15 +0000 (05:46 +0000)]
Make this test portable on Win32.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139464 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoShow either a location or a fixit note, not both, for uninitialized variable warnings.
David Blaikie [Sat, 10 Sep 2011 05:35:08 +0000 (05:35 +0000)]
Show either a location or a fixit note, not both, for uninitialized variable warnings.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139463 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoMissed a %local use; hopefully this clears this test up.
John McCall [Sat, 10 Sep 2011 05:31:57 +0000 (05:31 +0000)]
Missed a %local use;  hopefully this clears this test up.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139462 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFix a broken assert in AST/DeclCXX.cpp.
Richard Trieu [Sat, 10 Sep 2011 02:16:48 +0000 (02:16 +0000)]
Fix a broken assert in AST/DeclCXX.cpp.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139461 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoclang part of r139458; un-XFAIL testcase.
Eli Friedman [Sat, 10 Sep 2011 02:03:28 +0000 (02:03 +0000)]
clang part of r139458; un-XFAIL testcase.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139460 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoRevision 139454 fixed a broken assert in LLVM, which causes
Richard Trieu [Sat, 10 Sep 2011 01:56:32 +0000 (01:56 +0000)]
Revision 139454 fixed a broken assert in LLVM, which causes
a test failure in CodeGen/palignr.c, which has been marked
XFAIL for the time being.  A bug has been filed at PR10901
for this issue.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139457 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoMake this test not depend on unnecessary details and IR variable names.
John McCall [Sat, 10 Sep 2011 01:37:23 +0000 (01:37 +0000)]
Make this test not depend on unnecessary details and IR variable names.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139455 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoWhen converting a block pointer to an Objective-C pointer type, extend
John McCall [Sat, 10 Sep 2011 01:16:55 +0000 (01:16 +0000)]
When converting a block pointer to an Objective-C pointer type, extend
the lifetime of the block by copying it to the heap, or else we'll get
a dangling reference because the code working with the non-block-typed
object will not know it needs to copy.

There is some danger here, e.g. with assigning a block literal to an
unsafe variable, but, well, it's an unsafe variable.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139451 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFix a diagnostics crasher with -Wmissing-noreturn in Objective-C
Douglas Gregor [Sat, 10 Sep 2011 00:56:20 +0000 (00:56 +0000)]
Fix a diagnostics crasher with -Wmissing-noreturn in Objective-C
methods, and improve the diagnostic slightly along the way. Fixes
<rdar://problem/10098695>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139446 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFix a -Wreturn-type warning due to this field not explicitly having the
Chandler Carruth [Sat, 10 Sep 2011 00:51:24 +0000 (00:51 +0000)]
Fix a -Wreturn-type warning due to this field not explicitly having the
enumeration type.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139445 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoEmit debug info for wchar_t.
Devang Patel [Sat, 10 Sep 2011 00:44:49 +0000 (00:44 +0000)]
Emit debug info for wchar_t.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139443 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoDon't crash when we fail to load a module. It's unbecoming of a
Douglas Gregor [Sat, 10 Sep 2011 00:30:18 +0000 (00:30 +0000)]
Don't crash when we fail to load a module. It's unbecoming of a
well-bred compiler like Clang.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139442 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoClean up our handling of Objective-C definitions in AST files. Rather
Douglas Gregor [Sat, 10 Sep 2011 00:22:34 +0000 (00:22 +0000)]
Clean up our handling of Objective-C definitions in AST files. Rather
than having CodeGen check whether a declaration comes from an AST file
(which it shouldn't know or care about), make sure that the AST writer and
reader pass along "interesting" declarations that CodeGen needs to
know about.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139441 91177308-0d34-0410-b5e6-96231b3b80d8

13 years ago[analyzer] -analyze-function for ObjectiveC should check if any of the methods match...
Anna Zaks [Sat, 10 Sep 2011 00:12:23 +0000 (00:12 +0000)]
[analyzer] -analyze-function for ObjectiveC should check if any of the methods match the name (not only the first one).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139439 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoKill of the Decl::PCHLevel field entirely. We now only need to know
Douglas Gregor [Sat, 10 Sep 2011 00:09:20 +0000 (00:09 +0000)]
Kill of the Decl::PCHLevel field entirely. We now only need to know
whether a Decl was deserialized from an AST file (any AST file).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139438 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoExtend the Stmt AST to make it easier to look through label, default,
Chandler Carruth [Sat, 10 Sep 2011 00:02:34 +0000 (00:02 +0000)]
Extend the Stmt AST to make it easier to look through label, default,
and case statements. Use this to make the logic in the CFG builder more
robust at finding the actual statements within a compound statement,
even when there are many layers of labels obscuring it.

Also extend the test cases for a large chunk of PR10063. Still more work
to do here though.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139437 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoThe translation unit is never deserialized
Douglas Gregor [Fri, 9 Sep 2011 23:34:14 +0000 (23:34 +0000)]
The translation unit is never deserialized

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139436 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoEliminate all but one caller of Decl::getPCHLevel()
Douglas Gregor [Fri, 9 Sep 2011 23:07:59 +0000 (23:07 +0000)]
Eliminate all but one caller of Decl::getPCHLevel()

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139430 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoIntroduce a new predicate Decl::isFromASTFile() to determine whether a
Douglas Gregor [Fri, 9 Sep 2011 23:01:35 +0000 (23:01 +0000)]
Introduce a new predicate Decl::isFromASTFile() to determine whether a
declaration was deserialized from an AST file. Use this instead of
Decl::getPCHLevel() wherever possible. This is a simple step toward
killing off Decl::getPCHLevel().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139427 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoThread safety: removing unnecessary import and reordering import list
Caitlin Sadowski [Fri, 9 Sep 2011 23:00:59 +0000 (23:00 +0000)]
Thread safety: removing unnecessary import and reordering import list

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139426 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoThread safety: removing unnecessary import
Caitlin Sadowski [Fri, 9 Sep 2011 22:49:12 +0000 (22:49 +0000)]
Thread safety: removing unnecessary import

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139425 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoRemove trailing } in comment.
Julien Lerouge [Fri, 9 Sep 2011 22:46:39 +0000 (22:46 +0000)]
Remove trailing } in comment.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139424 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoBring llvm.annotation* intrinsics support back to where it was in llvm-gcc: can
Julien Lerouge [Fri, 9 Sep 2011 22:41:49 +0000 (22:41 +0000)]
Bring llvm.annotation* intrinsics support back to where it was in llvm-gcc: can
annotate global, local variables, struct fields, or arbitrary statements (using
the __builtin_annotation), rdar://8037476.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139423 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoIn the ASTReader, replace the never-NULL Preprocessor pointer with a
Douglas Gregor [Fri, 9 Sep 2011 22:02:16 +0000 (22:02 +0000)]
In the ASTReader, replace the never-NULL Preprocessor pointer with a
Preprocessor reference. Simplify some code along the way, so there is
no separate "initialize the preprocessor" step.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139418 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd smarter sorting of overload candidates that failed template deduction.
Kaelyn Uhrain [Fri, 9 Sep 2011 21:58:49 +0000 (21:58 +0000)]
Add smarter sorting of overload candidates that failed template deduction.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139417 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoCarry the debug information from single exit unified return block
Eric Christopher [Fri, 9 Sep 2011 21:53:04 +0000 (21:53 +0000)]
Carry the debug information from single exit unified return block
along with the new insert point.

Fixes PR10829

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139416 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoIn ASTReader, replace the never-NULL ASTContext pointer with an
Douglas Gregor [Fri, 9 Sep 2011 21:34:22 +0000 (21:34 +0000)]
In ASTReader, replace the never-NULL ASTContext pointer with an
ASTContext reference. Remove all of the extra checking and logic that
was used to cope with a NULL ASTContext. No effective functionality
change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139413 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFriends cannot be declared module-private
Douglas Gregor [Fri, 9 Sep 2011 21:14:29 +0000 (21:14 +0000)]
Friends cannot be declared module-private

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139411 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoMark the translation unit as having lexical/visible storage only when we actually...
Douglas Gregor [Fri, 9 Sep 2011 21:09:37 +0000 (21:09 +0000)]
Mark the translation unit as having lexical/visible storage only when we actually have data for that lexical or visible storage

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139409 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoBack out r139358 "[PCH] When loading the decls linked to an
Douglas Gregor [Fri, 9 Sep 2011 21:05:56 +0000 (21:05 +0000)]
Back out r139358 "[PCH] When loading the decls linked to an
identifier, also make them visible in the translation unit," which
isn't needed now that John's eliminated the AST dependency in blocks
CodeGen.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139408 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoSpecializations cannot be module-hidden. Diagnose attempts to do so.
Douglas Gregor [Fri, 9 Sep 2011 20:53:38 +0000 (20:53 +0000)]
Specializations cannot be module-hidden. Diagnose attempts to do so.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139406 91177308-0d34-0410-b5e6-96231b3b80d8