Commit Graph

9265 Commits

Author SHA1 Message Date
Bob Wilson db04141f9a Re-enable test with modifications for Neon vector changes in clang.
I mistakenly thought that this was checking for vector name mangling, but
it is not.  Since we're no longer wrapping Neon vectors in structs, this
test can just return a vector directly.  There are already other tests for
that, so just to make this interesting, change the test to return a struct
of two vectors.

llvm-svn: 119434
2010-11-17 00:44:53 +00:00
Douglas Gregor 68dbaead7b Fix source-range information for Objective-C properties. Previously,
we were just getting a range covering only the property name, which is
certainly not correct (and broke token annotation, among other
things). 

Also, teach libclang about the relationship between
@synthesize/@dynamic and @property, so we get property name and
cursor-reference information for @synthesize and @dynamic.

llvm-svn: 119409
2010-11-17 00:13:31 +00:00
John McCall 5b26f65b3d Reset the lifetime-managed flag between emission of the agg conditional
branches.  Fixes PR8623.

llvm-svn: 119408
2010-11-17 00:07:33 +00:00
John McCall 4f29b49de1 Support compound complex operations as l-values in C++. Add a test
case based on CodeGen/volatile-1.c which tests the current C++
semantics, and note the many, many places we fall short of them.

llvm-svn: 119402
2010-11-16 23:07:28 +00:00
Argyrios Kyrtzidis f89a56c74b Warn about arg1 && arg2 || arg3, as GCC 4.3+ does. Fixes rdar://8659922
llvm-svn: 119381
2010-11-16 21:00:12 +00:00
Bob Wilson 849857445f Temporarily disable this check for Neon vector type mangling.
I'll reenable it soon when I'm done reworking <arm_neon.h>.

llvm-svn: 119366
2010-11-16 19:08:19 +00:00
Ted Kremenek 0c27bcfd05 Static analyzer: Catch calls to malloc() with
allocation sizes of 0 bytes.

Fixes PR 2899.

llvm-svn: 119364
2010-11-16 18:47:04 +00:00
Argyrios Kyrtzidis 20ee5ae871 Emit a specific diagnostic when typedefing C++ bool, mirroring gcc.
Fixes rdar://8365458

llvm-svn: 119359
2010-11-16 18:18:13 +00:00
Chandler Carruth b19289331d This really seems like a boring set of fixes to our tests to make them more
independent of the underlying system. Let me know if any of these are too
aggressive.

llvm-svn: 119345
2010-11-16 10:26:08 +00:00
John McCall 07bb19667a Simplify some complex emission and implement correct semantics for
assignment to volatiles in C.  This in effect reverts some of mjs's
work in and around r72572.  Basically, the C++ standard is quite
clear, except that it lies about volatile behavior approximating
C's, whereas the C standard is almost actively misleading.

llvm-svn: 119344
2010-11-16 10:08:07 +00:00
Chandler Carruth 1c8383dccd Fix PR8625 and correctly interpret member-calls to static members when
producing warnings.

This feels really fragile, and I've not audited all other argument index-based
warnings. I suspect we'll grow this bug on another warning eventually. It might
be nice to adjust the argument indices when building up the attribute AST node,
as we already have to remember about the 'this' argument within that code to
produce correct errors.

llvm-svn: 119340
2010-11-16 08:49:43 +00:00
Chandler Carruth 743682bb9f Re-work the handling of implicit 'this' arguments and silly GCC-style attribute
argument indexes. This handles the offsets in a consistent manner for all of
the attributes which I saw working with these concepts. I've also added tests
for the attribute that motivated this: nonnull.

I consolidated the tests for format attributes into one file, and fleshed them
out a bit to trigger more of the warning cases. Also improved the quality of
some of the diagnostics that occur with invalid argument indices.

The only really questionable change here is supporting the implicit this
argument for the ownership attribute. I'm not sure it's really a sensible
concept there, but implemented the logic for consistency.

llvm-svn: 119339
2010-11-16 08:35:43 +00:00
Argyrios Kyrtzidis 9813d3221d Improve diagnostic for calling non-const method on const object. Fixes rdar://7743000
llvm-svn: 119336
2010-11-16 08:04:45 +00:00
Zhongxing Xu 1ade3267d7 Handle member initializer in C++ ctor.
- Add a new Kind of ProgramPoint: PostInitializer.
 - Still use GRStmtNodeBuilder. But special handling PostInitializer in 
   GRStmtNodeBuilder::GenerateAutoTransition().
 - Someday we should clean up the interface of GRStmtNodeBuilder.

llvm-svn: 119335
2010-11-16 07:52:17 +00:00
Bob Wilson bafdb73e79 Add a test for Neon vector mangling
llvm-svn: 119304
2010-11-16 00:32:31 +00:00
Bob Wilson 1d54ee75da Add tests for new Neon vector type attributes.
llvm-svn: 119303
2010-11-16 00:32:28 +00:00
John McCall 36459fdbad Add another case to the whitelist of cast kinds that can convert to bool.
Fixes PR8608.

llvm-svn: 119293
2010-11-16 00:12:50 +00:00
Ted Kremenek 18fb1665bf Remove invalid assertion from CFG builder. When building the CFG pieces for a ternary '?' expression,
it is possible for the confluence block to only have a single predecessor due to calls to 'noreturn'
functions.  Fixes assertion failure reported in PR 8619.

llvm-svn: 119284
2010-11-15 22:59:22 +00:00
Ted Kremenek db73d599b7 Relax assertion in SValuator so that we don't crash when analyzing a call via a function pointer that
casts the return value to something completely different.  While we need better reasoning here,
we should definately not crash.

llvm-svn: 119177
2010-11-15 20:09:42 +00:00
Fariborz Jahanian c961119dcd Restore these tests. I think I fixed the problem.
We shall see.

llvm-svn: 119158
2010-11-15 17:06:17 +00:00
Douglas Gregor ee430a39c3 Implement C++0x [temp.func.order]p3 (aka DR532) properly. In
particular, we only add the implement object parameter type if only
one of the function templates is a non-static member function
template.

Moreover, since this DR differs from existing practice in C++98/03,
this commit implements the existing practice (which ignores the
first parameter of the function template that is not the non-static
member function template) in C++98/03 mode.

llvm-svn: 119145
2010-11-15 15:41:16 +00:00
Zhongxing Xu fee455fcf5 Revert r118991.
Elidable CXXConstructExpr should inhibit calling destructor for temporary 
that is copied, not the one created. This is because eliding copy constructor 
means that the object that was to be copied will be constructed directly in 
memory the copy would be constructed in.

llvm-svn: 119044
2010-11-14 15:23:50 +00:00
John McCall 83fe49d1e1 Always emit full loads from volatile complex l-values.
Return the result of a complex assignment with the original values,
not by performing a load from the l-value;  this is the correct
semantics in C, although not in C++.

llvm-svn: 119037
2010-11-14 09:40:28 +00:00
NAKAMURA Takumi e82858299c test/CodeGenCXX/dyncast.cpp: Remove XFAIL:win32 with tweaking llvm/utils/FileCheck in r119023, due to DOSish crlf issue.
llvm-svn: 119024
2010-11-14 03:29:22 +00:00
Fariborz Jahanian 9b4dc09746 Removing these test till redo them so they won't depend
on the built compiler.

llvm-svn: 119013
2010-11-13 23:04:46 +00:00
Fariborz Jahanian e988bdac44 Block API patch to do copy ctor of copied-in cxx objects in
copy helper function and dtor of copied cxx objects
in dispose helper functions. __block variables
TBD next.

llvm-svn: 119011
2010-11-13 21:53:34 +00:00
Douglas Gregor 052caec1f3 When complaining about ambiguous overload resolution for a unary or
binary operator, provide the types.

llvm-svn: 119008
2010-11-13 20:06:38 +00:00
Douglas Gregor 72ebdabc5d When we're type-checking the result of calling a conversion function
(while computing user conversion sequences), make sure that a result
of class type is a complete class type. Had we gone through
ActOnCallExpr, this would have happened when we built the CallExpr.

Fixes PR8425.

llvm-svn: 119005
2010-11-13 19:36:57 +00:00
Chandler Carruth 456daba135 Switch to using %clang_cc1 properly rather than manually passing the -cc1 flag.
llvm-svn: 118996
2010-11-13 10:19:35 +00:00
Zhongxing Xu 1b038fa00f Do not add implicit dtors for CXXBindTemporaryExpr with elidable
CXXConstructExpr.

llvm-svn: 118991
2010-11-13 07:30:59 +00:00
Douglas Gregor 52773dcef6 Implement C++ [over.match.funcs]p4 as it concerns partial ordering of
function templates. Fixes PR8130.

llvm-svn: 118944
2010-11-12 23:44:13 +00:00
John McCall 31f82720d0 Replace one hack with a different hack: strip out the ObjectType
parameters to the Transform*Type functions and instead call out
the specific cases where an object type and the unqualified lookup
results are important.  Fixes an assert and failed compile on
a testcase from PR7248.

llvm-svn: 118887
2010-11-12 08:19:04 +00:00
Ted Kremenek bb437a6999 Fix use of an uninitialized SourceLocation because DeclarationNameLoc failed to completely zero-initialize itself.
Now we explicitly memset all of its values.

This bug was uncovered by the 'Index/recursive-cxx-member-calls.cpp', which exhibited an assertion
on an i386 darwin build of clang.  Adding this test case back since the assertion is now resolved.

llvm-svn: 118881
2010-11-12 04:25:07 +00:00
Douglas Gregor cbd0710a12 When performing initialization of a copy of a temporary object, use
direct-initialization (rather than copy-initialization) to initialize
the temporary, allowing explicit constructors. Fixes PR8342.

llvm-svn: 118880
2010-11-12 03:34:06 +00:00
Ted Kremenek 843c53828f RegionStore/BasicStore: do not return UndefinedVal for accesses to concrete addresses; instead return UnknownVal. This
leads it up to checkers (e.g., DereferenceChecker) to guard against illegal accesses (e.g., null dereferences).

Fixes PR 5272 and <rdar://problem/6839683>.

llvm-svn: 118852
2010-11-11 23:10:10 +00:00
Ted Kremenek b76f2402b0 Temporarily remove this test. It is causing an assertion failure in the builtbot.
llvm-svn: 118785
2010-11-11 08:17:57 +00:00
Ted Kremenek c7a5bae597 Annotate tokens in a separate thread to avoid blowing out stack space. While the CursorVisitor
is gradually becoming more data recursive, AnnotateTokensVisitor does its own recursive call
within the visitor that can still blow out the stack.  This can potentially be reworked to avoid this,
but for now just do token annotation on a separate thread.

llvm-svn: 118783
2010-11-11 08:05:23 +00:00
Ted Kremenek 92209a45b9 Generalize data-recursive visitation in CursorVisitor to also handle MemberExprs
and CXXCallMemberExprs.  This scheme is hopefully general enough to extend to the
rest of the visitor if necessary.

llvm-svn: 118782
2010-11-11 08:05:18 +00:00
John McCall deebbcf20d Undo a refactor-o and base the bitfield-truncation warning on the
uncoerced value.  Also, whitelist bool bitfields, which aren't
really a truncation.

llvm-svn: 118778
2010-11-11 05:33:51 +00:00
NAKAMURA Takumi 78e3fdb8a7 test/CMakeLists.txt: Use ${LLVM_LIT_ARGS} and remove redundant arguments "-sv" and "--no-progress-bar".
llvm-svn: 118777
2010-11-11 04:09:51 +00:00
John McCall 1f425648ca Extend the bitfield-truncation warning to initializations.
rdar://problem/8652606

llvm-svn: 118773
2010-11-11 03:21:53 +00:00
Douglas Gregor 44c6ee7729 Improve ASTUnit's capture of diagnostics so that the
diagnostic-capturing client lives as long as the ASTUnit itself
does. Otherwise, we can end up with crashes when we get a diagnostic
outside of parsing/code completion. The circumstances under which this
happen are really hard to reproduce, because a file needs to change
from under us.

llvm-svn: 118751
2010-11-11 00:39:14 +00:00
Fariborz Jahanian 2a5deb56a4 Adding couple of Block API, a bug fix and
a test change, all for blocks. wip.

llvm-svn: 118745
2010-11-11 00:11:38 +00:00
John McCall 817d4af557 When -Wconversion computes the range of a type, it uses the (bit-)range
of the enumerators rather than the actual expressible range.  This is 
great when dealing with opaque *values* of that type, but when computing
the range of the type for purposes of converting *into* it, it produces
warnings in cases we don't care about (e.g. enum_t x = 500;).  Divide 
the logic into these two cases and use the more conservative range for
targets.    

llvm-svn: 118735
2010-11-10 23:38:19 +00:00
Devang Patel 82abab0812 test case for r118726.
llvm-svn: 118727
2010-11-10 22:19:57 +00:00
Douglas Gregor 869853eea1 Instantiate class member template partial specialization declarations
in the order they occur within the class template, delaying
out-of-line member template partial specializations until after the
class has been fully instantiated. This fixes a regression introduced
by r118454 (itself a fix for PR8001).

llvm-svn: 118704
2010-11-10 19:44:59 +00:00
Fariborz Jahanian a0a9d85a5d Check for duplicate declaration of a property in current and
other class extensions. // rdar://7629420

llvm-svn: 118689
2010-11-10 18:01:36 +00:00
John McCall ad31b5f2cb Propagate the deprecated and unavailable attributes from a
@property declaration to the autogenerated methods.  I'm uncertain
whether this should apply to attributes in general, but these are
a reasonable core.

Implements rdar://problem/8617301

llvm-svn: 118676
2010-11-10 07:01:40 +00:00
Argyrios Kyrtzidis 2703bebc58 Replace UsingDecl's SmallPtrSet of UsingShadowDecls with a linked list to avoid leaking memory.
Fixes rdar://8649963.

llvm-svn: 118674
2010-11-10 05:40:41 +00:00
John McCall a8987a294d Friend function declarations can overload with tag declarations.
Fixes PR7915.

llvm-svn: 118670
2010-11-10 03:01:53 +00:00
John McCall 9b72f89f0f Diagnose attempst to template using declarations and using directives.
Recover from the latter and fail early for the former.  Fixes PR8022.

llvm-svn: 118669
2010-11-10 02:40:36 +00:00
John McCall fd81c52947 Tweak to bitfield-overflow warning: don't warn about storing
a positive value into a signed bitfield of the exact width of
the value.

llvm-svn: 118657
2010-11-10 00:26:50 +00:00
John McCall 0e6cfaf6c0 Typo.
llvm-svn: 118649
2010-11-09 23:36:43 +00:00
John McCall d2a5312e14 Add a warning for implicit truncation of constant values due to
bitfield assignment.

Implements rdar://problem/7809123

llvm-svn: 118647
2010-11-09 23:24:47 +00:00
John McCall 18a2c2c0b9 Split out -Wconversion warnings about constant precision into their
own subcategory, -Wconstant-conversion, which is on by default.

Tweak the constant folder to give better results in the invalid
case of a negative shift amount.

Implements rdar://problem/6792488

llvm-svn: 118636
2010-11-09 22:22:12 +00:00
Fariborz Jahanian b332ba3a51 Test moved to its correct place.
llvm-svn: 118635
2010-11-09 21:40:30 +00:00
Fariborz Jahanian d11da7e52a Restore patch reversed in r118475. Fixes
// rdar://8632525

llvm-svn: 118634
2010-11-09 21:38:20 +00:00
Douglas Gregor 0124e9ba9a Attempt to resolve overloaded functions in comma expressions and
conditional operators. Fixes PR7863.

llvm-svn: 118631
2010-11-09 21:07:58 +00:00
Fariborz Jahanian dbee986290 Issues good diagnostic when @end is missing.
// rdar://8283484

llvm-svn: 118629
2010-11-09 20:38:00 +00:00
Chris Lattner 0786544ac5 fix PR8380, a crash on invalid due to an illogical DeclSpec SourceRange being constructed.
llvm-svn: 118625
2010-11-09 20:14:26 +00:00
Douglas Gregor 928479e727 Revert the fix for PR8013.
That bug concerned the well-formedness of code such as (&ovl)(a, b,
c). GCC rejects the code, while EDG accepts it. On further study of the
standard, I see no support for EDG's position: in particular, C++
[over.over] does not list this as a context where we can take the
address of an overloaded function, C++ [over.call.func] does not
reference the address-of operator at any point, and C++ [expr.call]
claims that the function argument in a call is either a function
lvalue or a pointer-to-function; (&ovl) is neither.

llvm-svn: 118620
2010-11-09 20:03:54 +00:00
Charles Davis 99202b358f Use the right calling convention when mangling names in the Microsoft C++
mangler. Now member functions and pointers thereof have their calling
convention mangled as __thiscall if they have the default CC (even though,
they technically still have the __cdecl CC).

llvm-svn: 118598
2010-11-09 18:04:24 +00:00
Douglas Gregor 8f225bb508 Handle overload resolution when calling an overloaded function set
with, e.g., (&f)(a, b, c). Fixes PR8013.

llvm-svn: 118508
2010-11-09 16:13:15 +00:00
Douglas Gregor ba57154614 Make #pragma unused work for static local variables.
llvm-svn: 118500
2010-11-09 14:57:47 +00:00
Douglas Gregor 229bebdeb5 ntroduce clang_getSpellingLocation() into libclang, to provide the
location where we're spelling a token even within a
macro. clang_getInstantiationLocation() tells where we instantiated
the macro.

I'm still not thrilled with the CXSourceLocation/CXSourceRange APIs,
since they gloss over macro-instantiation information.

Take 2: this time, adjusted tests appropriately and used a "simple"
approach to the spelling location.

llvm-svn: 118495
2010-11-09 06:24:54 +00:00
Douglas Gregor 12a610d1fa Revert r118492, which didn't update all of its tests accordingly
llvm-svn: 118494
2010-11-09 05:52:02 +00:00
Douglas Gregor d1ea3f0d29 Introduce clang_getSpellingLocation() into libclang, to provide the
location where we're spelling a token even within a
macro. clang_getInstantiationLocation() tells where we instantiated
the macro.

I'm still not thrilled with the CXSourceLocation/CXSourceRange APIs,
since they gloss over macro-instantiation information.

llvm-svn: 118492
2010-11-09 05:28:47 +00:00
Douglas Gregor 2927c0c817 Teach code completion not to include out-of-line declarations and
definitions in its results. The original declarations will be visible
wherever they are declared.

llvm-svn: 118484
2010-11-09 03:59:40 +00:00
Argyrios Kyrtzidis 8b4cf00cdc Fix the test for Release.
llvm-svn: 118483
2010-11-09 03:43:49 +00:00
Douglas Gregor 4aff944f1a Add __nullptr as a C++0x nullptr literal, available in C++98
llvm-svn: 118482
2010-11-09 03:43:04 +00:00
Douglas Gregor 23ab745e79 Fix source locations in unnamed bitfield diagnostic, from Jakub
Wieczorek! Fixes PR8025.

llvm-svn: 118481
2010-11-09 03:31:16 +00:00
Fariborz Jahanian 1e2d01e77d Remove this test for now.
llvm-svn: 118476
2010-11-09 02:24:38 +00:00
Fariborz Jahanian 3655e59688 Reverse patch for // rdar://8632525. It might
has broken a build.

llvm-svn: 118475
2010-11-09 02:24:08 +00:00
Fariborz Jahanian 115393ce66 Remove space from rdar URIs.
llvm-svn: 118474
2010-11-09 02:16:57 +00:00
Ted Kremenek dcf85a8d18 Teach AttrNonNullChecker about transparent unions. Fixes crash reported in <rdar://problem/8642434>.
llvm-svn: 118473
2010-11-09 02:11:43 +00:00
Argyrios Kyrtzidis 8909686b22 Fix miscompilation regarding VLAs; subscription of VLA pointers was incorrect.
Fixes rdar://8644873 & http://llvm.org/PR8567.

llvm-svn: 118468
2010-11-09 01:30:48 +00:00
John McCall 478382521e When re-using a vtable slot for the nearest overridden method, just because
there's no return adjustment from the overridden to the overrider doesn't
mean there isn't a return adjustment from the overrider to the final
overrider.  This matters if we're emitting a virtual this-adjustment thunk
because the overrider virtually inherits from the class providing the
nearest overridden method.  Do the appropriate return adjustment in this case.

Fixes PR7611.

llvm-svn: 118466
2010-11-09 01:18:05 +00:00
Nick Lewycky 6147891648 Don't lose track of previous-declarations when instantiating a class template.
Fixes PR8001.

llvm-svn: 118454
2010-11-08 23:29:42 +00:00
Fariborz Jahanian 94ad274c24 Provide a precise builtin declaration for objc_msgSend
to avoid a bogus warning. Fixes //rdar: //8632525

llvm-svn: 118451
2010-11-08 22:53:18 +00:00
Ted Kremenek 15c1e368bb Add CursorVisitor::VisitBinaryOperator() to explicitly handle the case where we can blow out the stack due
to deeply nested BinaryOperators.  This is done by turning the explicit recursion into being data recursive.

Fixes: <rdar://problem/8289205>
llvm-svn: 118444
2010-11-08 21:14:15 +00:00
Douglas Gregor dc520b0f08 If an instance method messages is sending to an expression of type Class,
and we statically can compute a bound on the actual type (e.g.,
because it's a send to the the magic "class" instance method), code
complete as if we were performing a class message send to that class.

llvm-svn: 118443
2010-11-08 21:12:30 +00:00
John McCall f71b45367f Document Clang's support for attributes on individual enumerators and
tweak the documentation for deprecation-with-message.  Provide __has_feature
tests for both.  rdar://problem/8605692

llvm-svn: 118435
2010-11-08 19:48:17 +00:00
Argyrios Kyrtzidis 8566356acb When building a compound literal, check that the base element of the array is complete.
Fixes rdar://8620582 & http://llvm.org/PR7905

llvm-svn: 118428
2010-11-08 19:14:19 +00:00
Fariborz Jahanian 086a24a2be Fixes a rewrite bug, rewriting nested property usage
inside blocks. Fixes //rdar: //8608293.

llvm-svn: 118425
2010-11-08 18:37:50 +00:00
Douglas Gregor bd6b17f4ef Improve our handling of C++ [class.copy]p3, which specifies that a
constructor template will not be used to copy a class object to a
value of its own type. We were eliminating all constructor templates
whose specializations look like a copy constructor, which eliminated
important candidates. Fixes PR8182.

llvm-svn: 118418
2010-11-08 17:16:59 +00:00
Douglas Gregor bcd625305b When attempting reference binding to an overloaded function, also
consider that we might be trying to bind a reference to a class type,
which involves a constructor call. Fixes PR7425.

llvm-svn: 118407
2010-11-08 15:20:28 +00:00
Douglas Gregor b0a746e391 Add missing test case for PR8230
llvm-svn: 118402
2010-11-08 03:58:01 +00:00
Douglas Gregor e81f58e180 Properly diagnose invalid casts to function references. Patch by
Faisal Vali, tweaked by me. Fixes PR8230.

llvm-svn: 118400
2010-11-08 03:40:48 +00:00
NAKAMURA Takumi 2fbf57a949 test/CodeGenCXX/rtti-linkage.cpp: Get rid of sort(1) to remove XFAIL: win32.
On the certain system, bogus SORT.EXE is picked up. Its sort-order is incompatible to POSIX.

llvm-svn: 118391
2010-11-08 01:05:10 +00:00
Douglas Gregor 1ccc8416a0 Remove broken support for variadic templates, along with the various
abstractions (e.g., TemplateArgumentListBuilder) that were designed to
support variadic templates. Only a few remnants of variadic templates
remain, in the parser (parsing template type parameter packs), AST
(template type parameter pack bits and TemplateArgument::Pack), and
Sema; these are expected to be used in a future implementation of
variadic templates.

But don't get too excited about that happening now.

llvm-svn: 118385
2010-11-07 23:05:16 +00:00
Rafael Espindola c8f008f649 Use ld directly on linux. Changes from the previous try:
*) Try to detect as much as possible from the system itself, not the distro.
   This should make it easier to port to a new distro and more likely to
   work on a unknown one.
*) The distro enum now doesn't include the arch. Just use the existing
   host detection support in LLVM.
*) Correctly handle --sysroot.

A small regression is that now clang will pass bitcode file to the linker.
This is necessary for the gold plugin support to work.

It might be better to detect this at configure/cmake time, but doing it in
c++ first is a lot easier.

llvm-svn: 118382
2010-11-07 20:14:31 +00:00
Anders Carlsson 2ceb347e8b A union cannot contain static data members or data members of reference type.
llvm-svn: 118381
2010-11-07 19:13:55 +00:00
John McCall 2faab302e0 ARM EH uses a different personality function in C.
llvm-svn: 118366
2010-11-07 02:35:25 +00:00
Anders Carlsson 3fd50319d3 Don't warn when matching %p to nullptr.
llvm-svn: 118344
2010-11-06 14:58:53 +00:00
John McCall cdf7ef5437 Simplify the logic for emitting guard variables for template static
data members by delaying the emission of the initializer until after
linkage and visibility have been set on the global.  Also, don't
emit a guard unless the variable actually ends up with vague linkage,
and don't use thread-safe statics in any case.

llvm-svn: 118336
2010-11-06 09:44:32 +00:00
Argyrios Kyrtzidis 7d391557cc When determining which template partial specialization is more specialized,
make sure to setup the instantiation stack. Fixes rdar://8620775 & http://llvm.org/PR8234

llvm-svn: 118314
2010-11-05 23:25:18 +00:00
Douglas Gregor 25edf4302f When searching for an instantiated declaration requires instantiation
of its parent context, be sure to update the parent-context pointer
after instantiation. Fixes two anonymous-union instantiation issues in
<rdar://problem/8635664>.

llvm-svn: 118313
2010-11-05 23:22:45 +00:00
Argyrios Kyrtzidis 452707c125 Read/write from/to PCH the diagnostic mappings that the user set so that e.g. #pragma clang diagnostic can be used in a PCH.
Fixes rdar://8435969.

llvm-svn: 118303
2010-11-05 22:10:18 +00:00
Douglas Gregor 16443fdd31 Teach clang_getCursorReferenced() that a
CXXConstructorExpr/CXXTemporaryObjectExpr references the constructor
it calls. Then, tweak clang_getCursor() to prefer such a call over a
type reference to the type being called.

llvm-svn: 118297
2010-11-05 21:11:19 +00:00
Fariborz Jahanian 90d2e57ff7 Proper rewriting of block envokation with
qualified ObjC pointer types in its argument list.
// rdar: //8608902

llvm-svn: 118286
2010-11-05 18:34:46 +00:00