Commit Graph

13725 Commits

Author SHA1 Message Date
Chris Lattner d50fea52af Simplify mangleFunctionDecl by unnesting a crazy condition. This fixes
the check for extern "c" system headers, which should prevent functiondecls
from being mangled.

llvm-svn: 73311
2009-06-13 23:34:16 +00:00
Chris Lattner a744527773 add a handy predicate.
llvm-svn: 73310
2009-06-13 23:31:51 +00:00
Eli Friedman 3192cc8526 Fix the calling convention for structs/unions containing SSE vectors on
x86-32.  This is slightly messy, but I think it's consistent with gcc.

llvm-svn: 73306
2009-06-13 21:37:10 +00:00
Chris Lattner b3c4fb5cac declare an 'operator delete' to match operator new, this avoids many many
warnings when building with VC++, patch by AlisdairM!

llvm-svn: 73305
2009-06-13 20:51:38 +00:00
Chris Lattner 084776d08b fix typo
llvm-svn: 73304
2009-06-13 20:35:58 +00:00
Daniel Dunbar 2f554fadcd Don't include system headers when overriding triple.
llvm-svn: 73301
2009-06-13 20:02:26 +00:00
Daniel Dunbar c0467f36f2 Force Obj-C runtime version for this test
llvm-svn: 73300
2009-06-13 19:40:25 +00:00
Daniel Dunbar c54e242fb4 Switch to the new test runner.
- TestRunner.sh still needs to be moved over.

 - Please let me know if you find problems / missing features.

llvm-svn: 73298
2009-06-13 18:28:48 +00:00
Anders Carlsson 40c1d49615 Have CheckClassTemplatePartialSpecializationArgs take a TemplateArgumentListBuilder. No functionality change.
llvm-svn: 73297
2009-06-13 18:20:51 +00:00
Chris Lattner 60ac6b9dce a couple minor tweaks
llvm-svn: 73296
2009-06-13 18:11:10 +00:00
Eli Friedman 9782caa369 Allow initializing a vector with a vector in addition to allowing a list
of the elements.  Issue reported on cfe-dev by Mattias Holm.

llvm-svn: 73292
2009-06-13 10:38:46 +00:00
Chris Lattner b6f77af532 implement and document a new __has_feature and __has_builtin magic
builtin preprocessor macro.  This appears to work with two caveats:
1) builtins are registered in -E mode, and 2) target-specific builtins
are unconditionally registered even if they aren't supported by the
target (e.g. SSE4 builtin when only SSE1 is enabled).

llvm-svn: 73289
2009-06-13 07:13:28 +00:00
Douglas Gregor a5d5c749b1 Move a bunch of tests into temp.param, and write a few tests for paragraphs that hadn't been touched before
llvm-svn: 73288
2009-06-13 06:59:07 +00:00
Daniel Dunbar 4be788c56a Add some random C++ standard tests.
llvm-svn: 73287
2009-06-13 06:16:36 +00:00
Douglas Gregor 7a1095f243 Add the structure for a C++ test suite that mimics the structure of the C++ standard
llvm-svn: 73286
2009-06-13 06:06:53 +00:00
Eli Friedman 9a0e23c495 Fix for PR4382: allow instantiating dependent nested name specifiers.
I'm not completely sure this is the right way to fix this issue, but it seems 
reasonable, and it's consistent with the non-template code for this 
construct.

llvm-svn: 73285
2009-06-13 04:51:30 +00:00
Anders Carlsson 20ee0ed4ea If a CXXRecordDecl is a class template, the 'this' type should be the injected class name type. Fixes pr4383.
llvm-svn: 73284
2009-06-13 02:59:33 +00:00
Anders Carlsson 15201f19ba More work on type parameter packs.
llvm-svn: 73281
2009-06-13 02:08:00 +00:00
Zhongxing Xu 70b27e6f8b Stop tracking non-compound value for struct. It may be caused by imprecise cast
logic.

llvm-svn: 73279
2009-06-13 01:31:11 +00:00
Douglas Gregor 4f024b2046 Remove a bunch of unnecessary template argument deduction code that was
obviously written by someone who didn't read C++ [temp.class.spec].

llvm-svn: 73276
2009-06-13 00:59:32 +00:00
Anders Carlsson c8cbb2d08c Move template type argument checking out into a separate function. No functionality change.
llvm-svn: 73275
2009-06-13 00:33:33 +00:00
Douglas Gregor 91772d1d76 When some template parameters of a class template partial
specialization cannot be deduced, produce a warning noting that the
affected class template partial specialization will never be used.

llvm-svn: 73274
2009-06-13 00:26:55 +00:00
Chris Lattner 4ca97c3b9e Fix PR4372, another case where non-prototyped functions can prevent
always_inline from working.

llvm-svn: 73273
2009-06-13 00:26:38 +00:00
Anders Carlsson aa73b9135a Improvements to TemplateArgumentListBuilder to make it work better with parameter packs.
llvm-svn: 73272
2009-06-13 00:08:58 +00:00
Anders Carlsson 327865db53 A parameter pack must always come last in a class template.
llvm-svn: 73269
2009-06-12 23:20:15 +00:00
Anders Carlsson 508caaec3b No need to mark the parameter as invalid, just ignore the default argument.
llvm-svn: 73268
2009-06-12 23:13:22 +00:00
Anders Carlsson f986ba7528 Address more comments from Doug.
llvm-svn: 73267
2009-06-12 23:09:56 +00:00
Chris Lattner 815b70efcd add the location of the ')' in a do/while statement to DoStmt.
This fixes a source range problem reported by Olaf Krzikalla.

llvm-svn: 73266
2009-06-12 23:04:47 +00:00
Anders Carlsson 15f1dd1c88 Address comments from Doug - Add a Sema::SemaRef.BuildBlockPointerType and use it.
llvm-svn: 73264
2009-06-12 22:56:54 +00:00
Douglas Gregor 170bc42547 It looks like we've finished off matching of class template partial specializations; add comments and update the C++ status page
llvm-svn: 73263
2009-06-12 22:31:52 +00:00
Anders Carlsson d382435014 Parameter packs can't have default arguments.
llvm-svn: 73262
2009-06-12 22:30:13 +00:00
Anders Carlsson fb1d776ff0 Keep track of whether a type parameter is actually a type parameter pack.
llvm-svn: 73261
2009-06-12 22:23:22 +00:00
Douglas Gregor 30b0197169 Finish implementing checking of class template partial specializations
llvm-svn: 73260
2009-06-12 22:21:45 +00:00
Douglas Gregor 09a3023e65 Diagnose C++ [temp.class.spec]p9b3, where a class template partial
specialization's arguments are identical to the implicit template
arguments of the primary template. Typically, this is meant to be a
declaration/definition of the primary template, so we give that
advice.

llvm-svn: 73259
2009-06-12 22:08:06 +00:00
Douglas Gregor 8cfd2ba76d Diagnose the incorrect use of non-type template arguments for class
template partial specializations.

llvm-svn: 73254
2009-06-12 21:21:02 +00:00
Eli Friedman 7983cb1dbe Minor formatting tweak.
llvm-svn: 73251
2009-06-12 20:11:05 +00:00
Eli Friedman 0f7d4455fe Fix a minor formatting mistake.
llvm-svn: 73250
2009-06-12 20:08:48 +00:00
Eli Friedman 4e20479de8 Some updates to the gcc extension sections of the users manual.
llvm-svn: 73249
2009-06-12 20:04:25 +00:00
Anders Carlsson 01e9e93485 Parse support for C++0x type parameter packs.
llvm-svn: 73247
2009-06-12 19:58:00 +00:00
Douglas Gregor d52220513f Verify that the template parameters of a class template partial
specialization do not have default arguments 
(C++ [temp.class.spec]p10). 

llvm-svn: 73245
2009-06-12 19:43:02 +00:00
Douglas Gregor dc41eb18e9 Update the C++ status to reflect improvements in template argument deduction and the handling of class template partial specializations
llvm-svn: 73242
2009-06-12 19:15:38 +00:00
Anders Carlsson b0e8e228ff Fix PR4365.
llvm-svn: 73240
2009-06-12 18:53:02 +00:00
Douglas Gregor 181aa4a250 Improve template argument deduction to keep track of why template
argument deduction failed. For example, given

  template<typename T> struct is_same<T, T> { ... };

template argument deduction will fail for is_same<int, float>, and now
reports enough information

Right now, we don't do anything with this extra information, but it
can be used for informative diagnostics that say, e.g., "template
argument deduction failed because T was deduced to 'int' in one
context and 'float' in another".

llvm-svn: 73237
2009-06-12 18:26:56 +00:00
Anders Carlsson 84613c4eba It's an error to use a function declared in a class definition as a default argument before the function has been declared.
llvm-svn: 73234
2009-06-12 16:51:40 +00:00
Anders Carlsson a767eeed19 Deducation and instantiation of block types.
llvm-svn: 73232
2009-06-12 16:23:10 +00:00
Zhongxing Xu 2693c504c2 use getAsPointerType() method.
llvm-svn: 73218
2009-06-12 03:59:12 +00:00
Oscar Fuentes 6c0c09dcbb CMake: New variable LLVM_LIBDIR_SUFFIX.
Patch by Ingmar Vanhassel!

llvm-svn: 73217
2009-06-12 02:54:12 +00:00
Anders Carlsson 8783543a6f Don't assert when generating code with static_asserts.
llvm-svn: 73208
2009-06-11 21:22:55 +00:00
Eli Friedman 7433a248e3 PR4371: Reduce the inlining threshold outside of -O3. This makes
the clang inlining threshold consistent with the threshold for llvm-gcc.

llvm-svn: 73204
2009-06-11 20:33:41 +00:00
Eli Friedman 9d79bdaaad Following gcc, hide the hack to include the SSE2 intrinsics from
xmmintrin.h in an ifdef.

llvm-svn: 73200
2009-06-11 18:50:02 +00:00