]> granicus.if.org Git - clang/log
clang
13 years agoobjc: warn if a readonly property has a setter attribute too.
Fariborz Jahanian [Tue, 1 Nov 2011 23:02:16 +0000 (23:02 +0000)]
objc: warn if a readonly property has a setter attribute too.
// rdar://10357768

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

13 years ago[analyzer] Make sink attribute part of the node profile.
Anna Zaks [Tue, 1 Nov 2011 22:41:19 +0000 (22:41 +0000)]
[analyzer] Make sink attribute part of the node profile.

This prevents caching out on nodes with different sink flag.
(This is a cleaner fix for radar://10376675).

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

13 years ago[analyzer] Fix PR11282 - an assert in markAsSink
Anna Zaks [Tue, 1 Nov 2011 22:41:14 +0000 (22:41 +0000)]
[analyzer] Fix PR11282 - an assert in markAsSink

This is another fallout from the refactoring. We were
calling MarkAsSink on a cached out node.
(Fixes radar://10376675)

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

13 years ago[analyzer] Make sure the child builder use temporary destination sets
Anna Zaks [Tue, 1 Nov 2011 22:41:09 +0000 (22:41 +0000)]
[analyzer] Make sure the child builder use temporary destination sets

The parent and child builders should not share node sets.

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

13 years ago[analyzer] BranchNodeBuilder should not generate autotransitions.
Anna Zaks [Tue, 1 Nov 2011 22:41:06 +0000 (22:41 +0000)]
[analyzer] BranchNodeBuilder should not generate autotransitions.

This fixes radar://10367606

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

13 years ago[analyzer] CheckerContext::getPredecessor() cleanup
Anna Zaks [Tue, 1 Nov 2011 22:41:01 +0000 (22:41 +0000)]
[analyzer] CheckerContext::getPredecessor() cleanup

Remove unnecessary calls to CheckerContext::getPredecessor() + Comments.

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

13 years ago[analyzer] Remove the CheckerContext's destructor.
Anna Zaks [Tue, 1 Nov 2011 22:40:55 +0000 (22:40 +0000)]
[analyzer] Remove the CheckerContext's destructor.

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

13 years agoAdd missing export. Spotted by Leandro Melo.
Eli Friedman [Tue, 1 Nov 2011 22:25:07 +0000 (22:25 +0000)]
Add missing export.  Spotted by Leandro Melo.

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

13 years agoWhen we run into a constructor or destructor that is defined in the
Douglas Gregor [Tue, 1 Nov 2011 22:13:30 +0000 (22:13 +0000)]
When we run into a constructor or destructor that is defined in the
wrong class, make sure to drop it immediately; we don't want that
constructor to be available within the DeclContext. Fixes
<rdar://problem/9677163>.

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

13 years agoFix r143463 to test what it was intended to test.
Richard Smith [Tue, 1 Nov 2011 21:48:46 +0000 (21:48 +0000)]
Fix r143463 to test what it was intended to test.

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

13 years agoWhen we see an out-of-line definition of a member class template that
Douglas Gregor [Tue, 1 Nov 2011 21:35:16 +0000 (21:35 +0000)]
When we see an out-of-line definition of a member class template that
does not match any declaration in the class (or class template), be
sure to mark it as invalid. Fixes PR10924 / <rdar://problem/10119422>.

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

13 years agorename getHostTriple into getDefaultTargetTriple in clang
Sebastian Pop [Tue, 1 Nov 2011 21:33:06 +0000 (21:33 +0000)]
rename getHostTriple into getDefaultTargetTriple in clang

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

13 years agoWhen constant-folding, don't look at the initializer of a global const variable
Richard Smith [Tue, 1 Nov 2011 21:06:14 +0000 (21:06 +0000)]
When constant-folding, don't look at the initializer of a global const variable
if it's marked as weak: that definition may not end up being used.

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

13 years agoTemporarily disable lvalue-to-rvalue conversions on const pointers while an
Richard Smith [Tue, 1 Nov 2011 20:38:59 +0000 (20:38 +0000)]
Temporarily disable lvalue-to-rvalue conversions on const pointers while an
apparent miscompile triggered by this is investigated. This is essentially a
revert of r143298.

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

13 years agoDo not create sub_dirs. This breaks the CSS links for the website and produces really...
Tanya Lattner [Tue, 1 Nov 2011 20:09:03 +0000 (20:09 +0000)]
Do not create sub_dirs. This breaks the CSS links for the website and produces really long URLS.

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

13 years ago[libclang] Fix non-darwin buildbots.
Argyrios Kyrtzidis [Tue, 1 Nov 2011 19:47:41 +0000 (19:47 +0000)]
[libclang] Fix non-darwin buildbots.

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

13 years agoFind copy constructor needed to copy an rvalue reference
Fariborz Jahanian [Tue, 1 Nov 2011 18:57:34 +0000 (18:57 +0000)]
Find copy constructor needed to copy an rvalue reference
c++ object into block descriptor. // rdar://9971124

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

13 years agoSilence a warning in -Asserts builds
Matt Beaumont-Gay [Tue, 1 Nov 2011 18:10:22 +0000 (18:10 +0000)]
Silence a warning in -Asserts builds

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

13 years agoDowngrade err_iboutlet_object_type to a warning. It was breaking a bunch of code...
Ted Kremenek [Tue, 1 Nov 2011 18:08:35 +0000 (18:08 +0000)]
Downgrade err_iboutlet_object_type to a warning.  It was breaking a bunch of code.  We will reconsider promoting it back to an error later.

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

13 years agoPut a reference of the ASTReader in the ASTUnit.
Argyrios Kyrtzidis [Tue, 1 Nov 2011 17:14:15 +0000 (17:14 +0000)]
Put a reference of the ASTReader in the ASTUnit.

This is intended for direct access of the ASTReader for uses that make
little sense to try to shoehorn in the ExternalASTSource interface.

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

13 years ago[libclang] For a class extension, give it a unique USR but for any property or ivar
Argyrios Kyrtzidis [Tue, 1 Nov 2011 17:14:12 +0000 (17:14 +0000)]
[libclang] For a class extension, give it a unique USR but for any property or ivar
it contains give it a USR based on its semantic context, which is the interface.

This follows what we already did for objc methods. rdar://10371669

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

13 years agoImplement C++11 'constexpr calls must return constant expressions' rule, and
Richard Smith [Tue, 1 Nov 2011 16:57:24 +0000 (16:57 +0000)]
Implement C++11 'constexpr calls must return constant expressions' rule, and
perform the code simplifications this rule allows.

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

13 years agoEnable function call and some overload resolution with parameters of aggregate class...
Sebastian Redl [Tue, 1 Nov 2011 15:53:09 +0000 (15:53 +0000)]
Enable function call and some overload resolution with parameters of aggregate class type and initializer list arguments.

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

13 years agoCorrect test for additional comment line.
Eli Friedman [Tue, 1 Nov 2011 04:46:08 +0000 (04:46 +0000)]
Correct test for additional comment line.

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

13 years agoMark test as requiring x86 backend.
Eli Friedman [Tue, 1 Nov 2011 03:48:36 +0000 (03:48 +0000)]
Mark test as requiring x86 backend.

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

13 years agoDon't depend on system includes in test.
Eli Friedman [Tue, 1 Nov 2011 03:35:57 +0000 (03:35 +0000)]
Don't depend on system includes in test.

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

13 years agoMake test work with ARM C++ ABI.
Eli Friedman [Tue, 1 Nov 2011 03:30:32 +0000 (03:30 +0000)]
Make test work with ARM C++ ABI.

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

13 years agoTests for UTF-8 encoding in strings in source code. Patch by Seth Cantrell.
Eli Friedman [Tue, 1 Nov 2011 02:26:36 +0000 (02:26 +0000)]
Tests for UTF-8 encoding in strings in source code.  Patch by Seth Cantrell.

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

13 years agoFix the representation of wide strings in the AST and IR so that it uses the native...
Eli Friedman [Tue, 1 Nov 2011 02:23:42 +0000 (02:23 +0000)]
Fix the representation of wide strings in the AST and IR so that it uses the native representation of integers for the elements.  This fixes a bunch of nastiness involving
treating wide strings as a series of bytes.

Patch by Seth Cantrell.

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

13 years agoPerform proper conversion for strings encoded in the source file as UTF-8. (For...
Eli Friedman [Tue, 1 Nov 2011 02:14:50 +0000 (02:14 +0000)]
Perform proper conversion for strings encoded in the source file as UTF-8.  (For now, we are assuming the source character set is always UTF-8; this can be easily extended if necessary.)

Tests will be coming up in a subsequent commit.

Patch by Seth Cantrell.

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

13 years agoMove ConvertUTF8toUTF32 out of #if 0, in preparation for a patch which needs it.
Eli Friedman [Tue, 1 Nov 2011 02:10:54 +0000 (02:10 +0000)]
Move ConvertUTF8toUTF32 out of #if 0, in preparation for a patch which needs it.

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

13 years agoAdd LinkAllPasses to clang
Tobias Grosser [Tue, 1 Nov 2011 01:34:59 +0000 (01:34 +0000)]
Add LinkAllPasses to clang

This patch ensures that no passes are deleted from clang, such that the loading
of plugins does not fail because of passes being unavailable.  This increases
the size of the clang binary from 43029853 to 43915291 bytes (around 2%).

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

13 years agoAdd __has_feature(cxx_raw_string_literals) and
Douglas Gregor [Tue, 1 Nov 2011 01:23:44 +0000 (01:23 +0000)]
Add __has_feature(cxx_raw_string_literals) and
__has_feature(cxx_unicode_literals), from Michel Morin!

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

13 years agoAdd __has_feature(cxx_defaulted_functions) for querying "defaulted
Douglas Gregor [Tue, 1 Nov 2011 01:19:34 +0000 (01:19 +0000)]
Add __has_feature(cxx_defaulted_functions) for querying "defaulted
functions", from Michel Morin!

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

13 years agoRework the AST for the initializer of a delegating constructor, so
Douglas Gregor [Tue, 1 Nov 2011 01:16:03 +0000 (01:16 +0000)]
Rework the AST for the initializer of a delegating constructor, so
that it retains source location information for the type. Aside from
general goodness (being able to walk the types described in that
information), we now have a proper representation for dependent
delegating constructors. Fixes PR10457 (for real).

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

13 years agoAdds IRGen support for captured rvalue references in blocks.
Fariborz Jahanian [Mon, 31 Oct 2011 23:44:33 +0000 (23:44 +0000)]
Adds IRGen support for captured rvalue references in blocks.
In this case, temporary value is copied into block descriptor
as their own copy to work on. // rdar://9971124

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

13 years agoSome minor comment changes in constant-folding comparisons.
Eli Friedman [Mon, 31 Oct 2011 22:54:30 +0000 (22:54 +0000)]
Some minor comment changes in constant-folding comparisons.

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

13 years agoDon't try to fold comparisons between the address of an object and an arbitrary integ...
Eli Friedman [Mon, 31 Oct 2011 22:28:05 +0000 (22:28 +0000)]
Don't try to fold comparisons between the address of an object and an arbitrary integer constant.  Fixes regression from r143334.

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

13 years ago[libclang] Tweak internals of CXSourceLocation to allow an alternate implementation...
Ted Kremenek [Mon, 31 Oct 2011 22:23:51 +0000 (22:23 +0000)]
[libclang] Tweak internals of CXSourceLocation to allow an alternate implementation if the lowest bit of ptr_data[0] is not 0.  This
is prep for work on serialized diagnostics.

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

13 years ago[libclang] Move implementation of functions for manipulation CXSourceLocations and...
Ted Kremenek [Mon, 31 Oct 2011 22:05:42 +0000 (22:05 +0000)]
[libclang] Move implementation of functions for manipulation CXSourceLocations and CXSourceRanges into a separate file.

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

13 years ago[libclang] Add CXDiagnosticImpl to represent a super class for the implementation...
Ted Kremenek [Mon, 31 Oct 2011 21:40:19 +0000 (21:40 +0000)]
[libclang] Add CXDiagnosticImpl to represent a super class for the implementation backing a CXDiagnostic.  This allows CXStoredDiagnostic
to be just one possible implementation of a CXDiagnostic.

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

13 years agoRevert r143342. Caching of code-completion results was intentionally placed in "reparse"
Argyrios Kyrtzidis [Mon, 31 Oct 2011 21:25:31 +0000 (21:25 +0000)]
Revert r143342. Caching of code-completion results was intentionally placed in "reparse"
because we don't want to take this performance hit when doing code completion

Log of r143342:
Move caching of code-completion results from ASTUnit::Reparse to ASTUnit::CodeComplete,
so that it will happen when we are doing code-completion, not reparsing.

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

13 years agoAdd missing lvalue-to-rvalue conversion.
Eli Friedman [Mon, 31 Oct 2011 20:59:03 +0000 (20:59 +0000)]
Add missing lvalue-to-rvalue conversion.

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

13 years agoRefactoring and test for r143360. Support for array rvalue to pointer decay is
Richard Smith [Mon, 31 Oct 2011 20:57:44 +0000 (20:57 +0000)]
Refactoring and test for r143360. Support for array rvalue to pointer decay is
needed for C++11, and will follow later.

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

13 years agoTemporary fix for assert while evaluating array-to-pointer decay on array
Richard Smith [Mon, 31 Oct 2011 20:20:33 +0000 (20:20 +0000)]
Temporary fix for assert while evaluating array-to-pointer decay on array
rvalue. Test and better fix to follow.

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

13 years agoImprove text of a diagnostic.
Fariborz Jahanian [Mon, 31 Oct 2011 17:27:06 +0000 (17:27 +0000)]
Improve text of a diagnostic.

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

13 years agoIn x86_64, when calling an Objective-C method that returns a _Complex long double...
Anders Carlsson [Mon, 31 Oct 2011 16:27:11 +0000 (16:27 +0000)]
In x86_64, when calling an Objective-C method that returns a _Complex long double, make sure to use the objc_msgSend_fp2ret function which ensures that the return value will be {0, 0} if the receiver is nil.

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

13 years agoAdd possibility to specify an include location for createFileIDForMemBuffer().
Axel Naumann [Mon, 31 Oct 2011 11:02:24 +0000 (11:02 +0000)]
Add possibility to specify an include location for createFileIDForMemBuffer().
Useful to set up a virtual include hierarchy, e.g. to order diagnostics for ambiguous overloads from MemoryBuffers.

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

13 years agoSimplify the set of directories we look for on multiarch systems.
Chandler Carruth [Mon, 31 Oct 2011 09:06:40 +0000 (09:06 +0000)]
Simplify the set of directories we look for on multiarch systems.
I don't have any Debian system with one of these currently, and it seems
unlikely for one to show up suddenly. We can add more patterns here if
they become necessary.

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

13 years agoAdd "just one more" include path to the monstrosity that is our header
Chandler Carruth [Mon, 31 Oct 2011 08:42:27 +0000 (08:42 +0000)]
Add "just one more" include path to the monstrosity that is our header
search logic. The Debian multiarch seems to have completely changed from
when these were originally added, and I'd like to remove a bunch of
them, but I'll be lazy and delay that until this logic is hoisted into
the driver where it belongs.

This should resolve PR11223.

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

13 years agoFix part of PR11223 and probably a few dups as well. This teaches the
Chandler Carruth [Mon, 31 Oct 2011 08:42:24 +0000 (08:42 +0000)]
Fix part of PR11223 and probably a few dups as well. This teaches the
library search logic to "properly" handle multiarch installations. I've
tested this on both Debian unstable and the latest Ubuntu which both use
this setup, and this appears to work largely the same way as GCC does.
It isn't exactly the same, but it is close enough and more principled in
its behavior where it differs. This should resolve any failures to find
'crt1.o' etc on Debian-based Linux distributions. If folks find more
cases where we fail, please file bugs and CC me.

Test cases for all of the debian silliness are waiting both to simplify
the process of merging these down into the 3.0 release, and because
they're so crazy I haven't yet been able to really produce a fake tree
that represents what we need to test for. I'll eventually add them
though.

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

13 years agoFix the source range for ObjCInterfaces that are forward decls.
Argyrios Kyrtzidis [Mon, 31 Oct 2011 07:20:23 +0000 (07:20 +0000)]
Fix the source range for ObjCInterfaces that are forward decls.

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

13 years agoMove caching of code-completion results from ASTUnit::Reparse to ASTUnit::CodeComplete,
Argyrios Kyrtzidis [Mon, 31 Oct 2011 07:20:19 +0000 (07:20 +0000)]
Move caching of code-completion results from ASTUnit::Reparse to ASTUnit::CodeComplete,
so that it will happen when we are doing code-completion, not reparsing.

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

13 years ago[PCH] Now that we store the location of a decl outside its record
Argyrios Kyrtzidis [Mon, 31 Oct 2011 07:20:15 +0000 (07:20 +0000)]
[PCH] Now that we store the location of a decl outside its record
make sure that we keep track of locations of replaced decls as well.

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

13 years ago[PCH] For ASTReader's FileDeclIDs also associate the Module that the
Argyrios Kyrtzidis [Mon, 31 Oct 2011 07:20:08 +0000 (07:20 +0000)]
[PCH] For ASTReader's FileDeclIDs also associate the Module that the
local DeclIDs came from.

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

13 years agoIntroduce SourceManager::isLocalFileID/isLoadedFileID functions.
Argyrios Kyrtzidis [Mon, 31 Oct 2011 07:20:03 +0000 (07:20 +0000)]
Introduce SourceManager::isLocalFileID/isLoadedFileID functions.

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

13 years agoHave the ASTUnit associate the local declarations that get parsed with the file
Argyrios Kyrtzidis [Mon, 31 Oct 2011 07:19:59 +0000 (07:19 +0000)]
Have the ASTUnit associate the local declarations that get parsed with the file
that contains them.

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

13 years ago[libclang] Rename VisitIncludedPreprocessingEntries -> VisitIncludedEntities
Argyrios Kyrtzidis [Mon, 31 Oct 2011 07:19:54 +0000 (07:19 +0000)]
[libclang] Rename VisitIncludedPreprocessingEntries -> VisitIncludedEntities

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

13 years agoC++11 generalized constant expression handling: evaluation support for
Richard Smith [Mon, 31 Oct 2011 05:52:43 +0000 (05:52 +0000)]
C++11 generalized constant expression handling: evaluation support for
materialized temporaries.

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

13 years agoC++11 generalized constant expressions: evaluate equality comparisons between
Richard Smith [Mon, 31 Oct 2011 05:11:32 +0000 (05:11 +0000)]
C++11 generalized constant expressions: evaluate equality comparisons between
arbitrary pointers, if those pointers don't point to weak objects or literals.

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

13 years agocindex.py: Remove more ternary operator + whitespace fixes
Tobias Grosser [Mon, 31 Oct 2011 02:06:50 +0000 (02:06 +0000)]
cindex.py: Remove more ternary operator + whitespace fixes

Another batch of ternary operators and some whitespace fixes
(Getting in sync with the clang_complete version of this file)

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

13 years agoC++11 generalized constant expressions: support pointer comparisons where the
Richard Smith [Mon, 31 Oct 2011 01:37:14 +0000 (01:37 +0000)]
C++11 generalized constant expressions: support pointer comparisons where the
result is not unspecified.

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

13 years agoTurn on the new .file directive when appropriate, instead of turning it off.
Nick Lewycky [Mon, 31 Oct 2011 01:06:42 +0000 (01:06 +0000)]
Turn on the new .file directive when appropriate, instead of turning it off.

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

13 years agoclang.py: Remove use of ternary operators
Tobias Grosser [Mon, 31 Oct 2011 00:49:07 +0000 (00:49 +0000)]
clang.py: Remove use of ternary operators

This change is necessary to make this file python 2.4 compatible.

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

13 years agocindex.py: Allow to create a cursor from file/row/column
Tobias Grosser [Mon, 31 Oct 2011 00:31:32 +0000 (00:31 +0000)]
cindex.py: Allow to create a cursor from file/row/column

We add a constructor to create a SourceLocation from a position in
a file and we use this SourceLocation to retrieve a cursor.

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

13 years agocindex.py: Add File.create_from_name()
Tobias Grosser [Mon, 31 Oct 2011 00:07:19 +0000 (00:07 +0000)]
cindex.py: Add File.create_from_name()

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

13 years agoFix assert on constant expression evaluation of floating point increment.
Richard Smith [Sun, 30 Oct 2011 23:17:09 +0000 (23:17 +0000)]
Fix assert on constant expression evaluation of floating point increment.

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

13 years agoAdd support for lazily linking bitcode files (using a new
Peter Collingbourne [Sun, 30 Oct 2011 17:30:44 +0000 (17:30 +0000)]
Add support for lazily linking bitcode files (using a new
-mlink-bitcode-file flag), and more generally llvm::Modules, before
running optimisations.

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

13 years agoAdd support for sse4a and enable it for amdfam10 cpu.
Roman Divacky [Sun, 30 Oct 2011 13:47:56 +0000 (13:47 +0000)]
Add support for sse4a and enable it for amdfam10 cpu.

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

13 years agoFixed CXX struct and class initialization printing to support 'move'
Jim Goodnow II [Sun, 30 Oct 2011 11:17:39 +0000 (11:17 +0000)]
Fixed CXX struct and class initialization printing to support 'move'
type constructors.

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

13 years agoAdd support for amdfam10 cpu.
Roman Divacky [Sun, 30 Oct 2011 07:48:46 +0000 (07:48 +0000)]
Add support for amdfam10 cpu.

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

13 years agoStop disabling integrated assembler with -static. <rdar://problem/10175391>
Bob Wilson [Sun, 30 Oct 2011 00:20:28 +0000 (00:20 +0000)]
Stop disabling integrated assembler with -static. <rdar://problem/10175391>

The integrated assembler seems to be working pretty well for -static code
now, so remove the hacks to disable it.

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

13 years agoDon't crash if a GCC binary conditional is used in a constant expression on an
Richard Smith [Sat, 29 Oct 2011 22:55:55 +0000 (22:55 +0000)]
Don't crash if a GCC binary conditional is used in a constant expression on an
integer-cast pointer value.

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

13 years agoconstexpr evaluation: allow lvalue-to-rvalue conversion on any literal type, not
Richard Smith [Sat, 29 Oct 2011 21:53:17 +0000 (21:53 +0000)]
constexpr evaluation: allow lvalue-to-rvalue conversion on any literal type, not
just integers and floating point types. Since we don't support evaluating class
types or performing lvalue-to-rvalue conversions on array elements yet, this
just means pointer types right now.

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

13 years agoconstexpr function substitution:
Richard Smith [Sat, 29 Oct 2011 20:57:55 +0000 (20:57 +0000)]
constexpr function substitution:
Track the function invocation where an lvalue referring to a constexpr function
parameter originated from, and use it to substitute the correct argument and to
determine whether such an argument's lifetime has ended.

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

13 years agoFixed FriendDecl source locations.
Abramo Bagnara [Sat, 29 Oct 2011 20:52:52 +0000 (20:52 +0000)]
Fixed FriendDecl source locations.

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

13 years agoUse LIBCLANG_NOTHREADS instead of CINDEXTEST_NOTHREADS inside libclang,
Argyrios Kyrtzidis [Sat, 29 Oct 2011 19:32:39 +0000 (19:32 +0000)]
Use LIBCLANG_NOTHREADS instead of CINDEXTEST_NOTHREADS inside libclang,
so the c-index-test one can be enabled without affecting libclang.

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

13 years agoRename Expr::Evaluate to Expr::EvaluateAsRValue to make it clear that it will
Richard Smith [Sat, 29 Oct 2011 00:50:52 +0000 (00:50 +0000)]
Rename Expr::Evaluate to Expr::EvaluateAsRValue to make it clear that it will
implicitly perform an lvalue-to-rvalue conversion if used on an lvalue
expression. Also improve the documentation of Expr::Evaluate* to indicate which
of them will accept expressions with side-effects.

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

13 years agoStart work on SerializedDiagnosticPrinter, a new DiagnosticConsumer that serializes...
Ted Kremenek [Sat, 29 Oct 2011 00:12:39 +0000 (00:12 +0000)]
Start work on SerializedDiagnosticPrinter, a new DiagnosticConsumer that serializes out the diagnostics for a given translation unit to a bit code file.  This is a WIP.

The motivation for this new DiagnosticConsumer is to provide a way for tools invoking the compiler
to get its diagnostics via a libclang interface, rather than textually parsing the compiler output.
This gives us flexibility to change the compiler's textual output, but have a structured data format
for clients to use to get the diagnostics via a stable API.

I have no tests for this, but llvm-bcanalyzer so far shows that the emitted file is well-formed.

More work to follow.

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

13 years agoobjc-arc: desugar certain type and improve on diagnostic for
Fariborz Jahanian [Sat, 29 Oct 2011 00:06:10 +0000 (00:06 +0000)]
objc-arc: desugar certain type and improve on diagnostic for
ownership qualifier cast which won't work.
// rdar://10244607

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

13 years agoAdd test missed from r143234.
Richard Smith [Sat, 29 Oct 2011 00:03:08 +0000 (00:03 +0000)]
Add test missed from r143234.

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

13 years ago[PCH] Sort the file decls by file offset not raw source location.
Argyrios Kyrtzidis [Fri, 28 Oct 2011 23:57:47 +0000 (23:57 +0000)]
[PCH] Sort the file decls by file offset not raw source location.

Currently sorting by raw source location does work as intended but who knows
what may change in the future..

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

13 years ago[PCH] In ASTWriter::associateDeclWithFile don't bother finding the file loc
Argyrios Kyrtzidis [Fri, 28 Oct 2011 23:57:43 +0000 (23:57 +0000)]
[PCH] In ASTWriter::associateDeclWithFile don't bother finding the file loc
if we are not interested in the decl.

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

13 years agoFix assertion in constant expression evaluation. The LHS of a floating-point
Richard Smith [Fri, 28 Oct 2011 23:26:52 +0000 (23:26 +0000)]
Fix assertion in constant expression evaluation. The LHS of a floating-point
binary operator isn't an rvalue if it's an assignment operator.

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

13 years agoMove -Wc++11-compat out of -Wall. It causes trouble for clients that
Douglas Gregor [Fri, 28 Oct 2011 23:11:43 +0000 (23:11 +0000)]
Move -Wc++11-compat out of -Wall. It causes trouble for clients that
define their own "nullptr" class in C++98 and build with -Wall.

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

13 years agoGive __STDC_VERSION__ the value 201001L when we're in C1x mode. The
Douglas Gregor [Fri, 28 Oct 2011 23:02:54 +0000 (23:02 +0000)]
Give __STDC_VERSION__ the value 201001L when we're in C1x mode. The
committee hasn't set a value for __STDC_VERSION__ yet, so this is a
placeholder. But at least it's > 199901L.

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

13 years ago[libclang] Introduce use of CINDEXTEST_FAILONERROR environment variable which, if...
Argyrios Kyrtzidis [Fri, 28 Oct 2011 22:54:36 +0000 (22:54 +0000)]
[libclang] Introduce use of CINDEXTEST_FAILONERROR environment variable which, if set,
will cause c-index-test to return as failed if a compiler error occurred.

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

13 years ago[libclang] Check for environment variable CINDEXTEST_NOTHREADS in clang_reparseTransl...
Argyrios Kyrtzidis [Fri, 28 Oct 2011 22:54:33 +0000 (22:54 +0000)]
[libclang] Check for environment variable CINDEXTEST_NOTHREADS in clang_reparseTranslationUnit.

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

13 years agoMake -error-on-deserialized-decl work correctly by correctly delegating to
Argyrios Kyrtzidis [Fri, 28 Oct 2011 22:54:31 +0000 (22:54 +0000)]
Make -error-on-deserialized-decl work correctly by correctly delegating to
the previous ASTDeserializationListener.

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

13 years ago[ARC] Do not transfer ARC ownership if the cast is going to result in r-value,
Argyrios Kyrtzidis [Fri, 28 Oct 2011 22:54:28 +0000 (22:54 +0000)]
[ARC] Do not transfer ARC ownership if the cast is going to result in r-value,
in which case the ownership is redundant. Thanks to John for the suggestion.

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

13 years agoAdd an alias option for -error-on-deserialized-decl with joined '='.
Argyrios Kyrtzidis [Fri, 28 Oct 2011 22:54:24 +0000 (22:54 +0000)]
Add an alias option for -error-on-deserialized-decl with joined '='.

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

13 years ago[PCH] Keep track of file-level declarations that are contained by files.
Argyrios Kyrtzidis [Fri, 28 Oct 2011 22:54:21 +0000 (22:54 +0000)]
[PCH] Keep track of file-level declarations that are contained by files.

Introduce a FILE_SORTED_DECLS [de]serialization record that contains
a file sorted array of file-level DeclIDs in a PCH/Module.
The rationale is to allow "targeted" deserialization of decls inside
a range of a source file.

Cocoa PCH increased by 0.8%
Difference of creation time for Cocoa PCH is below the noise level.

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

13 years agoInitial support for C++11 constexpr function invocation substitution. Using
Richard Smith [Fri, 28 Oct 2011 22:34:42 +0000 (22:34 +0000)]
Initial support for C++11 constexpr function invocation substitution. Using
constexpr function arguments outside of their function (passing or returning
them by reference) does not work correctly yet.

Calling constexpr function templates does not work yet, since the bodies are not
instantiated until the end of the translation unit.

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

13 years agoIn case of template specialization, do not try to delay emitting debug info for concr...
Devang Patel [Fri, 28 Oct 2011 21:12:13 +0000 (21:12 +0000)]
In case of template specialization, do not try to delay emitting debug info for concrete type in -flimit-debug-info mode. This fixes some of the failures from bs15503.exp tests in gdb testsuite.

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

13 years agoFix this on the bots and make the test more complete by enabling optimizations.
Rafael Espindola [Fri, 28 Oct 2011 20:52:18 +0000 (20:52 +0000)]
Fix this on the bots and make the test more complete by enabling optimizations.

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

13 years agoFix PR9614 for functions with the always_inline attribute. Try to keep
Rafael Espindola [Fri, 28 Oct 2011 20:43:56 +0000 (20:43 +0000)]
Fix PR9614 for functions with the always_inline attribute. Try to keep
the common case (-O0, no always_inline) fast.

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

13 years agoobjective-c arc: type-casting of an objc pointer to
Fariborz Jahanian [Fri, 28 Oct 2011 20:06:07 +0000 (20:06 +0000)]
objective-c arc: type-casting of an objc pointer to
an rvalue retainable object type with life-time qualifier has no
effect and wil be diagnosed as error. // rdar://10244607

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

13 years agoDeleted functions were in Clang 2.9, defaulted functions in
Douglas Gregor [Fri, 28 Oct 2011 19:44:09 +0000 (19:44 +0000)]
Deleted functions were in Clang 2.9, defaulted functions in
3.0. Fixses PR11252.

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

13 years ago[analyzer] ObjC message sends to nil receivers that return structs are now okay ...
Ted Kremenek [Fri, 28 Oct 2011 19:05:10 +0000 (19:05 +0000)]
[analyzer] ObjC message sends to nil receivers that return structs are now okay (compiler zeroes out the data).  Fixes <rdar://problem/9151319>.

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

13 years agoIt turns out that the Objective-C message lookup functions can throw exceptions after...
David Chisnall [Fri, 28 Oct 2011 17:55:06 +0000 (17:55 +0000)]
It turns out that the Objective-C message lookup functions can throw exceptions after all...

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