]> granicus.if.org Git - clang/log
clang
13 years agoTest case for r131940.
Devang Patel [Tue, 24 May 2011 00:22:40 +0000 (00:22 +0000)]
Test case for r131940.

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

13 years agoDelete the extraneous return statement that was causing my earlier
Sean Hunt [Mon, 23 May 2011 23:56:01 +0000 (23:56 +0000)]
Delete the extraneous return statement that was causing my earlier
issues and also add a test.

We should now handle defaulted members of templates properly. No
comment as to whether or not this also holds for templated functions,
but defaulting those is kind of insane.

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

13 years agoFix bug introduced with r131930.
David Chisnall [Mon, 23 May 2011 23:15:11 +0000 (23:15 +0000)]
Fix bug introduced with r131930.

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

13 years agoImplement explicit specialization of explicitly-defaulted constructors.
Sean Hunt [Mon, 23 May 2011 23:14:04 +0000 (23:14 +0000)]
Implement explicit specialization of explicitly-defaulted constructors.
The general out-of-line case (including explicit instantiation mostly
works except that the definition is being lost somewhere between the AST
and CodeGen, so the definition is never emitted.

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

13 years agoDon't omit retain / release / autorelease message sends in hybrid GC mode.
David Chisnall [Mon, 23 May 2011 23:13:25 +0000 (23:13 +0000)]
Don't omit retain / release / autorelease message sends in hybrid GC mode.

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

13 years agoFix some problems where functions must be bitcast but we're expecting a llvm::Functio...
David Chisnall [Mon, 23 May 2011 22:33:28 +0000 (22:33 +0000)]
Fix some problems where functions must be bitcast but we're expecting a llvm::Function of the right type.

PR9994.

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

13 years agoCorrectly propagate defaultedness across template instantiation. This
Sean Hunt [Mon, 23 May 2011 21:07:59 +0000 (21:07 +0000)]
Correctly propagate defaultedness across template instantiation. This
fixes PR9965, but we're not out of the water yet, as we do not
successfully handle out-of-line definitions, due to my utter
misunderstanding of how we manage templates.

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

13 years agoFix examples compile break due to rewrite of isa.
Manuel Klimek [Mon, 23 May 2011 18:25:41 +0000 (18:25 +0000)]
Fix examples compile break due to rewrite of isa.

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

13 years agoEmulate a MSVC bug where if during an using declaration name lookup, the declaration...
Francois Pichet [Mon, 23 May 2011 03:43:44 +0000 (03:43 +0000)]
Emulate a MSVC bug where if during an using declaration name lookup, the declaration found is unaccessible (private) and that declaration was bring into scope via another using declaration whose target declaration is accessible (public) then no error is generated.

Example:
class A { public: int f();  };
class B : public A { private: using A::f; };
class C : public B { private: using B::f; };

Here, B::f is private so this should fail in Standard C++, but because B::f refers to A::f which is public MSVC accepts it.

This fixes 1 error when parsing MFC code with clang.

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

13 years agoattempt to fix windows testers, which generate #line by default.
Chris Lattner [Sun, 22 May 2011 23:47:57 +0000 (23:47 +0000)]
attempt to fix windows testers, which generate #line by default.

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

13 years agomake the x86-32 backend specify a byval alignment, even when the
Chris Lattner [Sun, 22 May 2011 23:35:00 +0000 (23:35 +0000)]
make the x86-32 backend specify a byval alignment, even when the
code generator will do it.  With this patch, clang compiles the example
in PR9794 to not have an alloca temporary.

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

13 years agoFix x86-64 byval passing to specify the alignment even when the code
Chris Lattner [Sun, 22 May 2011 23:21:23 +0000 (23:21 +0000)]
Fix x86-64 byval passing to specify the alignment even when the code
generator will give it something sufficient.  This is important because
the mid-level optimizer doesn't know what alignment is required otherwise.

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

13 years agoProvide the runtime with information about the GC compile options (GNU runtimes)
David Chisnall [Sun, 22 May 2011 22:37:08 +0000 (22:37 +0000)]
Provide the runtime with information about the GC compile options (GNU runtimes)

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

13 years agoInvoke the FileChanged callback before pushing the linemarker for a system
Chris Lattner [Sun, 22 May 2011 22:10:16 +0000 (22:10 +0000)]
Invoke the FileChanged callback before pushing the linemarker for a system
header.  Getting it in the wrong order generated incorrect line markers in -E
mode.  In the testcase from PR9861 we used to generate:

# 1 "test.c" 2
# 1 "./foobar.h" 1
# 0 "./foobar.h"
# 0 "./foobar.h" 3
# 2 "test.c" 2

now we properly produce:

# 1 "test.c" 2
# 1 "./foobar.h" 1
# 1 "./foobar.h" 3
# 2 "test.c" 2

This fixes PR9861.

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

13 years agofix 80 col violation
Chris Lattner [Sun, 22 May 2011 22:09:06 +0000 (22:09 +0000)]
fix 80 col violation

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

13 years agoadd opensuse toolchain support, patch by Ismail Donmez!
Chris Lattner [Sun, 22 May 2011 16:45:07 +0000 (16:45 +0000)]
add opensuse toolchain support, patch by Ismail Donmez!

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

13 years agoChange the default for supporting ObjC GC to true. This shouldn't really be in ToolC...
David Chisnall [Sun, 22 May 2011 16:26:21 +0000 (16:26 +0000)]
Change the default for supporting ObjC GC to true.  This shouldn't really be in ToolChain at all, since it's a property of the objc runtime library.

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

13 years agoFix fallout from r131838.
Nick Lewycky [Sun, 22 May 2011 06:50:05 +0000 (06:50 +0000)]
Fix fallout from r131838.

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

13 years agoAdd Redhat Enterprise Linux to the Linux toolchain, PR9769,
Chris Lattner [Sun, 22 May 2011 05:36:06 +0000 (05:36 +0000)]
Add Redhat Enterprise Linux to the Linux toolchain, PR9769,
patch by Bryce Lelbach

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

13 years agoAdd an assertion to tell us when we're going off the deep end trying
Douglas Gregor [Sun, 22 May 2011 00:21:10 +0000 (00:21 +0000)]
Add an assertion to tell us when we're going off the deep end trying
to determine outer template arguments lists for template
parameters. This is actually the problem behind PR9643, which I have
yet to figure out how to fix.

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

13 years agoadjust to mainline api change.
Chris Lattner [Sat, 21 May 2011 23:50:44 +0000 (23:50 +0000)]
adjust to mainline api change.

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

13 years agoAudit and finish the implementation of C++0x nullptr, fixing two
Douglas Gregor [Sat, 21 May 2011 23:15:46 +0000 (23:15 +0000)]
Audit and finish the implementation of C++0x nullptr, fixing two
minor issues along the way:
  - Non-type template parameters of type 'std::nullptr_t' were not
  permitted.
  - We didn't properly introduce built-in operators for nullptr ==,
  !=, <, <=, >=, or > as candidate functions .

To my knowledge, there's only one (minor but annoying) part of nullptr
that hasn't been implemented: catching a thrown 'nullptr' as a pointer
or pointer-to-member, per C++0x [except.handle]p4.

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

13 years agoIt's considered poor form to create references to the overloaded
Douglas Gregor [Sat, 21 May 2011 22:16:50 +0000 (22:16 +0000)]
It's considered poor form to create references to the overloaded
function type. Educate template argument deduction thusly, fixing
PR9974 / <rdar://problem/9479155>.

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

13 years agoClassify bound member function types are member function types. Fixes
Douglas Gregor [Sat, 21 May 2011 21:04:55 +0000 (21:04 +0000)]
Classify bound member function types are member function types. Fixes
PR9973 / <rdar://problem/9479191>.

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

13 years agoswitch clang off StandardPasses.h onto PassManagerBuilder.h
Chris Lattner [Sat, 21 May 2011 20:40:11 +0000 (20:40 +0000)]
switch clang off StandardPasses.h onto PassManagerBuilder.h

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

13 years agoFix our handling of the warning when one tries to pass a
Douglas Gregor [Sat, 21 May 2011 19:26:31 +0000 (19:26 +0000)]
Fix our handling of the warning when one tries to pass a
non-POD/non-trivial object throuugh a C-style varargs. The warning
itself was default-mapped to error, but can be downgraded, but we were
treating it in Sema like a hard error, silently dropping the call.

Instead, treat this problem like a warning, and do what the warning
says we do: abort at runtime. To do so, we fake up a __builtin_trap()
expression that gets evaluated as part of the argument.

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

13 years agoFix the clang part of PR7952: rewrite the specialization of isa<> in DeclBase,
Eli Friedman [Sat, 21 May 2011 19:15:39 +0000 (19:15 +0000)]
Fix the clang part of PR7952: rewrite the specialization of isa<> in DeclBase,
and stop abusing the multi-level dereference isa<> used to allow.

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

13 years agoDiagnose the presence of storage-class-specifiers on explicit
Douglas Gregor [Sat, 21 May 2011 18:53:30 +0000 (18:53 +0000)]
Diagnose the presence of storage-class-specifiers on explicit
instantiations and specializations. Fixes <rdar://problem/9126453> and PR8700.

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

13 years agoTeach Sema::ActOnUninitializedDecl() not to try to interpret when one
Douglas Gregor [Sat, 21 May 2011 17:52:48 +0000 (17:52 +0000)]
Teach Sema::ActOnUninitializedDecl() not to try to interpret when one
should use a constructor to default-initialize a
variable. InitializationSequence knows the rules for default
initialization, better. Fixes <rdar://problem/8501008>.

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

13 years agoIntroduce the -fdiagnostics-format=xxx option to control how Clang
Douglas Gregor [Sat, 21 May 2011 17:07:29 +0000 (17:07 +0000)]
Introduce the -fdiagnostics-format=xxx option to control how Clang
prints the file, line, and column of a diagnostic. We currently
support Clang's normal format, MSVC, and Vi formats.

Note that we no longer change the diagnostic format based on
-fms-extensions.

Patch by Andrew Fish!

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

13 years agoA few more is(Un)signedIntegerType/is(Un)signedOrEnumerationType cleanups.
Douglas Gregor [Sat, 21 May 2011 16:28:01 +0000 (16:28 +0000)]
A few more is(Un)signedIntegerType/is(Un)signedOrEnumerationType cleanups.

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

13 years agoImplement C++0x semantics for passing non-POD classes through varargs.
Douglas Gregor [Sat, 21 May 2011 16:27:21 +0000 (16:27 +0000)]
Implement C++0x semantics for passing non-POD classes through varargs.

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

13 years agoOnly ignore extra tokens after #else if we skip it, otherwise warn. Fixes rdar:/...
Argyrios Kyrtzidis [Sat, 21 May 2011 04:26:04 +0000 (04:26 +0000)]
Only ignore extra tokens after #else if we skip it, otherwise warn. Fixes rdar://9475098.

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

13 years agoFix regression in static analyzer's handling of prefix '--' operator. It was being...
Ted Kremenek [Fri, 20 May 2011 23:40:06 +0000 (23:40 +0000)]
Fix regression in static analyzer's handling of prefix '--' operator.  It was being treated as postfix '--' in C mode.

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

13 years agoAdd a missing case for default constructor deletion.
Sean Hunt [Fri, 20 May 2011 21:43:47 +0000 (21:43 +0000)]
Add a missing case for default constructor deletion.

This case is tested by the fact that the modified test produces
significatly worse diagnostics. That's on the list.

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

13 years agoIntroduce XFAILed test for braced initializer lists.
Sebastian Redl [Fri, 20 May 2011 21:07:01 +0000 (21:07 +0000)]
Introduce XFAILed test for braced initializer lists.

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

13 years agoIntroduce Type::isSignedIntegerOrEnumerationType() and
Douglas Gregor [Fri, 20 May 2011 16:38:50 +0000 (16:38 +0000)]
Introduce Type::isSignedIntegerOrEnumerationType() and
Type::isUnsignedIntegerOrEnumerationType(), which are like
Type::isSignedIntegerType() and Type::isUnsignedIntegerType() but also
consider the underlying type of a C++0x scoped enumeration type.

Audited all callers to the existing functions, switching those that
need to also handle scoped enumeration types (e.g., those that deal
with constant values) over to the new functions. Fixes PR9923 /
<rdar://problem/9447851>.

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

13 years agoCMake: add support for CLANG_VENDOR. PR9966.
Oscar Fuentes [Fri, 20 May 2011 15:57:59 +0000 (15:57 +0000)]
CMake: add support for CLANG_VENDOR. PR9966.

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

13 years agoDowngrade the error about re-opening an inline namespace as non-inline
Douglas Gregor [Fri, 20 May 2011 15:48:31 +0000 (15:48 +0000)]
Downgrade the error about re-opening an inline namespace as non-inline
to a warning, since apparently libstdc++'s debug mode does this (and
we can recover safely). Add a Fix-It to insert the "inline", just for kicks.

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

13 years agoDiagnose unexpanded parameter packs in return statements. This
Douglas Gregor [Fri, 20 May 2011 15:32:55 +0000 (15:32 +0000)]
Diagnose unexpanded parameter packs in return statements. This
manifested in a crash with blocks in PR9953, but it was a ticking time
bomb for normal functions, too. Fixes PR9953.

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

13 years agosandybridge is now called corei7-avx
Benjamin Kramer [Fri, 20 May 2011 15:11:23 +0000 (15:11 +0000)]
sandybridge is now called corei7-avx

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

13 years agoRemove the clang-test-XXX targets from the CMake builds; they really aren't useful
Douglas Gregor [Fri, 20 May 2011 15:01:17 +0000 (15:01 +0000)]
Remove the clang-test-XXX targets from the CMake builds; they really aren't useful

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

13 years agoClean up two comments
Douglas Gregor [Fri, 20 May 2011 15:00:53 +0000 (15:00 +0000)]
Clean up two comments

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

13 years agoFix PR9941 for out-of-line template destructors too.
Sebastian Redl [Fri, 20 May 2011 05:57:18 +0000 (05:57 +0000)]
Fix PR9941 for out-of-line template destructors too.

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

13 years agoUndo enough of r131143 to make private copy ctor diags say "copy constructor" again
Matt Beaumont-Gay [Thu, 19 May 2011 23:44:42 +0000 (23:44 +0000)]
Undo enough of r131143 to make private copy ctor diags say "copy constructor" again

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

13 years agoTeach RegionStore not to symbolic array values whose indices it cannot reason about.
Ted Kremenek [Thu, 19 May 2011 23:37:58 +0000 (23:37 +0000)]
Teach RegionStore not to symbolic array values whose indices it cannot reason about.

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

13 years agoFix location of setter/getter synthesized for a property.
Devang Patel [Thu, 19 May 2011 23:37:41 +0000 (23:37 +0000)]
Fix location of setter/getter synthesized for a property.

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

13 years agoRevert r131672 until __underlying_type is properly implemented in the
Sean Hunt [Thu, 19 May 2011 22:52:25 +0000 (22:52 +0000)]
Revert r131672 until __underlying_type is properly implemented in the
template case.

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

13 years agoFix test on Windows.
Eli Friedman [Thu, 19 May 2011 22:39:47 +0000 (22:39 +0000)]
Fix test on Windows.

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

13 years agoImplement a __has_feature for __underlying_type
Sean Hunt [Thu, 19 May 2011 20:48:13 +0000 (20:48 +0000)]
Implement a __has_feature for __underlying_type

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

13 years agoCorrection for r131662, the GNU as option is --fatal-warnings.
Joerg Sonnenberger [Thu, 19 May 2011 20:46:39 +0000 (20:46 +0000)]
Correction for r131662, the GNU as option is --fatal-warnings.

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

13 years agoAdd a test for __underlying_type
Sean Hunt [Thu, 19 May 2011 20:36:08 +0000 (20:36 +0000)]
Add a test for __underlying_type

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

13 years agoSupport -fatal-warnings for the assembler frontend
Joerg Sonnenberger [Thu, 19 May 2011 18:42:29 +0000 (18:42 +0000)]
Support -fatal-warnings for the assembler frontend

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

13 years agoFix PR9941 again, this time for templates.
Sebastian Redl [Thu, 19 May 2011 16:25:27 +0000 (16:25 +0000)]
Fix PR9941 again, this time for templates.

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

13 years ago- Fixes openSUSE detection for 11.4 and upcoming 12.1
David Chisnall [Thu, 19 May 2011 13:26:33 +0000 (13:26 +0000)]
- Fixes openSUSE detection for 11.4 and upcoming 12.1
- Adds gcc 4.6 to gcc list so that linking will work on openSUSE 12.1

Patch by Ä°smail Dönmez!

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

13 years agoAdd paths used by openSuSE 12.1
David Chisnall [Thu, 19 May 2011 12:04:49 +0000 (12:04 +0000)]
Add paths used by openSuSE 12.1

Patch by Ismail Dönmez!

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

13 years agoImplement __underlying_type for libc++.
Sean Hunt [Thu, 19 May 2011 05:37:45 +0000 (05:37 +0000)]
Implement __underlying_type for libc++.

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

13 years agoReapply r121528, fixing PR9941 by delaying the exception specification check for...
Sebastian Redl [Thu, 19 May 2011 05:13:44 +0000 (05:13 +0000)]
Reapply r121528, fixing PR9941 by delaying the exception specification check for destructors until the class is complete and destructors have been adjusted.

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

13 years agoTeach static analyzer to analyze Objective-C methods in category implementations.
Ted Kremenek [Thu, 19 May 2011 00:56:53 +0000 (00:56 +0000)]
Teach static analyzer to analyze Objective-C methods in category implementations.

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

13 years agoMake __builtin_shufflevector and -ftrapv work correctly together. PR9945.
Eli Friedman [Thu, 19 May 2011 00:37:32 +0000 (00:37 +0000)]
Make __builtin_shufflevector and -ftrapv work correctly together.  PR9945.

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

13 years agoAfter consultation with doug, revert r131515.
Sean Hunt [Wed, 18 May 2011 20:57:13 +0000 (20:57 +0000)]
After consultation with doug, revert r131515.

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

13 years agoRevert r121528 as it breaks a simple testcase, which leads to, among
Sean Hunt [Wed, 18 May 2011 20:57:11 +0000 (20:57 +0000)]
Revert r121528 as it breaks a simple testcase, which leads to, among
other things, libcxx not building.

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

13 years agoAdd ARMTargetCodeGenInfo::initDwarfEHRegSizeTable() defining 16 32bit regs.
Roman Divacky [Wed, 18 May 2011 19:36:54 +0000 (19:36 +0000)]
Add ARMTargetCodeGenInfo::initDwarfEHRegSizeTable() defining 16 32bit regs.

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

13 years agoImplement implicit exception specifications of destructors.
Sebastian Redl [Wed, 18 May 2011 05:20:56 +0000 (05:20 +0000)]
Implement implicit exception specifications of destructors.

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

13 years agoImplement an additional fix for infinite recursion of deleted special
Sean Hunt [Wed, 18 May 2011 03:41:58 +0000 (03:41 +0000)]
Implement an additional fix for infinite recursion of deleted special
member functions by making sure that they're on the record before
checking for deletion.

Also make sure source locations are valid to avoid crashes.

Unfortunately, the declare-all-implicit-members approach is still
required in order to ensure that dependency loops do not result in
incorrectly deleting functions (since they are to be deleted at the
declaration point per the standard).

Fixes PR9917

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

13 years agoForce declaration of implicit members in C++0x mode.
Sean Hunt [Wed, 18 May 2011 01:06:45 +0000 (01:06 +0000)]
Force declaration of implicit members in C++0x mode.

I hear at least one person crying out in anguish, but it's unfortunately
necessary to avoid infinite loops with mutually dependent constructors
trying to call each other and determine if they are deleted.

It might be possible to go back to the old behavior if we can implement
part-of-file lookups efficiently, or if a solution is discovered by
which we can safely detect and avoid infinite recusion.

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

13 years agoAdd some support for RHEL5 systems.
Eric Christopher [Tue, 17 May 2011 23:06:53 +0000 (23:06 +0000)]
Add some support for RHEL5 systems.

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

13 years agoConditionalize the use of 4.4 or 4.2 format based on the target.
Bill Wendling [Tue, 17 May 2011 23:06:23 +0000 (23:06 +0000)]
Conditionalize the use of 4.4 or 4.2 format based on the target.
<rdar://problem/8107317>

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

13 years agoCode cleanup of my last patch.
Fariborz Jahanian [Tue, 17 May 2011 22:46:11 +0000 (22:46 +0000)]
Code cleanup of my last patch.

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

13 years agoPatch to fix IR-gen crash generating structure ABI which implements
Fariborz Jahanian [Tue, 17 May 2011 22:21:16 +0000 (22:21 +0000)]
Patch to fix IR-gen crash generating structure ABI which implements
user specified string class via -fconstant-string-class option.
pr9914.

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

13 years agoFix a nasty bug where inside StringLiteralParser:
Argyrios Kyrtzidis [Tue, 17 May 2011 22:09:56 +0000 (22:09 +0000)]
Fix a nasty bug where inside StringLiteralParser:

1. We would assume that the length of the string literal token was at least 2
2. We would allocate a buffer with size length-2

And when the stars aligned (one of which would be an invalid source location due to stale PCH)
The length would be 0 and we would try to allocate a 4GB buffer.

Add checks for this corner case and a bunch of asserts.
(We really really should have had an assert for 1.).

Note that there's no test case since I couldn't get one (it was major PITA to reproduce),
maybe later.

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

13 years agoDo some safety checks.
Argyrios Kyrtzidis [Tue, 17 May 2011 22:09:53 +0000 (22:09 +0000)]
Do some safety checks.

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

13 years agoFor calls returning first-class aggregates, store by element instead of creating...
Eli Friedman [Tue, 17 May 2011 21:08:01 +0000 (21:08 +0000)]
For calls returning first-class aggregates, store by element instead of creating aggregate stores in common cases.  This is more friendly to fast-isel.

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

13 years agoRevert r131434, my commit disabling the complete-object constructor
John McCall [Tue, 17 May 2011 21:05:49 +0000 (21:05 +0000)]
Revert r131434, my commit disabling the complete-object constructor
optimization for abstract classes;  there was a misunderstanding, and
it turns out that there are no kexts which rely on this.

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

13 years agoFix some minor bugs and add a lot more test cases for defaulted
Sean Hunt [Tue, 17 May 2011 20:44:43 +0000 (20:44 +0000)]
Fix some minor bugs and add a lot more test cases for defaulted
constructors, including two more FIXMEs (one of which I don't actually
understand).

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

13 years agoAdd some more tests.
Sean Hunt [Tue, 17 May 2011 20:44:39 +0000 (20:44 +0000)]
Add some more tests.

I have on that's #if 0'ed out, and I don't know why it's failing to
delete the constructor. I'd appreciate if someone familiar with access
control could look into ShouldDeleteDefaultConstructor - thanks.

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

13 years agoFix comment.
Rafael Espindola [Tue, 17 May 2011 19:06:58 +0000 (19:06 +0000)]
Fix comment.

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

13 years agoThe logic about -static is darwin only. For now assume that all non
Rafael Espindola [Tue, 17 May 2011 16:26:17 +0000 (16:26 +0000)]
The logic about -static is darwin only. For now assume that all non
darwin assembler can handle cfi. Add a test.

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

13 years agoRevert r131447, see if it fixes the buildbot.
Argyrios Kyrtzidis [Tue, 17 May 2011 02:17:52 +0000 (02:17 +0000)]
Revert r131447, see if it fixes the buildbot.

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

13 years agoInside isEmptyRecord function, for CXXRecordDecl just check the isEmpty bit.
Argyrios Kyrtzidis [Tue, 17 May 2011 00:46:40 +0000 (00:46 +0000)]
Inside isEmptyRecord function, for CXXRecordDecl just check the isEmpty bit.

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

13 years agoReapply the commits that r131401 reverted and add a fix for PR9927.
Argyrios Kyrtzidis [Tue, 17 May 2011 00:46:38 +0000 (00:46 +0000)]
Reapply the commits that r131401 reverted and add a fix for PR9927.

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

13 years agoSet up appropriate context for member function.
Devang Patel [Tue, 17 May 2011 00:20:09 +0000 (00:20 +0000)]
Set up appropriate context for member function.
Radar 9440721

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

13 years agoImplement some tests for defaulted constructors. To do this I had to
Sean Hunt [Tue, 17 May 2011 00:19:05 +0000 (00:19 +0000)]
Implement some tests for defaulted constructors. To do this I had to
suppress an error we were previously emitting on valid union code.

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

13 years agoFix crash on C++ code when compiling with -finstrument-functions.
Ted Kremenek [Mon, 16 May 2011 23:49:20 +0000 (23:49 +0000)]
Fix crash on C++ code when compiling with -finstrument-functions.

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

13 years agoEmit complete-object constructors for abstract classes in kext mode for
John McCall [Mon, 16 May 2011 23:34:46 +0000 (23:34 +0000)]
Emit complete-object constructors for abstract classes in kext mode for
reasons that honestly really, really need to be looked into.

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

13 years agoImplement the new C++0x rules for non-trivial things in unions so that
Sean Hunt [Mon, 16 May 2011 22:41:40 +0000 (22:41 +0000)]
Implement the new C++0x rules for non-trivial things in unions so that
my defaulted constructor tests stop yelling at me about them.

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

13 years agoPulls the common part of the clang-check example into Tooling, to allow new tools...
Manuel Klimek [Mon, 16 May 2011 21:33:46 +0000 (21:33 +0000)]
Pulls the common part of the clang-check example into Tooling, to allow new tools to be implemented without duplicating the boilerplate.

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

13 years agoMake the triple an explicit argument of FindTargetProgramPath.
Joerg Sonnenberger [Mon, 16 May 2011 13:35:02 +0000 (13:35 +0000)]
Make the triple an explicit argument of FindTargetProgramPath.
Preserve the original triple in the NetBSD toolchain when using -m32 or
-m64 and the resulting effective target is different from the triple it
started with. This allows -m32 to use the same assembler/linking in
cross-compiling mode and avoids confusion about passing down target
specific flags in that case like --32.

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

13 years agoAdd test for PR9927.
Rafael Espindola [Mon, 16 May 2011 12:42:39 +0000 (12:42 +0000)]
Add test for PR9927.

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

13 years agoRevert 131377, 131369 and 131365.
Rafael Espindola [Mon, 16 May 2011 12:30:54 +0000 (12:30 +0000)]
Revert 131377, 131369 and 131365.
131365 caused PR9927.

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

13 years agoFix another regression from the "skip vtable pointer initialization"
Anders Carlsson [Mon, 16 May 2011 04:08:36 +0000 (04:08 +0000)]
Fix another regression from the "skip vtable pointer initialization"
optimization. Make sure to require a vtable when trying to get the address
of a VTT, otherwise we would never end up emitting the VTT.

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

13 years agoStop leaving a.out files around.
John McCall [Mon, 16 May 2011 02:23:45 +0000 (02:23 +0000)]
Stop leaving a.out files around.

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

13 years agoDon't actually emit calls to the reserved global placement new and delete
John McCall [Mon, 16 May 2011 01:05:12 +0000 (01:05 +0000)]
Don't actually emit calls to the reserved global placement new and delete
operators;  their semantics are guaranteed by the language.

If someone wants to argue that freestanding compiles shouldn't recognize
this, I might be convinceable.

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

13 years agomain() exists in hosted, not freestanding implementations. Fixes the
Sean Hunt [Sun, 15 May 2011 20:59:31 +0000 (20:59 +0000)]
main() exists in hosted, not freestanding implementations. Fixes the
build.

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

13 years agoAdd a method for checking whether a function is one of the reserved global
John McCall [Sun, 15 May 2011 17:49:20 +0000 (17:49 +0000)]
Add a method for checking whether a function is one of the reserved global
placement allocation or deallocation functions.  These functions cannot be
replaced by the user and are exempt from the normal requirements on
allocation functions (e.g. that they must return unaliased memory).

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

13 years agoRe-enable the fix for PR9181 now that all the edge cases are handled.
Anders Carlsson [Sun, 15 May 2011 17:36:21 +0000 (17:36 +0000)]
Re-enable the fix for PR9181 now that all the edge cases are handled.

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

13 years agoWhen checking a set of template parameter lists against a
Douglas Gregor [Sun, 15 May 2011 17:27:27 +0000 (17:27 +0000)]
When checking a set of template parameter lists against a
nested-name-specifier, re-evaluate the nested-name-specifier as if we
were entering that context (which we did!), so that we'll resolve a
template-id to a particular class template partial
specialization. Fixes PR9913.

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

13 years agoThe array-size operand to a new-expression is not necessarily a size_t.
John McCall [Sun, 15 May 2011 07:14:44 +0000 (07:14 +0000)]
The array-size operand to a new-expression is not necessarily a size_t.
It can be larger, it can be smaller, it can be signed, whatever.  Handle
all the crazy cases with grace and spirit.

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

13 years agoFix MSVC build.
Argyrios Kyrtzidis [Sun, 15 May 2011 05:10:24 +0000 (05:10 +0000)]
Fix MSVC build.

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

13 years agoMake CGF.getContext() inlinable, because it's trivial, and optimize
John McCall [Sun, 15 May 2011 02:34:36 +0000 (02:34 +0000)]
Make CGF.getContext() inlinable, because it's trivial, and optimize
hasAggregateLLVMType.

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