]> granicus.if.org Git - clang/log
clang
13 years agoRemove unused STL header includes.
Jay Foad [Sat, 23 Apr 2011 19:53:52 +0000 (19:53 +0000)]
Remove unused STL header includes.

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

13 years agoMove all of the logic for __DEPRECATED to the driver based on comments
Chandler Carruth [Sat, 23 Apr 2011 19:48:40 +0000 (19:48 +0000)]
Move all of the logic for __DEPRECATED to the driver based on comments
from dgregor.

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

13 years ago"note" location of forward class used as receiver of
Fariborz Jahanian [Sat, 23 Apr 2011 17:27:19 +0000 (17:27 +0000)]
"note" location of forward class used as receiver of
a 'deprecated' selector in the diagnostics for the
selector. // rdar://9309223

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

13 years agoRemove unnecessary const away cast in LateTemplateParserCallback.
Francois Pichet [Sat, 23 Apr 2011 11:52:20 +0000 (11:52 +0000)]
Remove unnecessary const away cast in LateTemplateParserCallback.

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

13 years agoImplement basic __is_trivial type-trait support, enough to close PR9472.
Chandler Carruth [Sat, 23 Apr 2011 10:47:28 +0000 (10:47 +0000)]
Implement basic __is_trivial type-trait support, enough to close PR9472.
This introduces a few APIs on the AST to bundle up the standard-based
logic so that programmatic clients have access to exactly the same
behavior.

There is only one serious FIXME here: checking for non-trivial move
constructors and move assignment operators. Those bits need to be added
to the declaration and accessors provided.

This implementation should be enough for the uses of __is_trivial in
libstdc++ 4.6's C++98 library implementation.

Ideas for more thorough test cases or any edge cases missing would be
appreciated. =D

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

13 years agoSort the type traits in a few places where they weren't previously
Chandler Carruth [Sat, 23 Apr 2011 10:47:20 +0000 (10:47 +0000)]
Sort the type traits in a few places where they weren't previously
sorted in order to prepare for adding some new ones.

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

13 years agoFix Clang's __DEPRECATED define to be controled by -Wdeprecated. This
Chandler Carruth [Sat, 23 Apr 2011 09:27:53 +0000 (09:27 +0000)]
Fix Clang's __DEPRECATED define to be controled by -Wdeprecated. This
matches GCC behavior which libstdc++ uses to limit #warning-based
messages about deprecation.

The machinery involves threading this through a new '-fdeprecated-macro'
flag for CC1. The flag defaults to "on", similarly to -Wdeprecated. We
turn the flag off in the driver when the warning is turned off (modulo
matching some GCC bugs). We record this as a language option, and key
the preprocessor on the option when introducing the define.

A separate flag rather than a '-D' flag allows us to properly represent
the difference between C and C++ builds (only C++ receives the define),
and it allows the specific behavior of following -Wdeprecated without
potentially impacting the set of user-provided macro flags.

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

13 years agoLike the coding standards say, do not use "using namespace std".
Jay Foad [Sat, 23 Apr 2011 09:06:00 +0000 (09:06 +0000)]
Like the coding standards say, do not use "using namespace std".

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

13 years agoGCC overloads -Wwrite-strings just to make it extra confusing. While it
Chandler Carruth [Sat, 23 Apr 2011 06:54:44 +0000 (06:54 +0000)]
GCC overloads -Wwrite-strings just to make it extra confusing. While it
changes language semantics in C and ObjC (which Clang has supported for
a while), in C++ it's the name used for Clang's
-Wdeprecated-writable-strings.

Clang's name is at least less overloaded if still confusing (the string
isn't writable, we just allow converting to a non-const pointer without
warning), so I've left it in place and made the GCC name an alias for
compatibility.

With this I've implemented all the aspects of GCC's -Wwrite-strings I've
encountered which didn't work with Clang.

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

13 years agoThere were some frustrating problems with the implementation of
Chandler Carruth [Sat, 23 Apr 2011 06:30:43 +0000 (06:30 +0000)]
There were some frustrating problems with the implementation of
-Wwrite-strings. First and foremost, once the positive form of the flag
was passed, it could never be disabled by passing -Wno-write-strings.
Also, the diagnostic engine couldn't in turn use -Wwrite-strings to
control diagnostics (as GCC does) because it was essentially hijacked to
drive the language semantics.

Fix this by giving CC1 a clean '-fconst-strings' flag to enable
const-qualified strings in C and ObjC compilations. Corresponding
'-fno-const-strings' is also added. Then the driver is taught to
introduce '-fconst-strings' in the CC1 command when '-Wwrite-strings'
dominates.

This entire flag is basically GCC-bug-compatibility driven, so we also
match GCC's bug where '-w' doesn't actually disable -Wwrite-strings. I'm
open to changing this though as it seems insane.

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

13 years agoDiagnose C++ abstract parameters for Objective-C methods.
John McCall [Sat, 23 Apr 2011 02:46:06 +0000 (02:46 +0000)]
Diagnose C++ abstract parameters for Objective-C methods.

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

13 years agoExhaust the cases.
Argyrios Kyrtzidis [Sat, 23 Apr 2011 01:10:24 +0000 (01:10 +0000)]
Exhaust the cases.

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

13 years agoFix an assertion when code-completing, rdar://9288730 & http://llvm.org/PR9728.
Argyrios Kyrtzidis [Sat, 23 Apr 2011 01:04:12 +0000 (01:04 +0000)]
Fix an assertion when code-completing, rdar://9288730 & http://llvm.org/PR9728.

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

13 years agoTie debug information for method declaration with debug information for method defini...
Devang Patel [Sat, 23 Apr 2011 00:08:01 +0000 (00:08 +0000)]
Tie debug information for method declaration with debug information for method definition.

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

13 years agoDon't allow reinterpret_cast to reference of vector element and property expression...
Argyrios Kyrtzidis [Fri, 22 Apr 2011 23:57:57 +0000 (23:57 +0000)]
Don't allow reinterpret_cast to reference of vector element and property expression. Thanks goes to Eli Friedman!

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

13 years agoTeach libclang to be more careful around BlockDecls, and don't assume
Douglas Gregor [Fri, 22 Apr 2011 23:49:24 +0000 (23:49 +0000)]
Teach libclang to be more careful around BlockDecls, and don't assume
that a TypeSourceInfo is always available, like we do everywhere else
in libclang. Fixes <rdar://problem/9311140>.

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

13 years agodon't warn about empty macro arguments in c++'0x mode, since it sucked in
Chris Lattner [Fri, 22 Apr 2011 23:25:09 +0000 (23:25 +0000)]
don't warn about empty macro arguments in c++'0x mode, since it sucked in
the c99 preprocessor.  Patch by Jonathan Sauer!

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

13 years agoCorrectly emit a diagnostic for multiple templated function definitions in -flate...
Francois Pichet [Fri, 22 Apr 2011 23:20:44 +0000 (23:20 +0000)]
Correctly emit a diagnostic for multiple templated function definitions in -flate-template-parsing mode.

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

13 years agoreinterpret_cast to reference of a bit-field is not allowed.
Argyrios Kyrtzidis [Fri, 22 Apr 2011 22:31:13 +0000 (22:31 +0000)]
reinterpret_cast to reference of a bit-field is not allowed.

Fixes rdar://9202628 & http://llvm.org/PR9564.

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

13 years agoAt the end of the translation unit, defining a vtable can introduce
Douglas Gregor [Fri, 22 Apr 2011 22:25:37 +0000 (22:25 +0000)]
At the end of the translation unit, defining a vtable can introduce
new templates that need to be instantiated and vice-versa. Iterate
until we've instantiated all required templates and defined all
required vtables. Fixed PR9325 / <rdar://problem/9055177>.

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

13 years agoAdd -fdelayed-template-parsing option. Using this option all templated function defin...
Francois Pichet [Fri, 22 Apr 2011 22:18:13 +0000 (22:18 +0000)]
Add -fdelayed-template-parsing option. Using this option all templated function definitions are parsed at the end of the translation unit only if it is required by an actual instantiation. As such all the symbols of the TU are available during name lookup.

Using this flag is necessary for compatibility with Microsoft template code.
This also provides some parsing speed improvement.

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

13 years agoFixes an instance method meta-data generation bug in
Fariborz Jahanian [Fri, 22 Apr 2011 22:02:28 +0000 (22:02 +0000)]
Fixes an instance method meta-data generation bug in
ObjC NeXt runtime where method pointer registered in
metadata belongs to an unrelated method. Ast part of this fix,
I turned at @end missing warning (for class
implementations) into an error as we can never
be sure that meta-data being generated is correct.
// rdar://9072317

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

13 years agoWorkaround buildbot failure by hacking up this test to emit llvm IR.
Bob Wilson [Fri, 22 Apr 2011 20:42:46 +0000 (20:42 +0000)]
Workaround buildbot failure by hacking up this test to emit llvm IR.
This is not a real fix.  It needs some checks to make sure the IR is correct.

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

13 years agoDo not return true from MergeFunctionDecl for a warn_static_non_static warning in...
Francois Pichet [Fri, 22 Apr 2011 19:50:06 +0000 (19:50 +0000)]
Do not return true from MergeFunctionDecl for a warn_static_non_static warning in Microsoft mode.

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

13 years agoFor -Wlogical-op-parentheses, point at '&&', not '||'. Fixes rdar://9125333.
Argyrios Kyrtzidis [Fri, 22 Apr 2011 19:16:27 +0000 (19:16 +0000)]
For -Wlogical-op-parentheses, point at '&&', not '||'. Fixes rdar://9125333.

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

13 years agoI concur with DPG here. This does indeed apply in 0x mode. Added test
Chandler Carruth [Fri, 22 Apr 2011 19:01:39 +0000 (19:01 +0000)]
I concur with DPG here. This does indeed apply in 0x mode. Added test
cases that demonstrates exactly why this does indeed apply in 0x mode.

If isPOD is currently broken in 0x mode, we should fix that directly
rather than papering over it here.

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

13 years agoDon't enter a qualified scope for an invalid decl.
Argyrios Kyrtzidis [Fri, 22 Apr 2011 18:52:25 +0000 (18:52 +0000)]
Don't enter a qualified scope for an invalid decl.

Fixes assertion later on. rdar://9122937 & http://llvm.org/PR9459

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

13 years agoAdd static analyzer support for C++'0X nullptr. Patch by Jim Goodnow II.
Ted Kremenek [Fri, 22 Apr 2011 18:01:30 +0000 (18:01 +0000)]
Add static analyzer support for C++'0X nullptr.  Patch by Jim Goodnow II.

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

13 years agoReplace a couple of literal 8s with ASTContext::getCharWidth(). No change in
Ken Dyck [Fri, 22 Apr 2011 17:59:22 +0000 (17:59 +0000)]
Replace a couple of literal 8s with ASTContext::getCharWidth(). No change in
functionality intended.

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

13 years agoEliminate some literal 8s from EmitNullInitialization() by converting
Ken Dyck [Fri, 22 Apr 2011 17:51:05 +0000 (17:51 +0000)]
Eliminate some literal 8s from EmitNullInitialization() by converting
variables to CharUnits. No change in functionality intended.

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

13 years agoIn IsUserDefinedConversion try to recover from RequireCompleteType returning true.
Argyrios Kyrtzidis [Fri, 22 Apr 2011 17:45:37 +0000 (17:45 +0000)]
In IsUserDefinedConversion try to recover from RequireCompleteType returning true.

Fixes an assertion later on, rdar://9122862 & http://llvm.org/PR9460.

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

13 years agoEliminate some literal 8s from EmitDeclare by converting to CharUnits. No
Ken Dyck [Fri, 22 Apr 2011 17:41:34 +0000 (17:41 +0000)]
Eliminate some literal 8s from EmitDeclare by converting to CharUnits. No
change in functionality intended.

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

13 years agoUse CharUnits to eliminate some literal 8s in
Ken Dyck [Fri, 22 Apr 2011 17:34:18 +0000 (17:34 +0000)]
Use CharUnits to eliminate some literal 8s in
EmitTypeForVarWithBlocksAttr(). No change in functionality intended.

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

13 years agoReplace some literal 8s with char width and char align. No change in
Ken Dyck [Fri, 22 Apr 2011 17:23:43 +0000 (17:23 +0000)]
Replace some literal 8s with char width and char align. No change in
functionality intended.

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

13 years agoPTX: Add default PTX calling conventions
Justin Holewinski [Fri, 22 Apr 2011 11:10:38 +0000 (11:10 +0000)]
PTX: Add default PTX calling conventions

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

13 years agoFor consistency, change suffix from war_ to warn_ for some Microsoft warnings I intro...
Francois Pichet [Fri, 22 Apr 2011 08:25:24 +0000 (08:25 +0000)]
For consistency, change suffix from war_ to warn_ for some Microsoft warnings I introduced lately.

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

13 years agoDowngrade error "static declaration of 'foo' follows non-static declaration" to a...
Francois Pichet [Fri, 22 Apr 2011 08:14:00 +0000 (08:14 +0000)]
Downgrade error "static declaration of 'foo' follows non-static declaration" to a warning in Microsoft mode.

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

13 years agoFor
Argyrios Kyrtzidis [Fri, 22 Apr 2011 05:29:30 +0000 (05:29 +0000)]
For

 double data[20000000] = { [19999999] = 1 };

Don't serialize the filler multiple times.

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

13 years ago_declspec is an alias for __declspec.
Francois Pichet [Fri, 22 Apr 2011 05:21:17 +0000 (05:21 +0000)]
_declspec is an alias for __declspec.

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

13 years agoAdd a testcase for svn r129964 (Neon load/store intrinsic alignments).
Bob Wilson [Fri, 22 Apr 2011 04:06:49 +0000 (04:06 +0000)]
Add a testcase for svn r129964 (Neon load/store intrinsic alignments).

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

13 years agoFix crashing rdar://9122854 & http://llvm.org/PR9461.
Argyrios Kyrtzidis [Fri, 22 Apr 2011 01:18:40 +0000 (01:18 +0000)]
Fix crashing rdar://9122854 & http://llvm.org/PR9461.

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

13 years agoWire up the -ftest-coverage and -fprofile-arcs flags to .gcno file emission (at
Nick Lewycky [Thu, 21 Apr 2011 23:44:07 +0000 (23:44 +0000)]
Wire up the -ftest-coverage and -fprofile-arcs flags to .gcno file emission (at
compile time) and .gcda emission (at runtime). --coverage enables both.

This does not yet add the profile_rt library to the link step if -fprofile-arcs
is enabled when linking.

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

13 years agoFix indentation. No functional change.
Nick Lewycky [Thu, 21 Apr 2011 23:37:32 +0000 (23:37 +0000)]
Fix indentation. No functional change.

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

13 years agoDon't hide #warnings in a system header, same as gcc. Fixes rdar://8495837.
Argyrios Kyrtzidis [Thu, 21 Apr 2011 23:08:23 +0000 (23:08 +0000)]
Don't hide #warnings in a system header, same as gcc. Fixes rdar://8495837.

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

13 years agoMove the check whether a diagnostic must be ignored because it is in a system header
Argyrios Kyrtzidis [Thu, 21 Apr 2011 23:08:18 +0000 (23:08 +0000)]
Move the check whether a diagnostic must be ignored because it is in a system header
inside DiagnosticIDs::getDiagnosticLevel.

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

13 years agoFix gcc warning. Add parens to this assert, incidentally reassociating it, but the...
Richard Smith [Thu, 21 Apr 2011 22:48:40 +0000 (22:48 +0000)]
Fix gcc warning. Add parens to this assert, incidentally reassociating it, but the condition is the same either way.

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

13 years agoAdd a fixit suggest for missing case keywords inside a switch scope. For instance...
Richard Trieu [Thu, 21 Apr 2011 21:44:26 +0000 (21:44 +0000)]
Add a fixit suggest for missing case keywords inside a switch scope.  For instance, in the following code, 'case ' will be suggested before the '1:'

switch (x) {
  1: return 0;
  default: return 1;
}

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

13 years agoAlphabetize this one flag, just to pull it out of my patch.
Nick Lewycky [Thu, 21 Apr 2011 21:32:34 +0000 (21:32 +0000)]
Alphabetize this one flag, just to pull it out of my patch.

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

13 years agoDriver/Darwin: Allow OS X deployment targets like 10.4.11, even though they
Daniel Dunbar [Thu, 21 Apr 2011 21:27:33 +0000 (21:27 +0000)]
Driver/Darwin: Allow OS X deployment targets like 10.4.11, even though they
can't be represented in the environment define.

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

13 years agoUse the ArrayFiller to fill out "holes" in the array initializer due to designated...
Argyrios Kyrtzidis [Thu, 21 Apr 2011 20:03:38 +0000 (20:03 +0000)]
Use the ArrayFiller to fill out "holes" in the array initializer due to designated initializers,
avoiding to create separate Exprs for each one.

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

13 years agoPR9214: Convert Metadata API to use ArrayRef.
Jay Foad [Thu, 21 Apr 2011 19:59:12 +0000 (19:59 +0000)]
PR9214: Convert Metadata API to use ArrayRef.

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

13 years agoAdds a function to run FrontendActions over in-memory code. This is
Manuel Klimek [Thu, 21 Apr 2011 18:37:41 +0000 (18:37 +0000)]
Adds a function to run FrontendActions over in-memory code. This is
the first step towards a standalone Clang tool infrastructure.
The plan is to make it easy to build command line tools that run over
the AST of source files in a project outside of the build system.

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

13 years agoDriver: Tweak -Xarch diags a bit more, we can't actually differentiate between
Daniel Dunbar [Thu, 21 Apr 2011 17:41:34 +0000 (17:41 +0000)]
Driver: Tweak -Xarch diags a bit more, we can't actually differentiate between
unknown and "required more arguments", but only the latter should be feasible in
practice.

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

13 years agoDriver: Improve -Xarch argument diagnostics a bit.
Daniel Dunbar [Thu, 21 Apr 2011 17:32:21 +0000 (17:32 +0000)]
Driver: Improve -Xarch argument diagnostics a bit.

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

13 years agoFixit suggestion for adding missing tag name should have a space after the tag name...
Argyrios Kyrtzidis [Thu, 21 Apr 2011 17:29:47 +0000 (17:29 +0000)]
Fixit suggestion for adding missing tag name should have a space after the tag name. Fixes rdar://9295072

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

13 years agoHave #pragma message not turn into error by -Werror, by default. Fixes rdar://9308989.
Argyrios Kyrtzidis [Thu, 21 Apr 2011 17:11:44 +0000 (17:11 +0000)]
Have #pragma message not turn into error by -Werror, by default. Fixes rdar://9308989.

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

13 years agoPR9772: Fix the definition of WINT_MIN and WINT_MAX on Linux -ffreestanding.
Eli Friedman [Thu, 21 Apr 2011 05:45:45 +0000 (05:45 +0000)]
PR9772: Fix the definition of WINT_MIN and WINT_MAX on Linux -ffreestanding.

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

13 years agoThe 0.98 revision of the x86-64 ABI clarified a lot of things, some
John McCall [Thu, 21 Apr 2011 01:20:55 +0000 (01:20 +0000)]
The 0.98 revision of the x86-64 ABI clarified a lot of things, some
of which break strict compatibility with previous compilers.  Implement
one of them and then immediately opt out on Darwin.

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

13 years agoFor
Argyrios Kyrtzidis [Thu, 21 Apr 2011 00:27:41 +0000 (00:27 +0000)]
For

double data[20000000] = {0};

we would blow out the memory by creating 20M Exprs to fill out the initializer.

To fix this, if the initializer list initializes an array with more elements than
there are initializers in the list, have InitListExpr store a single 'ArrayFiller' expression
that specifies an expression to be used for value initialization of the rest of the elements.

Fixes rdar://9275920.

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

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