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

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