]> granicus.if.org Git - clang/log
clang
12 years agomodern objective-c translator: translation of implicit
Fariborz Jahanian [Mon, 16 Apr 2012 22:14:01 +0000 (22:14 +0000)]
modern objective-c translator: translation of implicit
cast to/from block pointer types. // rdar://11202764
Also, many more modern translator tests.

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

12 years ago[analyzer] Fix a false alarm in SelfInitChecker (radar://11235991).
Anna Zaks [Mon, 16 Apr 2012 21:51:09 +0000 (21:51 +0000)]
[analyzer] Fix a false alarm in SelfInitChecker (radar://11235991).
Along with it, fix a couple of other corner cases and add more tests.

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

12 years ago[analyzer] +comments
Anna Zaks [Mon, 16 Apr 2012 21:51:06 +0000 (21:51 +0000)]
[analyzer] +comments

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

12 years ago[analyzer] Fixup for a test case.
Anna Zaks [Mon, 16 Apr 2012 21:51:03 +0000 (21:51 +0000)]
[analyzer] Fixup for a test case.

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

12 years agoobjective-c modern translator: buildit objc bool
Fariborz Jahanian [Mon, 16 Apr 2012 21:03:30 +0000 (21:03 +0000)]
objective-c modern translator: buildit objc bool
type for rewriter project will be BoolTy.
// rdar://11231426.

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

12 years ago[libclang] Spelling range for a objc category should the category name range, not...
Argyrios Kyrtzidis [Mon, 16 Apr 2012 20:01:28 +0000 (20:01 +0000)]
[libclang] Spelling range for a objc category should the category name range, not the class one.

rdar://11249386

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

12 years agoRemove support for -fast-math metadata for the moment.
Duncan Sands [Mon, 16 Apr 2012 19:40:49 +0000 (19:40 +0000)]
Remove support for -fast-math metadata for the moment.

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

12 years agoPer Richard's comments on r154794, add the checks necessary to handle constant-foldin...
Eli Friedman [Mon, 16 Apr 2012 19:23:57 +0000 (19:23 +0000)]
Per Richard's comments on r154794, add the checks necessary to handle constant-folding relational comparisons safely in case the user is using -fwrapv or equivalent.

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

12 years agoRevert r154749 for now at John McCall's request.
Rafael Espindola [Mon, 16 Apr 2012 18:46:26 +0000 (18:46 +0000)]
Revert r154749 for now at John McCall's request.

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

12 years agoImplement the last part of C++ [class.mem]p2, delaying the parsing of
Douglas Gregor [Mon, 16 Apr 2012 18:27:27 +0000 (18:27 +0000)]
Implement the last part of C++ [class.mem]p2, delaying the parsing of
exception specifications on member functions until after the closing
'}' for the containing class. This allows, for example, a member
function to throw an instance of its own class. Fixes PR12564 and a
fairly embarassing oversight in our C++98/03 support.

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

12 years agoUse ordering and the explicit visibility bit instead of modifying
Rafael Espindola [Mon, 16 Apr 2012 18:25:01 +0000 (18:25 +0000)]
Use ordering and the explicit visibility bit instead of modifying
ConsiderGlobalVisibility. No functionality change.

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

12 years agoReadd lost "undef BUILTIN" to fix the build.
David Blaikie [Mon, 16 Apr 2012 17:57:39 +0000 (17:57 +0000)]
Readd lost "undef BUILTIN" to fix the build.

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

12 years agoGenerate fpmath metadata when -ffast-math. Note that no optimizations are hooked
Duncan Sands [Mon, 16 Apr 2012 17:24:31 +0000 (17:24 +0000)]
Generate fpmath metadata when -ffast-math. Note that no optimizations are hooked
up to this yet.

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

12 years agoHexagon V5(Floating Point) support.
Sirish Pande [Mon, 16 Apr 2012 17:04:05 +0000 (17:04 +0000)]
Hexagon V5(Floating Point) support.

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

12 years agoRemove unused method.
Rafael Espindola [Mon, 16 Apr 2012 16:41:02 +0000 (16:41 +0000)]
Remove unused method.

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

12 years agoAdjust for LLVM name tweaks requested by Chandler.
Duncan Sands [Mon, 16 Apr 2012 16:29:47 +0000 (16:29 +0000)]
Adjust for LLVM name tweaks requested by Chandler.

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

12 years agoAdd another constructor to LVFlags and use it to simplify the code a bit.
Rafael Espindola [Mon, 16 Apr 2012 13:44:41 +0000 (13:44 +0000)]
Add another constructor to LVFlags and use it to simplify the code a bit.

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

12 years agoImplement C++11 [expr.prim.general]p3, which permits the use of 'this'
Douglas Gregor [Mon, 16 Apr 2012 07:05:22 +0000 (07:05 +0000)]
Implement C++11 [expr.prim.general]p3, which permits the use of 'this'
in the declaration of a non-static member function after the
(optional) cv-qualifier-seq, which in practice means in the exception
specification and late-specified return type.

The new scheme here used to manage 'this' outside of a member function
scope is more general than the Scope-based mechanism previously used
for non-static data member initializers and late-parsesd attributes,
because it can also handle the cv-qualifiers on the member
function. Note, however, that a separate pass is required for static
member functions to determine whether 'this' was used, because we
might not know that we have a static function until after declaration
matching.

Finally, this introduces name mangling for 'this' and for the implicit
'this', which is intended to match GCC's mangling. Independent
verification for the new mangling test case would be appreciated.

Fixes PR10036 and PR12450.

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

12 years agoAdd note to hacking.html that running the test harness directly from the command...
Eli Friedman [Mon, 16 Apr 2012 05:04:45 +0000 (05:04 +0000)]
Add note to hacking.html that running the test harness directly from the command-line requires making sure the relevant files are generated first.  Patch by Matt Fowles, with some minor modifications.

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

12 years agoMake constant evaluation for pointer comparisons work correctly for some uncommon...
Eli Friedman [Mon, 16 Apr 2012 04:30:08 +0000 (04:30 +0000)]
Make constant evaluation for pointer comparisons work correctly for some uncommon cases.  <rdar://problem/10962435>.

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

12 years agouse DEFAULT_SYSROOT
Sebastian Pop [Mon, 16 Apr 2012 04:16:43 +0000 (04:16 +0000)]
use DEFAULT_SYSROOT

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

12 years agoThe result of the Microsoft __uuidof operator must be considered a global lvalue...
Francois Pichet [Mon, 16 Apr 2012 04:08:35 +0000 (04:08 +0000)]
The result of the Microsoft __uuidof operator must be considered a global lvalue during constant expression evaluation.
Otherwise we would get this error in C++11 mode (because of a recent change):
   error: non-type template argument of type 'const _GUID *' is not a constant expression

For code like:
template <const GUID* g = &__uuidof(struct_with_uuid)>
class COM_CLASS { };

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

12 years agoPropagate alignment on lvalues through EmitLValueForField. PR12395.
Eli Friedman [Mon, 16 Apr 2012 03:54:45 +0000 (03:54 +0000)]
Propagate alignment on lvalues through EmitLValueForField.  PR12395.

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

12 years agoAdd 'env' in hopes of making this test pass on Windows.
Nick Lewycky [Mon, 16 Apr 2012 03:22:35 +0000 (03:22 +0000)]
Add 'env' in hopes of making this test pass on Windows.

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

12 years agoImplement the all_lookups_iterator for PCH as a follow-up to r153970. This
Nick Lewycky [Mon, 16 Apr 2012 02:51:46 +0000 (02:51 +0000)]
Implement the all_lookups_iterator for PCH as a follow-up to r153970. This
includes a patch from Matthias Kleine with a regression testcase!

Adds a new iterator 'data_iterator' to OnDiskHashTable which doesn't try to
reconstruct the external_key from the internal_key, which is useful for traits
that don't store enough information to do that mapping in their key. Also
deletes the 'item_iterator' from OnDiskHashTable as dead code.

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

12 years agoLike for LLVM / shlib, we also provide a SONAME to libclang.so
Sylvestre Ledru [Sun, 15 Apr 2012 23:17:25 +0000 (23:17 +0000)]
Like for LLVM / shlib, we also provide a SONAME to libclang.so

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

12 years agoChange _mm256_permute4x64_epi64 and _mm256_permute4x64_pd to use builtin_shufflevecto...
Craig Topper [Sun, 15 Apr 2012 22:18:10 +0000 (22:18 +0000)]
Change _mm256_permute4x64_epi64 and _mm256_permute4x64_pd to use builtin_shufflevector instead of specific builtins. Old builtins will be removed from llvm now that vpermq/vpermpd are supported by shuffle lowering code.

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

12 years agoFix tests that weren't actually verifying anything.
David Blaikie [Sun, 15 Apr 2012 22:09:44 +0000 (22:09 +0000)]
Fix tests that weren't actually verifying anything.

Passing -verify to clang without -cc1 or -Xclang silently passes (with a
printed warning, but lit doesn't care about that). This change adds -cc1 or,
as is necessary in one case, -Xclang to fix this so that these tests are
actually verifying as intended.

I'd like to change the driver so this kind of mistake could not be made, but
I'm not entirely sure how. Further, since the driver only warns about unknown
flags in general, we could have similar bugs with a misspellings of arguments
that would be nice to find.

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

12 years agoCorrect indentation
David Blaikie [Sun, 15 Apr 2012 21:22:10 +0000 (21:22 +0000)]
Correct indentation

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

12 years ago[clang.py] Implement TypeKind.spelling
Gregory Szorc [Sun, 15 Apr 2012 18:51:10 +0000 (18:51 +0000)]
[clang.py] Implement TypeKind.spelling

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

12 years agoUse MDBuilder to help with metadata creation.
Duncan Sands [Sun, 15 Apr 2012 18:04:54 +0000 (18:04 +0000)]
Use MDBuilder to help with metadata creation.

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

12 years agoUse forward declarations for ASTDeclContextNameLookupTable and add a missing delete.
Benjamin Kramer [Sun, 15 Apr 2012 12:36:49 +0000 (12:36 +0000)]
Use forward declarations for ASTDeclContextNameLookupTable and add a missing delete.

It would be nice to use OwningPtr here, but DeclContextInfo is stored in a DenseMap.

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

12 years agoActually, this tree isn't necessarily binary.
Benjamin Kramer [Sun, 15 Apr 2012 11:35:18 +0000 (11:35 +0000)]
Actually, this tree isn't necessarily binary.

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

12 years agoRecursively delete rewrite rope nodes when tearing down the tree.
Benjamin Kramer [Sun, 15 Apr 2012 11:09:40 +0000 (11:09 +0000)]
Recursively delete rewrite rope nodes when tearing down the tree.

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

12 years ago%clang -cc1 -> %clang_cc1
Seth Cantrell [Sun, 15 Apr 2012 04:41:49 +0000 (04:41 +0000)]
%clang -cc1 -> %clang_cc1

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

12 years agoPR12226: don't generate wrong code if a braced string literal is used to
Richard Smith [Sun, 15 Apr 2012 02:50:59 +0000 (02:50 +0000)]
PR12226: don't generate wrong code if a braced string literal is used to
initialize an array of unsigned char. Outside C++11 mode, this bug was benign,
and just resulted in us emitting a constant which was double the required
length, padded with 0s. In C++11, it resulted in us generating an array whose
first element was something like  i8 ptrtoint ([n x i8]* @str to i8).

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

12 years agoobjective-c modern translator: Make metadata
Fariborz Jahanian [Sat, 14 Apr 2012 17:13:08 +0000 (17:13 +0000)]
objective-c modern translator: Make metadata
definition for protocols static. // rdar://11248048

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

12 years ago[analyzer] Add .cxx and .txx as known file extensions to ccc-analyzer.
Anna Zaks [Sat, 14 Apr 2012 16:30:00 +0000 (16:30 +0000)]
[analyzer]  Add .cxx and .txx as known file extensions to ccc-analyzer.

A patch by Sean McBride.

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

12 years agoConsider visibility attributes last, so that they take precedence.
Rafael Espindola [Sat, 14 Apr 2012 15:21:19 +0000 (15:21 +0000)]
Consider visibility attributes last, so that they take precedence.
I am working on a cleaner fix, but this gets the case in PR12552 passing.

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

12 years agoReplace manual delete[] with OwningArrayPtr.
Benjamin Kramer [Sat, 14 Apr 2012 14:13:43 +0000 (14:13 +0000)]
Replace manual delete[] with OwningArrayPtr.

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

12 years agoDon't leak vtable thunks.
Benjamin Kramer [Sat, 14 Apr 2012 13:21:23 +0000 (13:21 +0000)]
Don't leak vtable thunks.

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

12 years agoDelete late parsed attributes instead of leaking them.
Benjamin Kramer [Sat, 14 Apr 2012 12:44:47 +0000 (12:44 +0000)]
Delete late parsed attributes instead of leaking them.

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

12 years agoRename "fpaccuracy" metadata to the more generic "fpmath". That's because I'm
Duncan Sands [Sat, 14 Apr 2012 12:37:26 +0000 (12:37 +0000)]
Rename "fpaccuracy" metadata to the more generic "fpmath".  That's because I'm
thinking of generalizing it to be able to specify other freedoms beyond accuracy
(such as that NaN's don't have to be respected).  I'd like the 3.1 release (the
first one with this metadata) to have the more generic name already rather than
having to auto-upgrade it in 3.2.

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

12 years agoParser: Don't manage TemplateAnnotationIds in a delayed cleanup pool.
Benjamin Kramer [Sat, 14 Apr 2012 12:14:03 +0000 (12:14 +0000)]
Parser: Don't manage TemplateAnnotationIds in a delayed cleanup pool.

Instead, make it the allocation function's responsibility to add them
to a list and clear it when a top-level decl is finished.

This plugs leakage of TemplateAnnotationIds. DelayedCleanupPool is
ugly and unused, remove it.

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

12 years agoASTUnit: Don't clone the new DiagnosticConsumer, causing it to get leaked.
Benjamin Kramer [Sat, 14 Apr 2012 09:11:56 +0000 (09:11 +0000)]
ASTUnit: Don't clone the new DiagnosticConsumer, causing it to get leaked.

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

12 years agoc-index-test: dispose spelling string after use.
Benjamin Kramer [Sat, 14 Apr 2012 09:11:51 +0000 (09:11 +0000)]
c-index-test: dispose spelling string after use.

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

12 years agoDirectly store TypoResultsMaps in the TypoEditDistanceMap, getting rid of manual...
Benjamin Kramer [Sat, 14 Apr 2012 08:26:28 +0000 (08:26 +0000)]
Directly store TypoResultsMaps in the TypoEditDistanceMap, getting rid of manual deletion.

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

12 years agoAdd an AttributedStmt type to represent a statement with C++11 attributes
Richard Smith [Sat, 14 Apr 2012 00:33:13 +0000 (00:33 +0000)]
Add an AttributedStmt type to represent a statement with C++11 attributes
attached. Since we do not support any attributes which appertain to a statement
(yet), testing of this is necessarily quite minimal.

Patch by Alexander Kornienko!

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

12 years agoDelete the TypoResultsMap when erasing the pointer to it.
Benjamin Kramer [Fri, 13 Apr 2012 23:09:10 +0000 (23:09 +0000)]
Delete the TypoResultsMap when erasing the pointer to it.

This manual deleting is error-prone, but we can't just put an OwningPtr in a
std::map :(

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

12 years agoDon't enter cleanups for unreachable variables. It's impossible to
John McCall [Fri, 13 Apr 2012 18:44:05 +0000 (18:44 +0000)]
Don't enter cleanups for unreachable variables.  It's impossible to
jump into these scopes, and the cleanup-entering code sometimes wants
to do some operations first (e.g. a GEP), which can leave us with
unparented IR.

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

12 years agomodern objective-c translator: Fixes translation of
Fariborz Jahanian [Fri, 13 Apr 2012 18:00:54 +0000 (18:00 +0000)]
modern objective-c translator: Fixes translation of
__typeof which is a regression by reverting
r154360. // rdar://11233924

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

12 years agoAvoid string thrashing when we can concatenate them in the final buffer.
Benjamin Kramer [Fri, 13 Apr 2012 18:00:37 +0000 (18:00 +0000)]
Avoid string thrashing when we can concatenate them in the final buffer.

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

12 years agoSerialize and deserialize some missing bits from BlockDecl.
John McCall [Fri, 13 Apr 2012 17:33:29 +0000 (17:33 +0000)]
Serialize and deserialize some missing bits from BlockDecl.

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

12 years agoKill the last vestiges of clangIndex
Douglas Gregor [Fri, 13 Apr 2012 17:26:32 +0000 (17:26 +0000)]
Kill the last vestiges of clangIndex

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

12 years agoRemove clangIndex reference from clang-interpreter CMake build
Douglas Gregor [Fri, 13 Apr 2012 17:22:46 +0000 (17:22 +0000)]
Remove clangIndex reference from clang-interpreter CMake build

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

12 years agoRemove the unused, unmaintained, incomplete 'Index' library.
Douglas Gregor [Fri, 13 Apr 2012 16:31:46 +0000 (16:31 +0000)]
Remove the unused, unmaintained, incomplete 'Index' library.

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

12 years agomodern objective-c translator: When translating
Fariborz Jahanian [Fri, 13 Apr 2012 16:20:05 +0000 (16:20 +0000)]
modern objective-c translator: When translating
call to 'super' use __rw_objc_super as type of the
'super' meta-data instead of objc_super.
// rdar://11239894

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

12 years agoMake control flow more explicit for rebuilding property reference expressions without...
Douglas Gregor [Fri, 13 Apr 2012 16:05:42 +0000 (16:05 +0000)]
Make control flow more explicit for rebuilding property reference expressions without their OpaqueValueExprs

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

12 years agoRemove the -cc1-level option "-pubnames-dump". Such things should stay
Douglas Gregor [Fri, 13 Apr 2012 16:03:00 +0000 (16:03 +0000)]
Remove the -cc1-level option "-pubnames-dump". Such things should stay
out of the tree and use the tooling infrastructure.

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

12 years agosuper and class property reference expressions don't need to be
Douglas Gregor [Fri, 13 Apr 2012 15:53:08 +0000 (15:53 +0000)]
super and class property reference expressions don't need to be
rebuilt. Fixes <rdar://problem/11052352>.

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

12 years agoFirst set of tests for ARM homogenous aggregates. C only. C++ will follow.
Anton Korobeynikov [Fri, 13 Apr 2012 11:23:39 +0000 (11:23 +0000)]
First set of tests for ARM homogenous aggregates. C only. C++ will follow.

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

12 years agoStep forward with supporting of ARM homogenous aggregates:
Anton Korobeynikov [Fri, 13 Apr 2012 11:22:00 +0000 (11:22 +0000)]
Step forward with supporting of ARM homogenous aggregates:
  - Handle unions
  - Handle C++ classes

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

12 years agoImplement __atomic_fetch_nand and __atomic_nand_fetch to complete our set of
Richard Smith [Fri, 13 Apr 2012 06:31:38 +0000 (06:31 +0000)]
Implement __atomic_fetch_nand and __atomic_nand_fetch to complete our set of
GNU __atomic builtins.

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

12 years agoPR12500: Improve the wording of the diagnostic for a redefinition of a name
Richard Smith [Fri, 13 Apr 2012 04:07:40 +0000 (04:07 +0000)]
PR12500: Improve the wording of the diagnostic for a redefinition of a name
in the wrong namespace scope. Patch by Jonathan Sauer!

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

12 years agoSupport -Wc++98-compat-pedantic as requested:
Seth Cantrell [Fri, 13 Apr 2012 03:43:23 +0000 (03:43 +0000)]
Support -Wc++98-compat-pedantic as requested:

http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20120409/056126.html

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

12 years agoall-std-headers.cpp: Include the C++11 headers when building with clang
Richard Smith [Fri, 13 Apr 2012 03:39:16 +0000 (03:39 +0000)]
all-std-headers.cpp: Include the C++11 headers when building with clang
in -std=gnu++11 mode.

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

12 years agoFix a trivial oversight with apple-kext static local destructors
John McCall [Fri, 13 Apr 2012 02:53:27 +0000 (02:53 +0000)]
Fix a trivial oversight with apple-kext static local destructors
and add a test case.

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

12 years agoMention atomics support in the release notes.
Richard Smith [Fri, 13 Apr 2012 01:24:35 +0000 (01:24 +0000)]
Mention atomics support in the release notes.
Thanks to Nico Weber for the suggestion.

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

12 years agoWhen we're flagging a protected scope to prevent jumps into the
John McCall [Fri, 13 Apr 2012 01:08:17 +0000 (01:08 +0000)]
When we're flagging a protected scope to prevent jumps into the
shadow of a block expression with non-trivial destructed cleanups,
we should flag that in the enclosing function, not in the block
that we're about to pop.

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

12 years agoNow that we provide sufficient support for three C11/C++11 atomics
Richard Smith [Fri, 13 Apr 2012 01:02:19 +0000 (01:02 +0000)]
Now that we provide sufficient support for three C11/C++11 atomics
implementations, mark the atomics-related parts of the C++11 status page
as done. I've not marked 'Strong Compare and Exchange' done, since although
we implement supporting builtins, we don't yet produce different code for
the weak and strong forms.

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

12 years agoC++11 no longer requires files to end with a newline
Seth Cantrell [Fri, 13 Apr 2012 01:00:34 +0000 (01:00 +0000)]
C++11 no longer requires files to end with a newline

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

12 years agoImplement the missing pieces needed to support libstdc++4.7's <atomic>:
Richard Smith [Fri, 13 Apr 2012 00:45:38 +0000 (00:45 +0000)]
Implement the missing pieces needed to support libstdc++4.7's <atomic>:
__atomic_test_and_set, __atomic_clear, plus a pile of undocumented __GCC_*
predefined macros.

Implement library fallback for __atomic_is_lock_free and
__c11_atomic_is_lock_free, and implement __atomic_always_lock_free.

Contrary to their documentation, GCC's __atomic_fetch_add family don't
multiply the operand by sizeof(T) when operating on a pointer type.
libstdc++ relies on this quirk. Remove this handling for all but the
__c11_atomic_fetch_add and __c11_atomic_fetch_sub builtins.

Contrary to their documentation, __atomic_test_and_set and __atomic_clear
take a first argument of type 'volatile void *', not 'void *' or 'bool *',
and __atomic_is_lock_free and __atomic_always_lock_free have an argument
of type 'const volatile void *', not 'void *'.

With this change, libstdc++4.7's <atomic> passes libc++'s atomic test suite,
except for a couple of libstdc++ bugs and some cases where libc++'s test
suite tests for properties which implementations have latitude to vary.

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

12 years agoobjective-c modern translator: beautify rewrite of
Fariborz Jahanian [Thu, 12 Apr 2012 23:52:52 +0000 (23:52 +0000)]
objective-c modern translator: beautify rewrite of
struct __rw_objc_super; no functionality change.

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

12 years agoConfig.h: Add another definition which the Darwin build (sometimes) uses.
Daniel Dunbar [Thu, 12 Apr 2012 23:19:46 +0000 (23:19 +0000)]
Config.h: Add another definition which the Darwin build (sometimes) uses.

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

12 years agoWarn on 64-to-32 for source value of x bits where 64 >= x > 32.
David Blaikie [Thu, 12 Apr 2012 22:40:54 +0000 (22:40 +0000)]
Warn on 64-to-32 for source value of x bits where 64 >= x > 32.

The codepath already only works for source bits > target bits, it's just that
it was testing for the source expr bits to be exactly 64. This meant simple
cases (int i = x_long / 2) were missed & ended up under the general
-Wconversion warning, which a user might not have enabled.

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

12 years ago[analyzer] PCH deserialization optimization.
Anna Zaks [Thu, 12 Apr 2012 22:36:48 +0000 (22:36 +0000)]
[analyzer] PCH deserialization optimization.

We should not deserialize unused declarations from the PCH file. Achieve
this by storing the top level declarations during parsing
(HandleTopLevelDecl ASTConsumer callback) and analyzing/building a call
graph only for those.

Tested the patch on a sample ObjC file that uses PCH. With the patch,
 the analyzes is 17.5% faster and clang consumes 40% less memory.
Got about 10% overall build/analyzes time decrease on a large Objective
C project.

A bit of CallGraph refactoring/cleanup as well..

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

12 years ago[analyzer] Test case for r154451 (redefining system functions).
Anna Zaks [Thu, 12 Apr 2012 22:36:43 +0000 (22:36 +0000)]
[analyzer] Test case for r154451 (redefining system functions).

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

12 years agoobjective-c literals: Issue warning and ignore
Fariborz Jahanian [Thu, 12 Apr 2012 21:24:56 +0000 (21:24 +0000)]
objective-c literals: Issue warning and ignore
when BOOL is not of an intergal type when
boolean literals are used. // rdar://11231426

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

12 years agos/isAtomicConversion/tryAtomicConversion/g, per Jordy's suggestion.
Douglas Gregor [Thu, 12 Apr 2012 20:48:09 +0000 (20:48 +0000)]
s/isAtomicConversion/tryAtomicConversion/g, per Jordy's suggestion.

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

12 years agoFix some i1/i8 confusion within _Atomic(bool) in IR generation, both
Douglas Gregor [Thu, 12 Apr 2012 20:42:30 +0000 (20:42 +0000)]
Fix some i1/i8 confusion within _Atomic(bool) in IR generation, both
in general (such an atomic has boolean representation) and
specifically for IR generation of __c11_atomic_init. The latter also
means actually using initialization semantics for this initialization,
rather than just creating a store.

On a related note, make sure we actually put in non-atomic-to-atomic
conversions when performing an implicit conversion sequence. IR
generation is far too kind here, but we still want the ASTs to make
sense.

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

12 years agoInclude lambda capture init expressions in CFG.
Ted Kremenek [Thu, 12 Apr 2012 20:34:52 +0000 (20:34 +0000)]
Include lambda capture init expressions in CFG.

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

12 years agoAdd -Wuninitialized test for C++11 lambdas.
Ted Kremenek [Thu, 12 Apr 2012 20:03:47 +0000 (20:03 +0000)]
Add -Wuninitialized test for C++11 lambdas.

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

12 years agoFix CFGBuilder to not include the body of a LambdaExpr in the CFG of the enclosing...
Ted Kremenek [Thu, 12 Apr 2012 20:03:44 +0000 (20:03 +0000)]
Fix CFGBuilder to not include the body of a LambdaExpr in the CFG of the enclosing function.

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

12 years agoMIPS: Initialize MIPS CPU's name by default value.
Simon Atanasyan [Thu, 12 Apr 2012 19:59:24 +0000 (19:59 +0000)]
MIPS: Initialize MIPS CPU's name by default value.
Otherwise MipsTargetInfoBase::getDefaultFeatures() might return an invalid
features set with an empty feature name.

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

12 years agoCompute standard conversion sequences for conversions to atomic
Douglas Gregor [Thu, 12 Apr 2012 17:51:55 +0000 (17:51 +0000)]
Compute standard conversion sequences for conversions to atomic
types. The second and third conversions in the sequence are based on
the conversion for the underlying type, so that we get sensible
overloading behavior for, e.g., _Atomic(int) vs. _Atomic(float).

As part of this, actually implement the lvalue-to-rvalue conversion
for atomic types. There is probably a pile of code in SemaExpr that
can now be deleted, but I haven't tracked it down yet.

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

12 years agoobjective-c numeric literal: type of boolean is
Fariborz Jahanian [Thu, 12 Apr 2012 17:49:18 +0000 (17:49 +0000)]
objective-c numeric literal: type of boolean is
that of typedef BOOL if found.
// rdar://11231426

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

12 years agomodern objective-c translator. ifdef'out
Fariborz Jahanian [Thu, 12 Apr 2012 16:33:31 +0000 (16:33 +0000)]
modern objective-c translator. ifdef'out
__weak and __block when rewriting.
// rdar://11236342

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

12 years agoFix the signatures for the _mm256_storeu2_* intrinsics.
Chad Rosier [Thu, 12 Apr 2012 16:29:08 +0000 (16:29 +0000)]
Fix the signatures for the _mm256_storeu2_* intrinsics.
PR12532

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

12 years agoChanged all direct calls to CompletionConsumer.reset(..) to go call
Erik Verbruggen [Thu, 12 Apr 2012 10:31:12 +0000 (10:31 +0000)]
Changed all direct calls to CompletionConsumer.reset(..) to go call
CompilerInstance::setCodeCompletionConsumer instead, in order to change
the SkipFunctionBodies flag accordingly. Also fixed
setCodeCompletionConsumer to take a reset() to null into account.

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

12 years agoAdded a flag to the parser to skip method bodies.
Erik Verbruggen [Thu, 12 Apr 2012 10:11:59 +0000 (10:11 +0000)]
Added a flag to the parser to skip method bodies.

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

12 years agoThere's some code in the PCH reader that looks like it's needlessly complex, but
Nick Lewycky [Thu, 12 Apr 2012 07:56:21 +0000 (07:56 +0000)]
There's some code in the PCH reader that looks like it's needlessly complex, but
turns out that it's actually needed for C++ modules support. Since simplifying
it didn't cause any test failures, I'll add a test for it.

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

12 years agoImplement support for 18 of the GNU-compatible __atomic builtins.
Richard Smith [Thu, 12 Apr 2012 05:08:17 +0000 (05:08 +0000)]
Implement support for 18 of the GNU-compatible __atomic builtins.

This is not quite sufficient for libstdc++'s <atomic>: we still need
__atomic_test_and_set and __atomic_clear, and may need a more complete
__atomic_is_lock_free implementation.

We are also missing an implementation of __atomic_always_lock_free,
__atomic_nand_fetch, and __atomic_fetch_nand, but those aren't needed
for libstdc++.

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

12 years agoThese functions too have no prototypes. Audited the rest of Sema for
Eric Christopher [Thu, 12 Apr 2012 02:16:49 +0000 (02:16 +0000)]
These functions too have no prototypes. Audited the rest of Sema for
FunctionDecl::Create calls as well.

rdar://11079003

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

12 years agoTestcase for previous commit.
Eric Christopher [Thu, 12 Apr 2012 00:36:10 +0000 (00:36 +0000)]
Testcase for previous commit.

rdar://11079003

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

12 years agostatic functions have a need for mangled name debug information too.
Eric Christopher [Thu, 12 Apr 2012 00:35:06 +0000 (00:35 +0000)]
static functions have a need for mangled name debug information too.
The mangler doesn't like non-prototyped functions so only use a mangled
name for prototyped functions.

rdar://11079003

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

12 years agoThe copy and destroy helper functions aren't prototyped, don't call them
Eric Christopher [Thu, 12 Apr 2012 00:35:04 +0000 (00:35 +0000)]
The copy and destroy helper functions aren't prototyped, don't call them
so.

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

12 years agoImplement clang_getDiagnosticCategoryText() to provide a way for a client of libclang...
Ted Kremenek [Thu, 12 Apr 2012 00:03:31 +0000 (00:03 +0000)]
Implement clang_getDiagnosticCategoryText() to provide a way for a client of libclang to accurately
get the diagnostic category name from a serialized diagnostic when the version of libclang used
to read the diagnostic file is newer than the clang that emitted the diagnostic file.

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

12 years agomodern objective-c translator. Fixes a mis-translation when
Fariborz Jahanian [Wed, 11 Apr 2012 23:57:12 +0000 (23:57 +0000)]
modern objective-c translator. Fixes a mis-translation when
of a __block struct object. // rdar://11230308

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

12 years agoAdd test for a construct we currently reject, constant-evaluating a load from a const...
Eli Friedman [Wed, 11 Apr 2012 23:32:29 +0000 (23:32 +0000)]
Add test for a construct we currently reject, constant-evaluating a load from a constant string.  Given that gcc doesn't accept this, we should continue to not accept it, even though it was accidentally supported by clang for a brief period.

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

12 years ago[analyzer] Another dynamic_cast false positive/negative.
Anna Zaks [Wed, 11 Apr 2012 22:29:38 +0000 (22:29 +0000)]
[analyzer] Another dynamic_cast false positive/negative.

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