Commit Graph

30071 Commits

Author SHA1 Message Date
Axel Naumann bd26a58538 Reset the emitted initializers.
This enables incremental codegen, where the initializer array can be removed from the module, such that only new initializers will be emitted and run.

llvm-svn: 130986
2011-05-06 15:24:04 +00:00
Joerg Sonnenberger ef317a27ff Move logic for passing down -mrelax-all / -relax-all into a common
function. Extend the logic to check if the input was compiled.
Use -relax-all as default only if -O0 is used for compilation.
Fixes bug 9290.

llvm-svn: 130983
2011-05-06 14:35:16 +00:00
Anders Carlsson 47061ee5bc Warn when trying to call a pure virtual member function in a class from the class constructor/destructor. Fixes PR7966.
llvm-svn: 130982
2011-05-06 14:25:31 +00:00
Joerg Sonnenberger 5fe4a7dc96 Rename ContainsCompileAction to ContainsCompileOrAssembleAction to
properly reflect its behavior.

llvm-svn: 130981
2011-05-06 14:05:11 +00:00
Alexis Hunt 5dafebc89f Do defaulted constructors properly.
Explictly defaultedness is correctly reflected on the AST, but there are
no changes to how that affects the definition of functions or much else
really.

llvm-svn: 130974
2011-05-06 01:42:00 +00:00
Alexis Hunt 58dad7d978 Revert r130912 in order to approach defaulted functions from the other
direction and not introduce things in the wrong place three different
times.

llvm-svn: 130968
2011-05-06 00:11:07 +00:00
Richard Smith 14034026d6 Slight tweak to alias template error handling: don't guess that a template-id in an alias declaration was meant to be a specialization. Use a generic, but more accurate, diagnostic.
llvm-svn: 130961
2011-05-05 22:36:10 +00:00
Richard Smith e3a5ff1508 Update www: we now mangle references to function parameters properly. Also, this is really more a decltype issue rather than a late-specified return type issue.
llvm-svn: 130958
2011-05-05 22:07:51 +00:00
Fariborz Jahanian 30aa4aa4ae type of last arg of objc_assign_ivar is ptrdiff_t.
// rdar://9362887

llvm-svn: 130956
2011-05-05 22:00:38 +00:00
Richard Smith 3f1b5d077b Implement support for C++0x alias templates.
llvm-svn: 130953
2011-05-05 21:57:07 +00:00
Fariborz Jahanian 9f1071831f __alignof attribute on the field must consider
packed attribute on the field. //rdar://9217290

llvm-svn: 130948
2011-05-05 21:19:14 +00:00
Douglas Gregor af44c781a7 When the environment variable LIBCLANG_RESOURCE_USAGE is set, teach
libclang to emit information about resource usage after parsing, code
completion, etc.

llvm-svn: 130946
2011-05-05 20:27:22 +00:00
Eli Friedman cb59baaa20 PR9849: Fix _mm_setr_pi32 and friends to actually work correctly. They broke with the MMX rewrite a while back.
llvm-svn: 130945
2011-05-05 20:21:54 +00:00
Daniel Dunbar 6cb7f64e8b tests: Force a triple in this test (so uint128 is present).
llvm-svn: 130941
2011-05-05 18:54:06 +00:00
Fariborz Jahanian 4cc5df700e When instantiating a block expression, the instantiated
blockScopeInfo's CapturesCXXThis field need get set as
well. // rdar://9362021. John M. please review.

llvm-svn: 130930
2011-05-05 17:18:12 +00:00
Devang Patel 979aba5d09 Do not drop uint128 on the floor.
llvm-svn: 130929
2011-05-05 17:06:30 +00:00
Douglas Gregor 21673c4e7e Scoped enumerations should not be treated as integer types (in the C
sense). Fixes <rdar://problem/9366066> by eliminating an inconsistency
between C++ overloading (which handled scoped enumerations correctly)
and C binary operator type-checking (which didn't).

llvm-svn: 130924
2011-05-05 16:13:52 +00:00
Douglas Gregor 951471482c When providing code completions for an Objective-C property access,
also include methods with zero-argument selectors. Implements
<rdar://problem/9048332>.

llvm-svn: 130922
2011-05-05 15:50:42 +00:00
Argyrios Kyrtzidis e9af37d2e1 Introduce a Diagnostic::Report function that accepts and emits a StoredDiagnostic.
llvm-svn: 130919
2011-05-05 07:54:59 +00:00
Ted Kremenek 4587d81191 Place "incompatible pointer types assigning..." warning under a flag, allowing it to be surgically mapped to an error.
llvm-svn: 130916
2011-05-05 04:37:05 +00:00
Ted Kremenek e69ab05f6e Add Checker callback for running a checker at the end of processing an entire TranslationUnit. Patch by Lei Zhang.
llvm-svn: 130913
2011-05-05 03:41:17 +00:00
Alexis Hunt 1adeff92bc Implement some framework for defaulted constructors.
There's some unused stuff for now.

llvm-svn: 130912
2011-05-05 03:36:28 +00:00
Daniel Dunbar ce1035c20f Frontend: Fix a crash in CC_LOG_DIAGNOSTICS handling.
llvm-svn: 130909
2011-05-05 02:12:02 +00:00
Matt Beaumont-Gay 330a5b42a5 Look through block pointers and ObjC object pointers
llvm-svn: 130906
2011-05-05 00:59:35 +00:00
Douglas Gregor 1d33f8d8a0 With invalid overloaded operators, we can get into funny cases where
the overloading of member and non-member functions results in arity
mismatches that don't fit well into our overload-printing scheme. This
only happens for invalid code (which breaks the arity invariants for
these cases), so just suppress the diagnostic rather than inventing
anything new. Fixes <rdar://problem/9222009>.

llvm-svn: 130902
2011-05-05 00:13:13 +00:00
Nick Lewycky 85c011ddc4 Preserve the full name of the file, so that '-c -o foo.pic.o' produces
foo.pic.gcno instead of foo.gcno.

llvm-svn: 130899
2011-05-05 00:08:20 +00:00
Alexis Hunt e262299b72 Change cycle detection to be based off of a warning flag.
llvm-svn: 130898
2011-05-05 00:05:47 +00:00
Douglas Gregor d4a8cede47 When adding KVC code completions, keep track of all of the selectors
that we've previously seen, both in declared methods and from previous
KVC completions, to eliminate duplicates. Fixes <rdar://problem/9162207>.

llvm-svn: 130890
2011-05-04 23:50:46 +00:00
Alexis Hunt 27a761d5bd there i fixed it
Increase robustness of the delegating constructor cycle detection
mechanism. No more infinite loops on invalid or logic errors leading to
false results. Ensure that this is maintained correctly accross
serialization.

llvm-svn: 130887
2011-05-04 23:29:54 +00:00
Ted Kremenek 2159b8d246 ASTUnit::LoadFromASTFile(): recover the resources from an ASTReader if it crashes during PCH validation.
llvm-svn: 130886
2011-05-04 23:27:12 +00:00
Douglas Gregor dfd4b74131 Clean up Sema::BuildCXXNestedNameSpecifier()'s creation of TypeLoc
information. Rather than looking at the declaration kind to figure out
what TypeLoc to build, look at the type; it makes so much more
sense. Fixes <rdar://problem/9086649>.

llvm-svn: 130882
2011-05-04 23:05:40 +00:00
Matt Beaumont-Gay 3c27391a90 Implement Sema::isExprCallable.
We can use this to produce nice diagnostics (and try to fixit-and-recover) in
various cases where we might see "MyFunction" instead of "MyFunction()". The
changes in SemaExpr are an example of how to use isExprCallable.

llvm-svn: 130878
2011-05-04 22:10:40 +00:00
Douglas Gregor b4f4d512ad When converting an integral template argument value to a non-type
template parameter of type 'bool', force the value to be zero or
one. Fixes <rdar://problem/9169404>.

llvm-svn: 130873
2011-05-04 21:55:00 +00:00
Bill Wendling f7d4598b74 Pack ivar offsets together.
Ivar offsets for synthesized ivars are wrong, which could end up with a large
number of dirty pages because of ivar fixups at runtime. When we pack all of the
synthesized ivars into the same section, it limits the number of dirty pages
created. Place them in the "__DATA,__objc_ivar" section.
<rdar://problem/9374905>

llvm-svn: 130870
2011-05-04 21:37:25 +00:00
Nick Lewycky 480cb9918d Record where the GCOV data files should be placed.
llvm-svn: 130866
2011-05-04 20:46:58 +00:00
Bill Wendling 6869b6abf8 Simplification noticed by Chris.
llvm-svn: 130864
2011-05-04 20:28:12 +00:00
Daniel Dunbar 7e0058626a tests: Tweak test to at least use a standard arch, to ensure we try to invoke
Clang.

llvm-svn: 130861
2011-05-04 19:52:08 +00:00
Fariborz Jahanian 9d82fea378 And a test case for my last patch.
llvm-svn: 130853
2011-05-04 18:58:27 +00:00
Fariborz Jahanian 84335f7c8e More ms_struct bitfield stuff:
Adjacent bit fields are packed into the same 1-, 2-, or
4-byte allocation unit if the integral types are the same
size. // rdar://8823265.

llvm-svn: 130851
2011-05-04 18:51:37 +00:00
Argyrios Kyrtzidis 6f09245c33 Change test/PCH/cxx-static_assert.cpp so that it doesn't need a separate header.
llvm-svn: 130839
2011-05-04 14:58:28 +00:00
Axel Naumann ed35df1701 From Vassil Vassilev:
Like in r126648, provide (empty) default implementation for pure virtual getMemoryBufferSizes(). Not all use cases have meaningful implementations.

llvm-svn: 130838
2011-05-04 12:59:24 +00:00
Axel Naumann 71a0fe4b0c Add C++ include paths for libstdc++ with Ubuntu 11.04 and Debian's libstdc++6-4.5, as collected from http://packages.ubuntu.com/search?mode=exactfilename&suite=natty&section=all&arch=any&searchon=contents&keywords=c%2B%2Blocale.h and http://packages.debian.org/wheezy/armel/libstdc++6-4.5-dev/filelist
Fixes compilation with clang++ on Ubuntu 11.04.

llvm-svn: 130837
2011-05-04 09:25:56 +00:00
Alexis Hunt 6118d6642b Implement a better version of delegating constructor cycle detection.
This is more efficient as it's all done at once at the end of the TU.
This could still get expensive, so a flag is provided to disable it. As
an added bonus, the diagnostics will now print out a cycle.

The PCH test is XFAILed because we currently can't deal with a note
emitted in the header and I, being tired, see no other way to verify the
serialization of delegating constructors. We should probably address
this problem /somehow/ but no good solution comes to mind.

llvm-svn: 130836
2011-05-04 05:57:24 +00:00
Nick Lewycky 36d8f05211 No, fix this use after free properly.
llvm-svn: 130833
2011-05-04 03:44:01 +00:00
Bill Wendling 5f9150b5b1 Convert the non-temporal store builtins to LLVM-native IR.
llvm-svn: 130830
2011-05-04 02:40:38 +00:00
Nick Lewycky 776586e20d Fix use after free through StringRef.
llvm-svn: 130828
2011-05-04 02:06:19 +00:00
John McCall 3ab847648f Type prefixes of unresolved-names should only be mangled as unresolved-types
if they match that production, i.e. if they're template type parameters
or decltypes (or, as an obvious case not yet described in the ABI document,
if they're template template parameters applied to template arguments).

llvm-svn: 130824
2011-05-04 01:45:19 +00:00
Ted Kremenek 2160a0d3d7 Enhance clang_getCXTUResourceUsage() to return the amount of memory used by the Preprocessor's bump allocator as well as those from the PreprocessingRecord.
llvm-svn: 130823
2011-05-04 01:38:46 +00:00
Alexis Hunt 37a477f7eb Implement serialization of delegating constructors.
llvm-svn: 130822
2011-05-04 01:19:08 +00:00
Alexis Hunt 159bdaa50e Ensure that delegating constructor loop detection uses canonical
declarations.

llvm-svn: 130821
2011-05-04 01:19:04 +00:00