Commit Graph

30046 Commits

Author SHA1 Message Date
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
Alexis Hunt f9b554bef9 Fix the delegating constructors test to not rely on basic block names.
llvm-svn: 130813
2011-05-04 00:59:33 +00:00
Douglas Gregor ed8a29b855 When tag lookup finds something ambiguous, and we're defining a new
tag, filter out those ambiguous names that we found if they aren't
within the declaration context where this newly-defined tag will be
visible.

This is basically a hack, because we really need to fix the lookup of
tag declarations in this case to not find things it
shouldn't. However, it's better than what we had before, and it fixes
<rdar://problem/9168556>. 

llvm-svn: 130810
2011-05-04 00:25:33 +00:00
Richard Trieu ae700c971c Fix a typo in a test.
CHEKC -> CHECK

llvm-svn: 130809
2011-05-04 00:16:24 +00:00
Douglas Gregor 37aa4938c8 Introduce a new libclang API, clang_isFileMultipleIncludeGuarded(),
which determines whether a particular file is actually a header that
is intended to be guarded from multiple inclusions within the same
translation unit.

llvm-svn: 130808
2011-05-04 00:14:37 +00:00
Argyrios Kyrtzidis f1f67597d9 Introduce ASTUnit::LoadFromCompilerInvocationAction that allows one to create an ASTUnit
from a CompilerInvocation along with an ASTFrontendAction to invoke, and without all the goo
about the precompiled preamble.

llvm-svn: 130805
2011-05-03 23:26:34 +00:00
Alexis Hunt 9d47faf686 Ensure that destructors are properly inovked when an exception leaves
the body of a delegating constructor call.

This means that the delegating constructor implementation should be
complete and correct, though there are some rough edges (diagnostic
quality with the cycle detection and using a deleted destructor).

llvm-svn: 130803
2011-05-03 23:05:34 +00:00
Fariborz Jahanian 759e4a1add Only the first zero-length bitfield decides alignment of
the followup data member in an ms_struct struct.
// rdar:// 8823265

llvm-svn: 130795
2011-05-03 22:07:14 +00:00
Alexis Hunt 5583d56ddb Move the AST modifications to after the cycle detection in
lib/Sema/SemaDeclCXX.cpp to avoid getting stuck in an infinite loop. See
the comment for more explanation.

llvm-svn: 130788
2011-05-03 20:43:02 +00:00
Douglas Gregor 3bb2a81539 Extend -Wnon-pod-memset to also encompass memcpy() and memmove(),
checking both the source and the destination operands, renaming the
warning group to -Wnon-pod-memaccess and tweaking the diagnostic text
in the process.

llvm-svn: 130786
2011-05-03 20:37:33 +00:00
Devang Patel f32f098fd2 Silence warnings.
llvm-svn: 130785
2011-05-03 20:22:16 +00:00
Fariborz Jahanian fc0fe6eb52 Finish off rules for z-length bitfields in ms_struct
structs. // rdar://8823265

llvm-svn: 130783
2011-05-03 20:21:04 +00:00
Alexis Hunt 271c36811d Fix delegating constructors stylistic issues.
Material bugfixes to come this afternoon.

llvm-svn: 130782
2011-05-03 20:19:28 +00:00
Douglas Gregor a74926b518 Separate the -Wnon-pod-memset warnings into two separate warnings:
- a default-on warning for pointers to dynamic classes (= classes with vtables)
  - a default-off warning for other non-POD types

llvm-svn: 130781
2011-05-03 20:05:22 +00:00
Benjamin Kramer ffe4ec45f3 Remove unused but set variable.
llvm-svn: 130776
2011-05-03 18:46:17 +00:00
Argyrios Kyrtzidis 13935670e4 Fix a double free when parsing malformed code. Fixes rdar://9173693.
llvm-svn: 130775
2011-05-03 18:45:38 +00:00
Chandler Carruth 7c9856deb3 When parsing a template friend declaration we dropped the template
parameters on the floor in certain cases:
class X {
  template <typename T> friend typename A<T>::Foo;
};

This was parsed as a *non* template friend declaration some how, and
received an ExtWarn. Fixing the parser to actually provide the template
parameters to the freestanding declaration parse triggers the code which
specifically looks for such constructs and hard errors on them.

Along the way, this prevents us from trying to instantiate constructs
like the above inside of a outer template. This is important as loosing
the template parameters means we don't have a well formed declaration
and template instantiation will be unable to rebuild the AST. That fixes
a crash in the GCC test suite.

llvm-svn: 130772
2011-05-03 18:35:10 +00:00
Douglas Gregor 953beb4715 Only check the use of memset() if we're refering to a C function named
'memset' with external linkage.

llvm-svn: 130770
2011-05-03 18:11:37 +00:00
Bruno Cardoso Lopes 36e9a2b796 Add a few ARM coprocessor builtins. The llvm side of the commit contains the intrinsics and matching patterns.
llvm-svn: 130765
2011-05-03 17:29:43 +00:00
Jeffrey Yasskin 990a969892 Remove several more rvalue references from swap arguments in libstdc++4.4.
unique_ptr and shared_ptr changes by Daniel Mierswa!

llvm-svn: 130762
2011-05-03 17:28:13 +00:00
Lenny Maiorani 5066858bcd Removing strncpy() checking in CString checker for now. Some significant changes need to be made to properly support modeling of it since it potentially leaves strings non-null terminated.
llvm-svn: 130758
2011-05-03 16:34:26 +00:00
Devang Patel 85ac42339c Update metadata id number in string compare check.
llvm-svn: 130757
2011-05-03 16:19:38 +00:00
Daniel Dunbar ea1f098dbe Revert r130750, "Make the mno flags match GCC. Patch by Alexander Best!", it breaks tests.
llvm-svn: 130753
2011-05-03 15:34:01 +00:00
Michael J. Spencer c30448222a Make the mno flags match GCC. Patch by Alexander Best!
llvm-svn: 130750
2011-05-03 04:35:54 +00:00
Ted Kremenek 9c10d0a3ce Use the canonical decl when generating the locations for USRs.
llvm-svn: 130748
2011-05-03 01:33:35 +00:00
Richard Trieu 6a505baa57 Added an assert to IntegerLiteral to ensure that the integer type passed in has the same size as the APInt passed in. Also, updated the comments around IntegerLiteral.
Changed the integer type that range-based for-loops used.  Switched to pointer difference type, which satisfies the new assert in IntegerLiteral.

llvm-svn: 130739
2011-05-02 23:00:27 +00:00