Commit Graph

20125 Commits

Author SHA1 Message Date
Rafael Espindola ba195cff81 Use attributes from the definition (if available) when
instantiating functions.

Fixes PR10272.

llvm-svn: 134491
2011-07-06 15:46:09 +00:00
Joerg Sonnenberger fbc0b3a826 Fix C&P error
llvm-svn: 134490
2011-07-06 11:00:56 +00:00
John McCall 542e7c6f64 When tree-transforming an expression sequence, always flag expanded
variadic argument pack expansions as having changed, rather than doing
it for each changed expansion, which leaves out zero-argument packs
with catastrophic consequences.

Fixes PR10260.

llvm-svn: 134483
2011-07-06 07:30:07 +00:00
John McCall 21878760a4 Fixed enum types can be complete without actually being valid to use
as scope specifiers;  diagnose the attempt, rather than letting it go
to an assert.  The rest of PR10264.

llvm-svn: 134479
2011-07-06 06:57:57 +00:00
John McCall cb432faf6d Properly protect colons when parsing a nested-name-specifier as part
of an enum specifier in dialects which permit fixed underlying types.
Fixes the rejects-valid part of PR10264.

llvm-svn: 134468
2011-07-06 05:58:41 +00:00
John McCall 75bc773be5 Somehow the -fgnu-runtime option itself got lost in all that shuffling.
Restore it.

llvm-svn: 134459
2011-07-06 02:36:30 +00:00
John McCall 9de1978f6e Call objc_terminate() instead of abort() when a cleanup throws an
exception in Objective-C;  in Objective-C++ we still use std::terminate().
This is only available in very recent runtimes.

llvm-svn: 134456
2011-07-06 01:22:26 +00:00
John McCall 6dd2417dbe Missing header from last commit; accidental change.
llvm-svn: 134455
2011-07-06 00:38:59 +00:00
Fariborz Jahanian 76b9d4da16 Added a missing case label.
llvm-svn: 134454
2011-07-06 00:29:51 +00:00
John McCall 24fc0decfe Change the driver's logic about Objective-C runtimes: abstract out a
structure to hold inferred information, then propagate each invididual
bit down to -cc1.  Separate the bits of "supports weak" and "has a native
ARC runtime";  make the latter a CodeGenOption.

The tool chain is still driving this decision, because it's the place that
has the required deployment target information on Darwin, but at least it's
better-factored now.

llvm-svn: 134453
2011-07-06 00:26:06 +00:00
Fariborz Jahanian b7a773626f objc-arc: enforce performSelector rules in rejecting retaining selectors
passed to it, and unknown selectors causing potential leak.
// rdar://9659270

llvm-svn: 134449
2011-07-05 22:38:59 +00:00
Dan Gohman fec0ff84dc Add the ObjC ARC optimization passes manually, now that they're not
hardwired into the default pass list.

llvm-svn: 134445
2011-07-05 22:02:36 +00:00
Eli Friedman bb5c9ae425 Remove unused member of Builtin::Info.
llvm-svn: 134443
2011-07-05 21:53:01 +00:00
Joerg Sonnenberger f8fa4443b3 Drop "soft" argument that would be considered as file argument by cc1.
llvm-svn: 134438
2011-07-05 19:52:46 +00:00
Douglas Gregor b7c0083878 Look through parenthesized declarators when determining whether an
instantiated function template was written with a prototype or via
some kind of typedef. Fixes PR10273 / <rdar://problem/9723679>. 

llvm-svn: 134426
2011-07-05 18:30:26 +00:00
Joerg Sonnenberger 8360e523cf Hook up mipsel-netbsd and mipsel-freebsd for OS specific handling.
llvm-svn: 134425
2011-07-05 18:24:04 +00:00
Joerg Sonnenberger d60cccfecc Use OS-specific configuration for mips-netbsd and mips-freebsd.
llvm-svn: 134422
2011-07-05 18:05:54 +00:00
Douglas Gregor 6b9be0ffb3 Some documentation fixes for the parser, from John Freeman
llvm-svn: 134419
2011-07-05 17:13:11 +00:00
Douglas Gregor 1cb4290b89 StringRef'ize clang::drive::Option::getName(), from Zach Wheeler!
llvm-svn: 134418
2011-07-05 16:56:25 +00:00
Douglas Gregor 9e66af44ad Clean up and refactor ParseFunctionDeclarator to reduce code
repetition and better reflect the actual grammar, from John Freeman!

llvm-svn: 134417
2011-07-05 16:44:18 +00:00
Douglas Gregor 1fe12c9eba ActOnCXXConditionDeclaration should take into account that
ActOnDeclarator can return NULL. Fixes PR10270, from Hans Wennborg!

llvm-svn: 134416
2011-07-05 16:13:20 +00:00
Fariborz Jahanian bf3eec68dd Don't define __CONSTANT_CFSTRINGS__ with -fno-constant-cfstrings issue.
Patch by Jean-Daniel Dupas.

llvm-svn: 134414
2011-07-05 16:00:59 +00:00
Joerg Sonnenberger 870b3c5429 Don't define _BIG_ENDIAN for NetBSD/PowerPC.
llvm-svn: 134411
2011-07-05 14:56:12 +00:00
Joerg Sonnenberger a6d11777f9 Fix indentation
llvm-svn: 134410
2011-07-05 14:54:41 +00:00
Douglas Gregor c9c40ce861 Teach Clang's <float.h> to also include MinGW's <float.h>, which provides additional system definitions, from Ruben Van Boxem
llvm-svn: 134407
2011-07-05 14:17:04 +00:00
Douglas Gregor c750b6c436 Update header-search paths for MinGW, from Ruben Van Boxem
llvm-svn: 134406
2011-07-05 14:16:05 +00:00
Benjamin Kramer e87c38b229 Don't overread the buffer when an %x escape in inline asm ends prematurely.
Tested by valgrind & Sema/asm.c.

llvm-svn: 134404
2011-07-05 11:13:37 +00:00
Benjamin Kramer de1d62314a Initialize member.
llvm-svn: 134403
2011-07-05 09:46:31 +00:00
Joerg Sonnenberger f031fd9e77 Add explicit default case for -Wswitch-enum.
llvm-svn: 134399
2011-07-04 23:11:58 +00:00
Joerg Sonnenberger 025949c366 Use switch(os) style consistently. Add a bunch of NetBSD branches.
llvm-svn: 134393
2011-07-04 21:59:44 +00:00
Joerg Sonnenberger e72d9b1f85 On PowerPC, both FreeBSD and NetBSD use ints for (s)size_t
llvm-svn: 134392
2011-07-04 21:57:55 +00:00
Anders Carlsson 1052fd76ab Remove unused parameter from ActOnDeclarator.
llvm-svn: 134377
2011-07-04 16:28:17 +00:00
Chandler Carruth bfb154ad3f Switch the Decl and Stmt stats printing to use llvm::errs() instead of
fprintf, and to be more consistent in formatting with the other stats
printing routines.

llvm-svn: 134374
2011-07-04 06:13:27 +00:00
Chandler Carruth 3c147a7731 Start switching the AST stats printing to use llvm::errs() instead of
fprintf. There is more cleanup to be done to the AST stats printing...

llvm-svn: 134373
2011-07-04 05:32:14 +00:00
Abramo Bagnara 9ae292d810 Rewritten fix in r134139 to conform evaluation result to original evaluation context.
llvm-svn: 134320
2011-07-02 13:13:53 +00:00
Nick Lewycky 0bdf13ea9a Fix a typo, remove a tab, canonicalize some spacing. No functional change.
llvm-svn: 134305
2011-07-02 02:05:12 +00:00
Douglas Gregor 4326dd9bcc When producing -Wuninitialized Fix-Its for pointers, prefer " = NULL"
over "= 0". Fixes <rdar://problem/9714386>.

llvm-svn: 134302
2011-07-02 00:59:18 +00:00
Eli Friedman 1310c68bb0 Don't use x86_mmx where it isn't necessary.
The start of some work on getting -mno-mmx working the way we want it to.

llvm-svn: 134300
2011-07-02 00:57:27 +00:00
Chandler Carruth 42f96b78ec Make the GCC version proliferation worse by N+1 for the sake of
ArchLinux. =/ Fixes PR10246.

llvm-svn: 134299
2011-07-02 00:51:03 +00:00
Eli Friedman ad811f01d5 Make clang behave in a gcc-compatible way in the presence of multiple flags for the same x86 target feature (e.g. -mno-sse -msse). gcc uses a somewhat unintuitive algorithm here in that the enabled SSE instructions is based on the order of the *last* flag for *each* feature-level, so that "-mno-sse -msse2" only enables SSE2, but "-mno-sse -msse2 -msse" enables all SSE levels.
Issue reported on cfe-dev.

llvm-svn: 134296
2011-07-02 00:34:19 +00:00
Eric Christopher bf15d2b311 Update for llvm commit r134291.
Fixes rdar://9714064

llvm-svn: 134292
2011-07-02 00:20:22 +00:00
Chandler Carruth edc2c64630 Move the Sema argument to all of the Sema-using helper functions in
SemaDeclAttr to the first argument. This makes them follow the very
consistent policy elsewhere in Sema for helper functions.

Original patch by Caitlin Sadowski, with some tweaking by me.

llvm-svn: 134290
2011-07-02 00:01:44 +00:00
Chandler Carruth 3ed22c35d6 Rename static helpers to use 'camelCaseNames' per the new style
recommendations before adding more of them.

Patch by Caitlin Sadowski.

llvm-svn: 134289
2011-07-01 23:49:16 +00:00
Chandler Carruth ff4c4f0f8a Mechanical rename of 'd' Decl pointer parameters to 'D'. This is more
conventional in the rest of Clang's codebase, and closer to the current
style recommendations. It also makes the code more internally consistent
as FD, VD, etc are used frequently for particular decl variables.

Patch by Caitlin Sadowski.

llvm-svn: 134288
2011-07-01 23:49:12 +00:00
Argyrios Kyrtzidis 8e25253e14 -Fix mistake in ASTContext::getInnerObjCOwnership noticed by Doug
-Remove unnecessary 'return'.
-Remove unnecessary 'if' check (llvm_unreachable make sure attrStr will be non-null)
-Add a test of transferring ownership to a reference cast type.

llvm-svn: 134285
2011-07-01 23:01:46 +00:00
Douglas Gregor 9fabd851c8 Add initial *-*-rtems* target, from Joel Sherrill
llvm-svn: 134283
2011-07-01 22:41:14 +00:00
Argyrios Kyrtzidis 451ccc0892 Fix the warning that is emitted when an ownership attribute is applied incorrectly.
llvm-svn: 134278
2011-07-01 22:23:09 +00:00
Argyrios Kyrtzidis 9ab661b163 Use transferARCOwnershipToDeclaratorChunk in inferARCWriteback, no functionality change.
llvm-svn: 134277
2011-07-01 22:23:05 +00:00
Argyrios Kyrtzidis ea57a9be17 Fix assertion hit in inferARCWriteback.
llvm-svn: 134276
2011-07-01 22:23:03 +00:00
Argyrios Kyrtzidis 7192a3b841 [ARC] When casting from a pointer to an objective-c object with known ownership, if the
cast type has no ownership specified, implicitly "transfer" the ownership of the cast'ed type
to the cast type:

id x;
(NSString**)&x; // Casting as (__strong NSString**).

llvm-svn: 134275
2011-07-01 22:22:59 +00:00
Argyrios Kyrtzidis d8701b60f7 -Remove Sema::ActOnCastOfParenListExpr and move most of its functionality to
newly introduced Sema::BuildVectorLiteral.
-Make Sema::ActOnCastExpr handle a vector initializer both when the cast'ed expression
 is a ParenListExpr and when it is a ParenExpr.
-Ultimately make Sema::ActOnParenOrParenListExpr independent of what the cast type was.

llvm-svn: 134274
2011-07-01 22:22:54 +00:00
Argyrios Kyrtzidis 7451d1cd00 [ARC] When casting from a pointer to an objective-c object with known ownership, if the
cast type has no ownership specified, implicitly "transfer" the ownership of the cast'ed type
to the cast type:

id x;
static_cast<NSString**>(&x); // Casting as (__strong NSString**).

This currently only works for C++ named casts, C casts to follow.

llvm-svn: 134273
2011-07-01 22:22:50 +00:00
Argyrios Kyrtzidis e9b5c85041 Break Sema::GetTypeForDeclarator in 2 functions, one for DeclSpec processing and another for the rest.
No functionality change.

llvm-svn: 134272
2011-07-01 22:22:42 +00:00
Argyrios Kyrtzidis 774506918c Introduce Declarator::ObjCCatchContext, this will result in correct error for 'auto' in obj-c catch.
llvm-svn: 134271
2011-07-01 22:22:40 +00:00
Douglas Gregor fa918f69f6 Emit guard variables for any weak global that has a run-time
initializer. Previously, we only used guard variables for weak static
data members. Fixes <rdar://problem/9692249>.

llvm-svn: 134266
2011-07-01 21:54:36 +00:00
Douglas Gregor 3b22a88488 When adding boolean keywords for typo correction, add either "bool" or
"_Bool" (depending on dialect), but not both, since they have the same
edit distance from "Bool".

llvm-svn: 134263
2011-07-01 21:27:45 +00:00
Douglas Gregor 82e1af20cb Don't zero-initialize default-initialized local variables that have
trivial default constructors. This generated-code regression was
caused by r131796, which had simplified the handling of default
initialization in Sema. Fixes <rdar://problem/9694300>.

llvm-svn: 134260
2011-07-01 21:08:19 +00:00
Richard Trieu 94942b32a3 For code such as:
int f(int x) {
  if (int foo = f(bar)) {}
  return 0;
}

Clang produces the following error messages:

paren_imbalance.cc:2:19: error: use of undeclared identifier 'bar'
  if (int foo = f(bar)) {}
                  ^
paren_imbalance.cc:2:26: error: expected ')'
  if (int foo = f(bar)) {}
                        ^
paren_imbalance.cc:2:6: note: to match this '('
  if (int foo = f(bar)) {}
     ^

The second error is incorrect.  This patch will stop Clang from producing an error on parenthesis imbalance during error recovery when there isn't one.

llvm-svn: 134258
2011-07-01 20:54:02 +00:00
Richard Trieu 95d880933b Fix for PR7410. Allow functions in a derived class that improperly overwrite a virtual function in the base class to be inserted into the derived class function list to prevent extra errors every time the derived class is used.
llvm-svn: 134251
2011-07-01 20:02:53 +00:00
Richard Smith cd1c055528 Fix AST representations of alias-declarations which define tag types. Inside classes, the tag types need to have an associated access specifier, and inside function definitions, they need to be included in the declarations of the DeclStmt. These issues manifested as assertions during template instantiation, and also in a WIP constexpr patch.
llvm-svn: 134250
2011-07-01 19:46:12 +00:00
Douglas Gregor 3cc1581020 When we create a precompiled preamble, don't copy the
CompilerInvocation on the stack, because other objects (e.g., the
CompilerInstance) maintain an intrusive reference-counted pointer to
the CompilerInvocation. This doesn't matter in the normal case,
because we take back the CompilerInvocation. However, during crash
recovery, this leads to us trying to free an object on the stack, and
hilarity ensues. Fixes <rdar://problem/9652540>.

llvm-svn: 134245
2011-07-01 18:22:13 +00:00
John McCall 2de1c33f77 Just mangle substituted template parameter types as unresolved types.
This is kindof questionable but seems to do more-or-less the right thing.
This is not a particularly friendly part of the ABI.

llvm-svn: 134227
2011-07-01 02:19:08 +00:00
Douglas Gregor 678d76c026 Introduce the notion of instantiation dependence into Clang's AST. A
type/expression/template argument/etc. is instantiation-dependent if
it somehow involves a template parameter, even if it doesn't meet the
requirements for the more common kinds of dependence (dependent type,
type-dependent expression, value-dependent expression).

When we see an instantiation-dependent type, we know we always need to
perform substitution into that instantiation-dependent type. This
keeps us from short-circuiting evaluation in places where we
shouldn't, and lets us properly implement C++0x [temp.type]p2.

In theory, this would also allow us to properly mangle
instantiation-dependent-but-not-dependent decltype types per the
Itanium C++ ABI, but we aren't quite there because we still mangle
based on the canonical type in cases like, e.g.,

  template<unsigned> struct A { };
  template<typename T>
    void f(A<sizeof(sizeof(decltype(T() + T())))>) { }
  template void f<int>(A<sizeof(sizeof(int))>);

and therefore get the wrong answer.

llvm-svn: 134225
2011-07-01 01:22:09 +00:00
John McCall 3a4a4c5228 Change the mangling of enclosing template template parameters
that serve as the base template name of an unresolved-name to
be mangled as a substitution.

llvm-svn: 134213
2011-07-01 00:04:39 +00:00
John McCall db49969b32 No, actually, we do need to be able to mangle substituted template names.
llvm-svn: 134195
2011-06-30 21:59:02 +00:00
Hans Wennborg 77d1abef07 Fix off-by-one error in StringLiteral::getLocationOfByte.
This fixes PR10223.

llvm-svn: 134183
2011-06-30 20:17:41 +00:00
John McCall 0b645e9030 Perform lvalue-to-rvalue conversions on both operands of ->*
and the RHS of .*.  Noticed by Enea Zaffanella!

llvm-svn: 134170
2011-06-30 17:15:34 +00:00
Peter Collingbourne d395b9344d Replace an unreachable error path with an assert
(SourceManager::createFileID cannot return an invalid file ID).
Also update a comment to reflect this.

llvm-svn: 134168
2011-06-30 16:41:03 +00:00
David Chisnall 08d6733ed7 Add support for weakly imported classes (GNU runtime).
llvm-svn: 134140
2011-06-30 10:14:37 +00:00
Abramo Bagnara 2caedf449e Fixed enum constant evaluation assertions.
llvm-svn: 134139
2011-06-30 09:36:05 +00:00
Chandler Carruth 1406d6c037 Improve the wording of the warning when returning a value from
a constructor or destructor.

Patch by Hans Wennborg.

llvm-svn: 134138
2011-06-30 08:56:22 +00:00
John McCall d9dfe3a1f8 Preserve that a TemplateName was arrived at by substituting
for a template template parameter.

Uses to follow.

I've also made the uniquing of SubstTemplateTemplateParmPacks
use a ContextualFoldingSet as a minor space efficiency.

llvm-svn: 134137
2011-06-30 08:33:18 +00:00
Chandler Carruth c91f09d73a Fix an obvious typo in an attribute's diagnostics.
Patch by Caitlin Sadowski.

Unfortunately, this attribute doesn't seem to have a single test. It is
only mentioned in comments in one test, and as a string literal in
a copy of some Clang code checked in as a test for the Indexer. =[ It
dates from 2009 r74280 as part of OpenCL 1.0.

llvm-svn: 134136
2011-06-30 08:14:54 +00:00
Evan Cheng adc7959851 createTargetMachine now takes a CPU string.
llvm-svn: 134128
2011-06-30 02:06:32 +00:00
John McCall 8bdae58c3a Document and check tighter assumptions about the TemplateName of a
TemplateSpecializationType.

llvm-svn: 134120
2011-06-30 00:42:27 +00:00
Argyrios Kyrtzidis 8cc0459907 Introduce a caching mechanism for macro expanded tokens.
Previously macro expanded tokens were added to Preprocessor's bump allocator and never released,
even after the TokenLexer that were lexing them was finished, thus they were wasting memory.
A very "useful" boost library was causing clang to eat 1 GB just for the expanded macro tokens.

Introduce a special cache that works like a stack; a TokenLexer can add the macro expanded tokens
in the cache, and when it finishes, the tokens are removed from the end of the cache.

Now consumed memory by expanded tokens for that library is ~ 1.5 MB.

Part of rdar://9327049.

llvm-svn: 134105
2011-06-29 22:20:11 +00:00
Argyrios Kyrtzidis e379ee31c0 Introduce Preprocessor::getTotalMemory() and use it in CIndex.cpp, no functionality change.
llvm-svn: 134103
2011-06-29 22:20:04 +00:00
Douglas Gregor a82064ca27 Check for deprecated/unavailable/etc attributes on fields that are
initialized via initializer lists. Fixes <rdar://problem/9694686>.

llvm-svn: 134099
2011-06-29 21:51:31 +00:00
Douglas Gregor 825faf7a4f When redeclaring a local extern in the same scope, make sure that we
replace the existing declaration appropriately. Patch by Jordy Rose,
fixes PR10013 / <rdar://problem/9584157>.

llvm-svn: 134097
2011-06-29 21:22:02 +00:00
Fariborz Jahanian 326701e2c7 objc-arc: fix a IRGen crash when checking for
accessibility of an initializer which is a compound 
statement. // rdar://9694706

llvm-svn: 134091
2011-06-29 20:00:16 +00:00
Fariborz Jahanian 25e61c58bf Use existing -fcatch-undefined-behavior option,
replacing -freset-local-blocks. // rdar://9227352

llvm-svn: 134082
2011-06-29 18:41:17 +00:00
Bob Wilson 1957a2feb5 Use preferred 64-bit alignment for i64 & f64 for Thumb targets. Radar 9695134.
llvm-svn: 134070
2011-06-29 16:09:20 +00:00
David Chisnall 920e83b00b Add ARC support for the GNUstep runtime.
llvm-svn: 134065
2011-06-29 13:16:41 +00:00
Eli Friedman 4774b7e456 We don't pass classes with a copy-constructor or destructor byval, so the address takes up an integer register (if one is available). Make sure the x86-64 ABI implementation takes that into account properly.
The fixed implementation is compatible with the implementation both gcc and llvm-gcc use.

rdar://9686430 . (This is the issue that was reported in the thread "[LLVMdev] Segfault calling LLVM libs from a clang-compiled executable".)

llvm-svn: 134059
2011-06-29 07:04:55 +00:00
Evan Cheng eeb486dda5 SubtargetFeature.h has been moved to MC.
llvm-svn: 134050
2011-06-29 01:14:32 +00:00
Fariborz Jahanian fc510bdd94 Under a compiler flag, -freset-local-blocks,
wipe out stack blocks when they go out of scope.
// rdar://9227352

llvm-svn: 134045
2011-06-28 23:51:26 +00:00
Daniel Dunbar 421bb42c9f Revert r133024, "[format strings] correctly suggest correct type for '%@'
specifiers.  Fixes <rdar://problem/9607158>." because it causes false positives
on some code that uses CF toll free bridging.
 - I'll let Doug or Ted figure out the right fix here, possibly just to accept
   any pointer type.

llvm-svn: 134041
2011-06-28 23:33:55 +00:00
Chandler Carruth 7d85c9b6b2 Fix non-determinism in selecting between equal-length names which refer
to the same declaration when correcting typos. This is done by
essentially sorting the corrections as they're added.

Original patch by Kaelyn Uhrain, but modified for style and correctness
by accounting for more than just the textual spelling.

This still is a bit of a WIP hack to make this deterministic. Kaelyn
(and myself) are working on a more principled solution going forward.

llvm-svn: 134038
2011-06-28 22:48:40 +00:00
Chandler Carruth b198e5a911 Fix an invalid use of ::back() on an newly emptied vector. Also tighten
up several places where we never expect to have NULL pointers to assert
early.

This fixes a valgrind error within CorrectTypo, but not the
non-determinism.

llvm-svn: 134032
2011-06-28 21:43:34 +00:00
Daniel Dunbar 044a3908ef Driver/Darwin: -force_load can be specified multiple times.
llvm-svn: 134025
2011-06-28 20:16:02 +00:00
Eric Christopher fd9a5f4f66 Split out logic for valid clobbers and valid inline asm registers.
Fixes rdar://9281377

llvm-svn: 134016
2011-06-28 18:20:53 +00:00
Fariborz Jahanian b26d578b41 Eliminate most uses of ShallowCollectObjCIvars which requires
a vector for collection. Use iterators where needed instead.
// rdar://6817577

llvm-svn: 134015
2011-06-28 18:05:25 +00:00
John McCall 15547bbdd1 Be more thorough about mangling unresolved types.
llvm-svn: 134011
2011-06-28 16:49:23 +00:00
Douglas Gregor 29cdc6bec0 Dynamically allocate the StringMaps used in typo correction so that we
don't rely on the existence of a copy constructor.

llvm-svn: 134009
2011-06-28 16:44:39 +00:00
Douglas Gregor c2fa169d6c Add support for C++ namespace-aware typo correction, e.g., correcting
vector<int>

to

  std::vector<int>

Patch by Kaelyn Uhrain, with minor tweaks + PCH support from me. Fixes
PR5776/<rdar://problem/8652971>.

Thanks Kaelyn!

llvm-svn: 134007
2011-06-28 16:20:02 +00:00
Chris Lattner ac57f21cd1 Fix PR9279 - Macro expansion stack trace seriously broken with function-style macros, by not recursively printing notes for other 'instantiated from' notes.
This is a one line fix here:
+      // Don't print recursive instantiation notes from an instantiation note.
+      Loc = SM.getSpellingLoc(Loc);

While here, fix the testcase to be more precise (it got filecheck'ized
brutally), and fix EmitCaretDiagnostic to be private and to not pass down
the unused 'Level' argument.

llvm-svn: 133993
2011-06-28 05:11:33 +00:00
Argyrios Kyrtzidis 3ff13579f9 Introduce Declarator::CXXNewContext and remove 'AutoAllowedInTypeName' parameter
from Sema::GetTypeForDeclarator. No functionality change.

llvm-svn: 133987
2011-06-28 03:01:23 +00:00
Argyrios Kyrtzidis 7baa0af39b Centralize all checks for a C++ tag definition inside a typename in
Sema::GetTypeForDeclarator and remove its 'OwnedDecl' out parameter.

No functionality change.

llvm-svn: 133986
2011-06-28 03:01:18 +00:00
Argyrios Kyrtzidis ef7022f259 Centralize the check for a tag definition in a Declarator::PrototypeContext inside GetTypeForDeclarator.
No functionality change.

llvm-svn: 133985
2011-06-28 03:01:15 +00:00
Argyrios Kyrtzidis 8ea7e5838b Remove the call to GetTypeForDeclarator in Sema::ActOnCXXConditionDeclaration.
No functionality change.

llvm-svn: 133984
2011-06-28 03:01:12 +00:00