]> granicus.if.org Git - clang/log
clang
12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 years agoTreat the weak export of block runtime symbols as a deployment-target
John McCall [Fri, 9 Sep 2011 20:41:01 +0000 (20:41 +0000)]
Treat the weak export of block runtime symbols as a deployment-target
feature akin to the ARC runtime checks.  Removes a terrible hack where
IR gen needed to find the declarations of those symbols in the translation
unit.

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

12 years agoobjc rewriter - Add rewriter test for new instancetype
Fariborz Jahanian [Fri, 9 Sep 2011 20:35:22 +0000 (20:35 +0000)]
objc rewriter - Add rewriter test for new instancetype
along with minor rewriter fix to handle that. This
test is still incomplete due to rewriter issues
unrelated to instancetype.

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

12 years agoDon't produce 'instancetype' as the type of a message send expression. Map it down...
Douglas Gregor [Fri, 9 Sep 2011 20:05:21 +0000 (20:05 +0000)]
Don't produce 'instancetype' as the type of a message send expression. Map it down to 'id'.

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

12 years ago__module_private__ is inherited by redeclarations of an entity, and
Douglas Gregor [Fri, 9 Sep 2011 19:05:14 +0000 (19:05 +0000)]
__module_private__ is inherited by redeclarations of an entity, and
must also be present of the first declaration of that entity.

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

12 years ago[analyzer] When running scan-build with -plist on ./configure, delete the plist files.
Anna Zaks [Fri, 9 Sep 2011 18:43:53 +0000 (18:43 +0000)]
[analyzer] When running scan-build with -plist on ./configure, delete the plist files.
(scan-build does not set the $HtmlDir when running against configure. Previously, this implied that the plist files would appear in the current directory, with this patch they will get deleted.)

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

12 years agoPropagate __module_private__ from previous declarations to later
Douglas Gregor [Fri, 9 Sep 2011 18:32:39 +0000 (18:32 +0000)]
Propagate __module_private__ from previous declarations to later
declarations.

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

12 years agoWhen type-checking a call to an overloaded, builtin atomic operation,
Douglas Gregor [Fri, 9 Sep 2011 16:51:10 +0000 (16:51 +0000)]
When type-checking a call to an overloaded, builtin atomic operation,
construct a new DeclRefExpr rather than re-using the existing
DeclRefExpr. Patch by Likai Liu, fixes PR8345.

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

12 years agoThread safety: This patch deals with previously unhandled cases when building lock...
Caitlin Sadowski [Fri, 9 Sep 2011 16:21:55 +0000 (16:21 +0000)]
Thread safety: This patch deals with previously unhandled cases when building lock expressions. We now resolve this expressions, avoid crashing when encountering cast expressions, and have a diagnostic for unresolved lock expressions

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

12 years agoThread Safety: Moving the analysis to a new file
Caitlin Sadowski [Fri, 9 Sep 2011 16:11:56 +0000 (16:11 +0000)]
Thread Safety: Moving the analysis to a new file

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

12 years agoThread safety: refactoring test cases
Caitlin Sadowski [Fri, 9 Sep 2011 16:07:55 +0000 (16:07 +0000)]
Thread safety: refactoring test cases

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

12 years agoThread safety: refactoring to use an error handler
Caitlin Sadowski [Fri, 9 Sep 2011 16:04:02 +0000 (16:04 +0000)]
Thread safety: refactoring to use an error handler

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

12 years agoUpdate comment because JumpDiagnostics.cpp is not just about VLA scope.
Francois Pichet [Fri, 9 Sep 2011 11:02:57 +0000 (11:02 +0000)]
Update comment because JumpDiagnostics.cpp is not just about VLA scope.

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

12 years agoClean up the sentinel-attribute checking code a lot. Document
John McCall [Fri, 9 Sep 2011 07:56:05 +0000 (07:56 +0000)]
Clean up the sentinel-attribute checking code a lot.  Document
what 'nullPos' is supposed to mean, at least at this one site.
Use closed forms for the arithmetic.  Rip out some clever but
ultimately pointless code that was trying to use 0 or 0L depending
the size of a pointer vs. the size of int;  first, it didn't work
on LLP64 systems, and second, the sentinel checking code requires
a pointer-typed value anyway, so this fixit would not have actually
removed the warning.

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

12 years agoDo a lookup for the blocks runtime globals to see if they were declared,
Argyrios Kyrtzidis [Fri, 9 Sep 2011 06:44:21 +0000 (06:44 +0000)]
Do a lookup for the blocks runtime globals to see if they were declared,
instead of codegen waiting to consume such a declaration, which won't
happen if that decls are coming from a PCH.

Fixes rdar://10028656.

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

12 years ago[PCH] When loading the decls linked to an identifier, also make them visible
Argyrios Kyrtzidis [Fri, 9 Sep 2011 06:44:17 +0000 (06:44 +0000)]
[PCH] When loading the decls linked to an identifier, also make them visible
in the translation unit.

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

12 years agoUse ArrayRef in ExternalASTSource::SetExternalVisibleDeclsForName.
Argyrios Kyrtzidis [Fri, 9 Sep 2011 06:44:14 +0000 (06:44 +0000)]
Use ArrayRef in ExternalASTSource::SetExternalVisibleDeclsForName.

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

12 years agoCode formatting; no functionality change.
John McCall [Fri, 9 Sep 2011 06:12:06 +0000 (06:12 +0000)]
Code formatting; no functionality change.

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

12 years agoContextually converting to 'id' is not a useful operation. Contextually
John McCall [Fri, 9 Sep 2011 06:11:02 +0000 (06:11 +0000)]
Contextually converting to 'id' is not a useful operation.  Contextually
converting to an arbitrary Objective-C pointer type is.  Without
significantly re-implementing anything, change the API to reflect this,
and as a minor optimization, strip the pointer conversion off before
potentially building it.

Mostly, this removes a really bizarre-looking bit of code from
BuildInstanceMessage.

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

12 years agoGive conversions of block pointers to ObjC pointers a different cast kind
John McCall [Fri, 9 Sep 2011 05:25:32 +0000 (05:25 +0000)]
Give conversions of block pointers to ObjC pointers a different cast kind
than conversions of C pointers to ObjC pointers.  In order to ensure that
we've caught every case, add asserts to CastExpr that strictly determine
which cast kind is used for which kind of bit cast.

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

12 years agoClean up the RebuildUnknownAnyExpr visitor in SemaExpr.cpp. Mainly swapped around...
Richard Trieu [Fri, 9 Sep 2011 03:59:41 +0000 (03:59 +0000)]
Clean up the RebuildUnknownAnyExpr visitor in SemaExpr.cpp.  Mainly swapped around variable names so that this visitor be more like other visitors in clang.

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

12 years agoChanged references of BaseTy, MemInitTy, CXXScopeTy, TemplateParamsTy to CXXBaseSpeci...
Richard Trieu [Fri, 9 Sep 2011 03:18:59 +0000 (03:18 +0000)]
Changed references of BaseTy, MemInitTy, CXXScopeTy, TemplateParamsTy to CXXBaseSpecifier, CXXCtorInitializer, NestedNameSpecifier, TemplateParameterList and removed their typedefs.

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

12 years agoChange references to StmtTy to Stmt and removed typedefs of StmtTy. Also removed...
Richard Trieu [Fri, 9 Sep 2011 02:16:15 +0000 (02:16 +0000)]
Change references to StmtTy to Stmt and removed typedefs of StmtTy.  Also removed typedef of AttrTy since it is not used.

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

12 years agoModules: introduce the __module_private__ declaration specifier, which
Douglas Gregor [Fri, 9 Sep 2011 02:06:17 +0000 (02:06 +0000)]
Modules: introduce the __module_private__ declaration specifier, which
indicates that a declaration is only visible within the module it is
declared in.

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

12 years agoChange all references of type ExprTy to Expr and get rid of the typedefs.
Richard Trieu [Fri, 9 Sep 2011 02:00:50 +0000 (02:00 +0000)]
Change all references of type ExprTy to Expr and get rid of the typedefs.

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

12 years agoCapitialize paramater names in SemaExpr.cpp and resolve any parameter name conflicts...
Richard Trieu [Fri, 9 Sep 2011 01:45:06 +0000 (01:45 +0000)]
Capitialize paramater names in SemaExpr.cpp and resolve any parameter name conflicts between declarations and definitions from this and previous refactorings.

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

12 years agoThe integer type of an enumeration type isn't always canonical
Douglas Gregor [Thu, 8 Sep 2011 23:29:05 +0000 (23:29 +0000)]
The integer type of an enumeration type isn't always canonical

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

12 years agoRearrange comment slightly for Bill.
Eric Christopher [Thu, 8 Sep 2011 23:28:19 +0000 (23:28 +0000)]
Rearrange comment slightly for Bill.

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

12 years agoRemove WCHAR_MIN and WCHAR_MAX from limits.h. According to posix and c99
Eric Christopher [Thu, 8 Sep 2011 23:25:25 +0000 (23:25 +0000)]
Remove WCHAR_MIN and WCHAR_MAX from limits.h. According to posix and c99
these should be in stdint.h - and they already are.

Fixes rdar://10097036.

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

12 years agoThread safety: small edit to unused variation on warning left in by accident from...
Caitlin Sadowski [Thu, 8 Sep 2011 23:17:03 +0000 (23:17 +0000)]
Thread safety: small edit to unused variation on warning left in by accident from earlier commit

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

12 years agoAdd some delay between PCH creation and modifying one of the headers it depends on...
Douglas Gregor [Thu, 8 Sep 2011 22:32:33 +0000 (22:32 +0000)]
Add some delay between PCH creation and modifying one of the headers it depends on, which will---hopefully make this test predictably pass on Windows

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

12 years agoExtend -Wliteral-conversion to catch "int i = -1.234"
Matt Beaumont-Gay [Thu, 8 Sep 2011 22:30:47 +0000 (22:30 +0000)]
Extend -Wliteral-conversion to catch "int i = -1.234"

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

12 years agoThread Safety: In C++0x Mutexes are the objects that control access to shared variab...
Caitlin Sadowski [Thu, 8 Sep 2011 21:52:50 +0000 (21:52 +0000)]
Thread Safety:  In C++0x Mutexes are the objects that control access to shared variables, while Locks are the objects that acquire and release Mutexes. We switch to this new terminology.

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

12 years agoThe frexp, modf, and remquo builtins are not 'const'.
Jakob Stoklund Olesen [Thu, 8 Sep 2011 21:18:03 +0000 (21:18 +0000)]
The frexp, modf, and remquo builtins are not 'const'.

These functions return a second value by writing to a pointer argument,
so they cannot be marked 'readnone' which implies that they don't access
memory.

<rdar://problem/10070234>

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