]> granicus.if.org Git - clang/log
clang
13 years agoDon't add type names for enums; they're never used in LLVM IR.
Anders Carlsson [Wed, 20 Apr 2011 23:51:43 +0000 (23:51 +0000)]
Don't add type names for enums; they're never used in LLVM IR.

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

13 years agofix a crash on code that uses the result value of __builtin___memcpy_chk.
Chris Lattner [Wed, 20 Apr 2011 23:14:50 +0000 (23:14 +0000)]
fix a crash on code that uses the result value of __builtin___memcpy_chk.

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

13 years agoRemove __builtin_ia32_loadup[sd] since clang can represent the actions natively.
Bill Wendling [Wed, 20 Apr 2011 23:10:45 +0000 (23:10 +0000)]
Remove __builtin_ia32_loadup[sd] since clang can represent the actions natively.

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

13 years agoWhen translating a Clang source range into a libclang source range,
Douglas Gregor [Wed, 20 Apr 2011 21:16:21 +0000 (21:16 +0000)]
When translating a Clang source range into a libclang source range,
adjust the a ending macro location to the end of the instantiation
location before adjusting it to the end of the token. Fixes
<rdar://problem/9021561>.

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

13 years agoPTX: Add PTX intrinsics as builtins and add ptx32 and ptx64 as valid architectures...
Justin Holewinski [Wed, 20 Apr 2011 19:34:15 +0000 (19:34 +0000)]
PTX: Add PTX intrinsics as builtins and add ptx32 and ptx64 as valid architectures for triples, e.g. ptx32-unknown-unknown

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

13 years agoImprove test case from prior commit ever so slightly
Douglas Gregor [Wed, 20 Apr 2011 18:20:33 +0000 (18:20 +0000)]
Improve test case from prior commit ever so slightly

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

13 years agoFix a crash-on-invalid involving non-identifier names in a member
Douglas Gregor [Wed, 20 Apr 2011 18:19:55 +0000 (18:19 +0000)]
Fix a crash-on-invalid involving non-identifier names in a member
access expression that appears to be a property reference. Fixes
<rdar://problem/8985943>.

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

13 years agoGive invalid tag types 8-bit size and alignment, rather than 1-bit
Douglas Gregor [Wed, 20 Apr 2011 17:29:44 +0000 (17:29 +0000)]
Give invalid tag types 8-bit size and alignment, rather than 1-bit
alignment, which causes traps further down the line. Fixes
<rdar://problem/9109755>, which contains a test case far too large to
commit :(

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

13 years agoEliminate an uninteresting assertion; invalid code involving
Douglas Gregor [Wed, 20 Apr 2011 17:22:00 +0000 (17:22 +0000)]
Eliminate an uninteresting assertion; invalid code involving
out-of-line destructors can result in the addition of redundant
destructors to a class. It's not harmful to the AST. Fixes
<rdar://problem/9158632>.

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

13 years agoRename 'CXTUMemoryUsage…' to 'CXTUResourceUsage…'.
Ted Kremenek [Wed, 20 Apr 2011 16:41:07 +0000 (16:41 +0000)]
Rename 'CXTUMemoryUsage…' to 'CXTUResourceUsage…'.

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

13 years agoUse S.str() to force a flush.
Fariborz Jahanian [Wed, 20 Apr 2011 16:38:37 +0000 (16:38 +0000)]
Use S.str() to force a flush.

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

13 years agoDriver: Suppress some additional warnings with -Qunused-arguments.
Daniel Dunbar [Wed, 20 Apr 2011 15:44:48 +0000 (15:44 +0000)]
Driver: Suppress some additional warnings with -Qunused-arguments.

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

13 years agoBe sure to flush raw_string_ostream objects in the Objective-C
Douglas Gregor [Wed, 20 Apr 2011 13:35:54 +0000 (13:35 +0000)]
Be sure to flush raw_string_ostream objects in the Objective-C
rewriter, from Eric Niebler!

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

13 years agoTeach SourceManager::getSLocEntry() that it can fail due to problems
Douglas Gregor [Wed, 20 Apr 2011 00:21:03 +0000 (00:21 +0000)]
Teach SourceManager::getSLocEntry() that it can fail due to problems
during deserialization from  a precompiled header, and update all of
its callers to note when this problem occurs and recover (more)
gracefully. Fixes <rdar://problem/9119249>.

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

13 years agoTWEAK
Daniel Dunbar [Tue, 19 Apr 2011 23:34:21 +0000 (23:34 +0000)]
TWEAK

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

13 years agoDriver/Darwin: Switch to using -macosx for OS name in triples.
Daniel Dunbar [Tue, 19 Apr 2011 23:34:17 +0000 (23:34 +0000)]
Driver/Darwin: Switch to using -macosx for OS name in triples.

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

13 years agoIRgen/ARM: Fix a think-o in conversion-to-null for member function pointers, we
Daniel Dunbar [Tue, 19 Apr 2011 23:10:47 +0000 (23:10 +0000)]
IRgen/ARM: Fix a think-o in conversion-to-null for member function pointers, we
were computing the conversion as (ptr != 0 && non-virtual), when it should be
(ptr != 0 || is-virtual).
 - Test to follow in LLVM test-suite.

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

13 years agosome cleanups to use IRBuilder methods instead of llvm:: foo methods.
Chris Lattner [Tue, 19 Apr 2011 22:55:03 +0000 (22:55 +0000)]
some cleanups to use IRBuilder methods instead of llvm:: foo methods.

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

13 years agoDriver/Darwin: Switch to using new style triples.
Daniel Dunbar [Tue, 19 Apr 2011 21:45:47 +0000 (21:45 +0000)]
Driver/Darwin: Switch to using new style triples.

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

13 years agoADT/Triple: Switch to using .isOSDarwin() predicate.
Daniel Dunbar [Tue, 19 Apr 2011 21:43:27 +0000 (21:43 +0000)]
ADT/Triple: Switch to using .isOSDarwin() predicate.

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

13 years agoAvoid superfluous warning after an error is detcted and reported.
Fariborz Jahanian [Tue, 19 Apr 2011 21:42:37 +0000 (21:42 +0000)]
Avoid superfluous warning after an error is detcted and reported.
// rdar://9132143

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

13 years agoBasic/Darwin: Add support for new -osx and -ios style triples (not yet used).
Daniel Dunbar [Tue, 19 Apr 2011 21:40:34 +0000 (21:40 +0000)]
Basic/Darwin: Add support for new -osx and -ios style triples (not yet used).

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

13 years agouse the newly introduced IRBuilder getInt() method to reduce some
Chris Lattner [Tue, 19 Apr 2011 20:53:45 +0000 (20:53 +0000)]
use the newly introduced IRBuilder getInt() method to reduce some
redundancy pointed out by John.

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

13 years agoWe regard a function as 'unused' from the codegen perspective, so our warnings diverg...
Argyrios Kyrtzidis [Tue, 19 Apr 2011 19:51:10 +0000 (19:51 +0000)]
We regard a function as 'unused' from the codegen perspective, so our warnings diverge from
gcc's unused warnings which don't get emitted if the function is referenced even in an unevaluated context
(e.g. in templates, sizeof, etc.). Also, saying that a function is 'unused' because it won't get codegen'ed
is somewhat misleading.

- Don't emit 'unused' warnings for functions that are referenced in any part of the user's code.
- A warning that an internal function/variable won't get emitted is useful though, so introduce
  -Wunneeded-internal-declaration which will warn if a function/variable with internal linkage is not
  "needed" ('used' from the codegen perspective), e.g:

  static void foo() { }

  template <int>
  void bar() {
    foo();
  }

test.cpp:1:13: warning: function 'foo' is not needed and will not be emitted
static void foo() { }
            ^

Addresses rdar://8733476.

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

13 years agoAdd a new expression classification, CL_AddressableVoid
Peter Collingbourne [Tue, 19 Apr 2011 18:51:51 +0000 (18:51 +0000)]
Add a new expression classification, CL_AddressableVoid

CL_AddressableVoid is the expression classification used for void
expressions whose address can be taken, i.e. the result of [], *
or void variable references in C, as opposed to things like the
result of a void function call.

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

13 years agoAdd missing break statements.
Ted Kremenek [Tue, 19 Apr 2011 04:36:17 +0000 (04:36 +0000)]
Add missing break statements.

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

13 years agoMake the VariadicMethodTypeChecker accept block pointers as Objective-C pointers...
Anders Carlsson [Tue, 19 Apr 2011 01:16:46 +0000 (01:16 +0000)]
Make the VariadicMethodTypeChecker accept block pointers as Objective-C pointers. Fixes PR9746.

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

13 years agoFix line endings
Matt Beaumont-Gay [Tue, 19 Apr 2011 00:23:31 +0000 (00:23 +0000)]
Fix line endings

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

13 years agoDriver/Darwin: Change to use generic iOS runtime library, which we now always need.
Daniel Dunbar [Mon, 18 Apr 2011 23:48:36 +0000 (23:48 +0000)]
Driver/Darwin: Change to use generic iOS runtime library, which we now always need.

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

13 years agoReport memory usage for global code completion results in CXTUMemoryUsage.
Ted Kremenek [Mon, 18 Apr 2011 23:42:53 +0000 (23:42 +0000)]
Report memory usage for global code completion results in CXTUMemoryUsage.

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

13 years agoUnbreak the MSVC build: Don't mix variable declarations and statements in a .c file.
Francois Pichet [Mon, 18 Apr 2011 23:33:22 +0000 (23:33 +0000)]
Unbreak the MSVC build: Don't mix variable declarations and statements in a .c file.

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

13 years agoAdd libclang API to query how much memory is used by a CXTranslationUnit. This is...
Ted Kremenek [Mon, 18 Apr 2011 22:47:10 +0000 (22:47 +0000)]
Add libclang API to query how much memory is used by a CXTranslationUnit.  This is a WIP.  Currently we report
the amount used for expressions, types, identifiers, and selectors.

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

13 years agoAdd ASTContext::getTotalMemory() to allow clients to query how much memory is bump...
Ted Kremenek [Mon, 18 Apr 2011 22:47:07 +0000 (22:47 +0000)]
Add ASTContext::getTotalMemory() to allow clients to query how much memory is bump allocated for declarations, statements, and types.

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

13 years agoAdd SelectorTable::getTotalMemory() to allow clients to query how much memory is...
Ted Kremenek [Mon, 18 Apr 2011 22:47:04 +0000 (22:47 +0000)]
Add SelectorTable::getTotalMemory() to allow clients to query how much memory is used by selectors.

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

13 years agoDriver/Darwin: Disable movw/movt with -mkernel or -fapple-kext.
Daniel Dunbar [Mon, 18 Apr 2011 21:26:42 +0000 (21:26 +0000)]
Driver/Darwin: Disable movw/movt with -mkernel or -fapple-kext.

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

13 years agoFix a bug in calculation of composite type
Fariborz Jahanian [Mon, 18 Apr 2011 21:16:59 +0000 (21:16 +0000)]
Fix a bug in calculation of composite type
of conditional expressions of objc pointer types
where one type is the immediate base type of the
other. // rdar://9296866

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

13 years agoDriver: Support -fno-lto.
Daniel Dunbar [Mon, 18 Apr 2011 19:44:09 +0000 (19:44 +0000)]
Driver: Support -fno-lto.

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

13 years agoAdd ToolChain path support for linker on Slackware.
Ted Kremenek [Mon, 18 Apr 2011 17:50:19 +0000 (17:50 +0000)]
Add ToolChain path support for linker on Slackware.

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

13 years agoFix typo in comment.
Devang Patel [Mon, 18 Apr 2011 17:30:25 +0000 (17:30 +0000)]
Fix typo in comment.

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

13 years agoFix PR9741. The implicit declarations created for range-based for loops weren't being...
Richard Smith [Mon, 18 Apr 2011 15:49:25 +0000 (15:49 +0000)]
Fix PR9741. The implicit declarations created for range-based for loops weren't being added to the DeclContext (nor were they being marked as implicit). Also, the declarations were being emitted in the wrong order when building the CFG.

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

13 years agoWhen providing code completions of ivar names for a property
Douglas Gregor [Mon, 18 Apr 2011 14:40:46 +0000 (14:40 +0000)]
When providing code completions of ivar names for a property
implementation such as

  @synthesize Prop1 =

Give priority to ivars whose type matches or closely matches the
property type (as we do for several other kinds of
results). Additionally, if there is an ivar with the same name as the
property, or differs only due to a _ prefix or suffix, give that ivar
a priority bump. Finally, verify that this search is properly
returning ivars within class extensions and implementations
(<rdar://problem/8488854>).

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

13 years agoGet rid of std::vector usage when getting function types in CGException.cpp
Anders Carlsson [Mon, 18 Apr 2011 14:24:10 +0000 (14:24 +0000)]
Get rid of std::vector usage when getting function types in CGException.cpp

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

13 years agoWhen producing code completion results for the Objective-C property
Douglas Gregor [Mon, 18 Apr 2011 14:13:53 +0000 (14:13 +0000)]
When producing code completion results for the Objective-C property
implementation

  @synthesize <property> =

also produce a completion for a to-be-synthesized ivar named
_<property>.

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

13 years agoClean up code generation of typeid expressions and add C++ standard references.
Anders Carlsson [Mon, 18 Apr 2011 00:57:03 +0000 (00:57 +0000)]
Clean up code generation of typeid expressions and add C++ standard references.

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

13 years agoPut a typeid test in its own namespace.
Anders Carlsson [Sun, 17 Apr 2011 23:33:40 +0000 (23:33 +0000)]
Put a typeid test in its own namespace.

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

13 years agoFix a miscompilation I introduced in r129652, thanks for Eli for tracking
Chris Lattner [Sun, 17 Apr 2011 23:21:26 +0000 (23:21 +0000)]
Fix a miscompilation I introduced in r129652, thanks for Eli for tracking
it down.  we effectively were compile the testcase into:

void test14(int x) {
  switch (x) {
    case 11: break;
    case 42: test14(97);  // fallthrough
    default: test14(42); break;

which is not the same thing at all.  This fixes a miscompilation of
MallocBench/gs seen on the clang-x86_64-linux-fnt buildbot.

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

13 years agoUse the right type name.
Anders Carlsson [Sun, 17 Apr 2011 21:57:29 +0000 (21:57 +0000)]
Use the right type name.

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

13 years agoWhen laying out bases in, always try the "base subobject" LLVM type. If it
Anders Carlsson [Sun, 17 Apr 2011 21:56:13 +0000 (21:56 +0000)]
When laying out bases in, always try the "base subobject" LLVM type. If it
turns out that a field or base needs to be laid out in the tail padding of
the base, CGRecordLayoutBuilder::ResizeLastBaseFieldIfNecessary will convert
it to an array of i8.

I've audited the new test results to make sure that they are still valid. I've
also verified that we pass a self-host with this change.

This (finally) fixes PR5589!

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

13 years agoCleanup tests, no functionality change.
Anders Carlsson [Sun, 17 Apr 2011 21:49:47 +0000 (21:49 +0000)]
Cleanup tests, no functionality change.

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

13 years agoAdd addBaseSubobjectTypeName which isn't used yet.
Anders Carlsson [Sun, 17 Apr 2011 21:40:34 +0000 (21:40 +0000)]
Add addBaseSubobjectTypeName which isn't used yet.

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

13 years agoMove code to add a type name to a TagDecl type out into a helper function. No functio...
Anders Carlsson [Sun, 17 Apr 2011 21:36:59 +0000 (21:36 +0000)]
Move code to add a type name to a TagDecl type out into a helper function. No functionality change.

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

13 years agoUse a SmallVector for field types in CGRecordLayoutBuilder now that llvm::StructType...
Anders Carlsson [Sun, 17 Apr 2011 21:32:41 +0000 (21:32 +0000)]
Use a SmallVector for field types in CGRecordLayoutBuilder now that llvm::StructType::get takes an ArrayRef.

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

13 years agoMake -mno-mmx imply -mno-3dnow. This is what gcc does, and it makes sense.
Michael J. Spencer [Sun, 17 Apr 2011 19:22:03 +0000 (19:22 +0000)]
Make -mno-mmx imply -mno-3dnow. This is what gcc does, and it makes sense.
Also, fold the sse4 and sse4.1 cases together.

Patch by Alexander Best!

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

13 years agowhen assertions are disabled, labels go away. Hopefully fixes the windows build.
Chris Lattner [Sun, 17 Apr 2011 16:19:57 +0000 (16:19 +0000)]
when assertions are disabled, labels go away.  Hopefully fixes the windows build.

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

13 years agoHack to turn the valgrind buildbot green, until Devang can address it
Eli Friedman [Sun, 17 Apr 2011 06:40:15 +0000 (06:40 +0000)]
Hack to turn the valgrind buildbot green, until Devang can address it
properly.

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

13 years agoimplement rdar://9289524 - case followed immediately by break results in empty IR...
Chris Lattner [Sun, 17 Apr 2011 00:54:30 +0000 (00:54 +0000)]
implement rdar://9289524 - case followed immediately by break results in empty IR block,
a -O0 code quality issue.

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

13 years agofold memcpy/set/move_chk to llvm.memcpy/set/move when the sizes
Chris Lattner [Sun, 17 Apr 2011 00:40:24 +0000 (00:40 +0000)]
fold memcpy/set/move_chk to llvm.memcpy/set/move when the sizes
are trivial.  This exposes opportunities earlier, and allows fastisel
to do good things with these at -O0.

This addresses rdar://9289468 - clang doesn't fold memset_chk at -O0

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

13 years agofix rdar://9289603 - clang should fold trivial ?: for enums as well as integer consta...
Chris Lattner [Sat, 16 Apr 2011 23:15:35 +0000 (23:15 +0000)]
fix rdar://9289603 - clang should fold trivial ?: for enums as well as integer constants into select at -O0
by making the isCheapEnoughToEvaluateUnconditionally predicate handle anything that folds to a constant.  In particular, we now fold enums.

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

13 years agoTesting my commit access. A few whitespace changes to Sema/SemaCXXCast.cpp.
Richard Trieu [Sat, 16 Apr 2011 01:09:30 +0000 (01:09 +0000)]
Testing my commit access.  A few whitespace changes to Sema/SemaCXXCast.cpp.

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

13 years agoIntroduce Rewriter::IncreaseIndentation() which increase indentations for the lines...
Argyrios Kyrtzidis [Sat, 16 Apr 2011 01:03:33 +0000 (01:03 +0000)]
Introduce Rewriter::IncreaseIndentation() which increase indentations for the lines between the given source range.
To determine what the indentation should be, a SourceLocation 'parentIndent' parameter is used that should be at
a source location with an indentation one degree lower than the given range.

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

13 years agoModify test for 32 and 64 bit.
Tanya Lattner [Sat, 16 Apr 2011 01:00:29 +0000 (01:00 +0000)]
Modify test for 32 and 64 bit.

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

13 years agoEmit proper selector name in debug info.
Devang Patel [Sat, 16 Apr 2011 00:37:51 +0000 (00:37 +0000)]
Emit proper selector name in debug info.

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

13 years agoEmit debug info for Objective-C properties.
Devang Patel [Sat, 16 Apr 2011 00:12:55 +0000 (00:12 +0000)]
Emit debug info for Objective-C properties.

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

13 years agoFix bug in vector initializer when initializing a vector with another vector.
Tanya Lattner [Fri, 15 Apr 2011 22:42:59 +0000 (22:42 +0000)]
Fix bug in vector initializer when initializing a vector with another vector.
Add test case.

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

13 years agoEnforce nonnull __attribute__ on Objective-C method calls.
Fariborz Jahanian [Fri, 15 Apr 2011 22:06:22 +0000 (22:06 +0000)]
Enforce nonnull __attribute__ on Objective-C method calls.
// rdar://9287695

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

13 years agoInitial work to improve documentation for Clang's diagnostics, from Matthieu Monrocq
Douglas Gregor [Fri, 15 Apr 2011 22:04:17 +0000 (22:04 +0000)]
Initial work to improve documentation for Clang's diagnostics, from Matthieu Monrocq

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

13 years agoFor the purposes of overload resolution, consider a conversion from an
Douglas Gregor [Fri, 15 Apr 2011 20:45:44 +0000 (20:45 +0000)]
For the purposes of overload resolution, consider a conversion from an
Objective-C pointer to void* as a "conversion to void*". This allows
us to prefer an Objective-C object pointer conversion to a superclass
object pointer over an Objective-C object pointer conversion to
cv-void*. Fixes PR9735.

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

13 years agoForbid the use of C++ new/delete to allocate/free objects within an
Douglas Gregor [Fri, 15 Apr 2011 19:46:20 +0000 (19:46 +0000)]
Forbid the use of C++ new/delete to allocate/free objects within an
address space. I could see that this functionality would be useful,
but not in its current form (where the address space is ignored):
rather, we'd want to encode the address space into the parameter list
passed to operator new/operator delete somehow, which would require a
bunch more semantic analysis.

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

13 years agoParse GNU-style attributes prior to the type-id/new-type-id in a C++
Douglas Gregor [Fri, 15 Apr 2011 19:40:02 +0000 (19:40 +0000)]
Parse GNU-style attributes prior to the type-id/new-type-id in a C++
"new" expression. This matches GCC's parser. Test is forthcoming.

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

13 years agoRestore accidentally deleted file (I blame svn).
Nick Lewycky [Fri, 15 Apr 2011 18:57:00 +0000 (18:57 +0000)]
Restore accidentally deleted file (I blame svn).

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

13 years agoFixes a crash when generating dependency file stuff
Fariborz Jahanian [Fri, 15 Apr 2011 18:49:23 +0000 (18:49 +0000)]
Fixes a crash when generating dependency file stuff
and output file is not writable. // rdar://9286457.

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

13 years agoReapply r129561, moving the runtime/Makefile that builds compiler-rt into
Nick Lewycky [Fri, 15 Apr 2011 18:33:24 +0000 (18:33 +0000)]
Reapply r129561, moving the runtime/Makefile that builds compiler-rt into
runtime/compiler-rt/Makefile paving the way to put multiple different libraries
into runtime/ and build all of them.

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

13 years agoDoug Gregor tells me that runtime/libcxx/ is a placeholder for stuff we never
Nick Lewycky [Fri, 15 Apr 2011 18:02:26 +0000 (18:02 +0000)]
Doug Gregor tells me that runtime/libcxx/ is a placeholder for stuff we never
did. Delete it.

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

13 years agoImplement appropriate semantics for C++ casting and conversion when
Douglas Gregor [Fri, 15 Apr 2011 17:59:54 +0000 (17:59 +0000)]
Implement appropriate semantics for C++ casting and conversion when
dealing with address-space- and GC-qualified pointers. Previously,
these qualifiers were being treated just like cvr-qualifiers (in some
cases) or were completely ignored, leading to uneven behavior. For
example, const_cast would allow conversion between pointers to
different address spaces.

The new semantics are fairly simple: reinterpret_cast can be used to
explicitly cast between pointers to different address spaces
(including adding/removing addresss spaces), while
static_cast/dynamic_cast/const_cast do not tolerate any changes in the
address space. C-style casts can add/remove/change address spaces
through the reinterpret_cast mechanism. Other non-CVR qualifiers
(e.g., Objective-C GC qualifiers) work similarly.

As part of this change, I tweaked the "casts away constness"
diagnostic to use the term "casts away qualifiers". The term
"constness" actually comes from the C++ standard, despite the fact
that removing "volatile" also falls under that category. In Clang, we
also have restrict, address spaces, ObjC GC attributes, etc., so the
more general "qualifiers" is clearer.

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

13 years agoRevert r129561, which broke one of the clang buildbots.
Owen Anderson [Fri, 15 Apr 2011 17:35:58 +0000 (17:35 +0000)]
Revert r129561, which broke one of the clang buildbots.

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

13 years agoAllow shadowin of 'self' in objc methods in
Fariborz Jahanian [Fri, 15 Apr 2011 17:04:42 +0000 (17:04 +0000)]
Allow shadowin of 'self' in objc methods in
cases where stand-alone ivar can be looked up
in shadowed object. To fix gcc compatibility
breakage. // rdar://9284603

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

13 years agoAdd __has_feature(cxx_range_for) check for C++11 range-based for loop.
Richard Smith [Fri, 15 Apr 2011 15:14:40 +0000 (15:14 +0000)]
Add __has_feature(cxx_range_for) check for C++11 range-based for loop.

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

13 years agoAdd mm3dnow.h.
Michael J. Spencer [Fri, 15 Apr 2011 15:11:21 +0000 (15:11 +0000)]
Add mm3dnow.h.

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

13 years agoAdd 3DNow! Intrinsics.
Michael J. Spencer [Fri, 15 Apr 2011 15:07:13 +0000 (15:07 +0000)]
Add 3DNow! Intrinsics.

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

13 years agoUpdate www: clang now supports C++11 for-range and non-template type aliases.
Richard Smith [Fri, 15 Apr 2011 14:38:27 +0000 (14:38 +0000)]
Update www: clang now supports C++11 for-range and non-template type aliases.

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

13 years agoSupport for C++11 (non-template) alias declarations.
Richard Smith [Fri, 15 Apr 2011 14:24:37 +0000 (14:24 +0000)]
Support for C++11 (non-template) alias declarations.

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

13 years agoTeach -ast-print how to print template template parameters.
Richard Smith [Fri, 15 Apr 2011 13:38:57 +0000 (13:38 +0000)]
Teach -ast-print how to print template template parameters.

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

13 years agoFix mismatched delete.
Benjamin Kramer [Fri, 15 Apr 2011 11:21:57 +0000 (11:21 +0000)]
Fix mismatched delete.

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

13 years agoApply NAKAMURA Takumi's workaround to fix thses tests on -Asserts build. The labels...
Richard Smith [Fri, 15 Apr 2011 10:12:39 +0000 (10:12 +0000)]
Apply NAKAMURA Takumi's workaround to fix thses tests on -Asserts build. The labels there are numbered, not named, and numbered labels are formatted differently.

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

13 years agoCreate a compiler-rt directory and move the Makefile to it. Add a makefile that
Nick Lewycky [Fri, 15 Apr 2011 06:57:32 +0000 (06:57 +0000)]
Create a compiler-rt directory and move the Makefile to it. Add a makefile that
builds the subdirs from this directory. This makes the behaviour with make match
what already happens with cmake.

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

13 years agoImprove diagnostics on GNU attributes by warning about attributes that should have...
Ted Kremenek [Fri, 15 Apr 2011 05:49:29 +0000 (05:49 +0000)]
Improve diagnostics on GNU attributes by warning about attributes that should have no arguments or parameters.  Patch by Michael Han!

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

13 years agofix a bunch of comment typos found by codespell. Patch by
Chris Lattner [Fri, 15 Apr 2011 05:22:18 +0000 (05:22 +0000)]
fix a bunch of comment typos found by codespell.  Patch by
Luis Felipe Strano Moraes!

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

13 years agoC1X: implement static asserts
Peter Collingbourne [Fri, 15 Apr 2011 00:35:57 +0000 (00:35 +0000)]
C1X: implement static asserts

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

13 years agoC1X: implement generic selections
Peter Collingbourne [Fri, 15 Apr 2011 00:35:48 +0000 (00:35 +0000)]
C1X: implement generic selections

As an extension, generic selection support has been added for all
supported languages.  The syntax is the same as for C1X.

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

13 years agoC1X: add a language standard
Peter Collingbourne [Fri, 15 Apr 2011 00:35:23 +0000 (00:35 +0000)]
C1X: add a language standard

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

13 years agoDo not expand the opencl pragma names. This is so you can also have a define named...
Tanya Lattner [Thu, 14 Apr 2011 23:35:31 +0000 (23:35 +0000)]
Do not expand the opencl pragma names. This is so you can also have a define named the samed as the pragma and they do not interfere (ie. cl_khr_fp64).

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

13 years agoIf the declaration of a C++ member function with an inline definition
Douglas Gregor [Thu, 14 Apr 2011 23:19:27 +0000 (23:19 +0000)]
If the declaration of a C++ member function with an inline definition
is so broken that Sema can't form a declaration for it, don't bother
trying to parse the definition later. Fixes <rdar://problem/9221993>.

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

13 years agoWhen we transform a C++ exception declaration (e.g., for template
Douglas Gregor [Thu, 14 Apr 2011 22:32:28 +0000 (22:32 +0000)]
When we transform a C++ exception declaration (e.g., for template
instantiation), be sure to add the transformed declaration into the
current DeclContext. Also, remove the -Wuninitialized hack that works
around this bug. Fixes <rdar://problem/9200676>.

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

13 years agoAdd support for C++0x's range-based for loops, as specified by the C++11 draft standa...
Richard Smith [Thu, 14 Apr 2011 22:09:26 +0000 (22:09 +0000)]
Add support for C++0x's range-based for loops, as specified by the C++11 draft standard (N3291).

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

13 years agoDetect when the string "<::" is found in code after a cast or template name and is...
Richard Smith [Thu, 14 Apr 2011 21:45:45 +0000 (21:45 +0000)]
Detect when the string "<::" is found in code after a cast or template name and is interpreted as "[:" because of the digraph "<:". When found, give an error with a fix-it to add whitespace between the "<" and "::".

Patch by Richard Trieu! Plus a small tweak from me to deal with one of the tokens coming from a macro.

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

13 years agoHarden Clang's cursor visitation logic against NULL declaration,
Douglas Gregor [Thu, 14 Apr 2011 21:41:34 +0000 (21:41 +0000)]
Harden Clang's cursor visitation logic against NULL declaration,
statement, and expression pointers. While these shouldn't happen, it's
better to be safe in libclang.

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

13 years agoMatch pointer of compatible vection types.
Fariborz Jahanian [Thu, 14 Apr 2011 20:33:36 +0000 (20:33 +0000)]
Match pointer of compatible vection types.
// rdar://9208404

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

13 years agoWhen determining the "usage" type of a declaration for the purposes of code
Douglas Gregor [Thu, 14 Apr 2011 20:33:34 +0000 (20:33 +0000)]
When determining the "usage" type of a declaration for the purposes of code
completion, look through block pointer and function pointer types to the
result type of the block/function. Fixes <rdar://problem/9282583>.

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

13 years agoImplement ARM pcs attribute. Basically it's another way of calling convention selecti...
Anton Korobeynikov [Thu, 14 Apr 2011 20:06:49 +0000 (20:06 +0000)]
Implement ARM pcs attribute. Basically it's another way of calling convention selection (AAPCS or
AAPCS+VFP), similar to fastcall / stdcall / whatevercall seen on x86.

In particular, all library functions should always be AAPCS regardless of floating point ABI used.

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

13 years agoName mangling of late-specified return types doesn't work if the return type referenc...
Richard Smith [Thu, 14 Apr 2011 19:57:19 +0000 (19:57 +0000)]
Name mangling of late-specified return types doesn't work if the return type references the argument types:

  template<typename T> auto f(T a) -> decltype(a.foo());

Since this is the primary reason for the introduction of this feature, downgrade implementation status to "Some examples work".

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