]> granicus.if.org Git - clang/log
clang
13 years agoFix copy-and-paste typo in the transformation of Microsoft __uuidof expressions,...
Douglas Gregor [Sun, 6 Mar 2011 17:40:41 +0000 (17:40 +0000)]
Fix copy-and-paste typo in the transformation of Microsoft __uuidof expressions, from Eric Niebler via John Wiegley

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127123 91177308-0d34-0410-b5e6-96231b3b80d8

13 years ago xpose HeaderSearch::SearchDirs to tools,s, from Paul Holden
Douglas Gregor [Sun, 6 Mar 2011 17:33:53 +0000 (17:33 +0000)]
 xpose HeaderSearch::SearchDirs to tools,s, from Paul Holden

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127122 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoCorrectly unwrap 'auto' types. Fixes PR9414.
Anders Carlsson [Sun, 6 Mar 2011 16:43:04 +0000 (16:43 +0000)]
Correctly unwrap 'auto' types. Fixes PR9414.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127121 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoCompleted source ranges fixes for all classes inheriting from TypeDecl.
Abramo Bagnara [Sun, 6 Mar 2011 16:09:14 +0000 (16:09 +0000)]
Completed source ranges fixes for all classes inheriting from TypeDecl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127120 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFixed TypedefDecl and TemplateTypeParameter source range.
Abramo Bagnara [Sun, 6 Mar 2011 15:48:19 +0000 (15:48 +0000)]
Fixed TypedefDecl and TemplateTypeParameter source range.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127119 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoReinstate r127112, "Propagate new-style exception spec information to ExtProtoInfo...
Sebastian Redl [Sun, 6 Mar 2011 10:52:04 +0000 (10:52 +0000)]
Reinstate r127112, "Propagate new-style exception spec information to ExtProtoInfo.", this time with the missing header.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127118 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoWhen performing template argument deduction for a non-reference
Douglas Gregor [Sun, 6 Mar 2011 09:03:20 +0000 (09:03 +0000)]
When performing template argument deduction for a non-reference
conversion function when we're binding the result to a reference, drop
cv-qualifiers on the type we're referring to, since we should be
deducing a type that can be adjusted (via cv-qualification) to the
requested type. Fixes PR9336, and the remaining Boost.Assign failure.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127117 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoRevert r127112, "Propagate new-style exception spec information to ExtProtoInfo."
NAKAMURA Takumi [Sun, 6 Mar 2011 00:17:36 +0000 (00:17 +0000)]
Revert r127112, "Propagate new-style exception spec information to ExtProtoInfo."

It seems missing "clang/Basic/ExceptionSpecificationType.h".

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127115 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoPropagate new-style exception spec information to ExtProtoInfo.
Sebastian Redl [Sat, 5 Mar 2011 22:42:26 +0000 (22:42 +0000)]
Propagate new-style exception spec information to ExtProtoInfo.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127112 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoPropagate new-style exception spec information to Declarator.
Sebastian Redl [Sat, 5 Mar 2011 22:42:13 +0000 (22:42 +0000)]
Propagate new-style exception spec information to Declarator.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127111 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoRevert r127079: "test/Makefile: Use $(ECHOPATH) to make lit.site.cfg(s)."
Benjamin Kramer [Sat, 5 Mar 2011 20:57:36 +0000 (20:57 +0000)]
Revert r127079: "test/Makefile: Use $(ECHOPATH) to make lit.site.cfg(s)."

It depends on LLVM r127073 that was reverted and is now blocking "make test"

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127109 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoWhen substituting in for a template name, do not produce a qualified
Douglas Gregor [Sat, 5 Mar 2011 20:06:51 +0000 (20:06 +0000)]
When substituting in for a template name, do not produce a qualified
template name as the result of substitution. The qualifier is handled
separately by the tree transformer, so we would end up in an
inconsistent state.

This is actually the last bit of PR9016, and possibly also fixes
PR8965. It takes Boost.Icl from "epic fail" down to a single failure.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127108 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFixed LabelDecl source range and cleaned creation code.
Abramo Bagnara [Sat, 5 Mar 2011 18:21:20 +0000 (18:21 +0000)]
Fixed LabelDecl source range and cleaned creation code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127094 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoWhen determining template instantiation arguments within a function
Douglas Gregor [Sat, 5 Mar 2011 17:54:25 +0000 (17:54 +0000)]
When determining template instantiation arguments within a function
template (not a specialization!), use the "injected" function template
arguments, which correspond to the template parameters of the function
template. This is required when substituting into the default template
parameters of template template parameters within a function template.

Fixes PR9016.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127092 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoWhen transforming a substituted template type parameter, try to
Douglas Gregor [Sat, 5 Mar 2011 17:19:27 +0000 (17:19 +0000)]
When transforming a substituted template type parameter, try to
transform the type that replaces the template type parameter. In the
vast majority of cases, there's nothing to do, because most template
type parameters are replaced with something non-dependent that doesn't
need further transformation. However, when we're dealing with the
default template arguments of template template parameters, we might
end up replacing a template parameter (of the template template
parameter) with a template parameter of the enclosing template.

This addresses part of PR9016, but not within function
templates. That's a separate issue.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127091 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoNormalize target triple passed out of driver. Basically this means
Anton Korobeynikov [Sat, 5 Mar 2011 16:05:17 +0000 (16:05 +0000)]
Normalize target triple passed out of driver. Basically this means
that at cc1 level we will always have normalized triple and thus can
provide necessary default based on e.g. environment value (e.g. for
"arm-eabi" triple, etc.)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127087 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoParser support for noexcept specifications.
Sebastian Redl [Sat, 5 Mar 2011 14:45:16 +0000 (14:45 +0000)]
Parser support for noexcept specifications.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127086 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoImproved MemberPointerType source locations.
Abramo Bagnara [Sat, 5 Mar 2011 14:42:21 +0000 (14:42 +0000)]
Improved MemberPointerType source locations.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127085 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoStringRefify.
Benjamin Kramer [Sat, 5 Mar 2011 13:45:23 +0000 (13:45 +0000)]
StringRefify.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127082 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agotest/lit.cfg: bash is available on MSYS.
NAKAMURA Takumi [Sat, 5 Mar 2011 11:16:06 +0000 (11:16 +0000)]
test/lit.cfg: bash is available on MSYS.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127080 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agotest/Makefile: Use $(ECHOPATH) to make lit.site.cfg(s).
NAKAMURA Takumi [Sat, 5 Mar 2011 11:16:01 +0000 (11:16 +0000)]
test/Makefile: Use $(ECHOPATH) to make lit.site.cfg(s).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127079 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agotest/CodeGen/2008-07-17-no-emit-on-error.c: Use LLVM's opt instead of "test(1)" for...
NAKAMURA Takumi [Sat, 5 Mar 2011 11:15:55 +0000 (11:15 +0000)]
test/CodeGen/2008-07-17-no-emit-on-error.c: Use LLVM's opt instead of "test(1)" for Mingw MSYS.

Mingw MSYS does not have test.exe (only shell built-in test), and is not capable to invoke test(1) from utils/not.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127078 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agotest: Mark 3 tests as XFAIL:cygwin,mingw.
NAKAMURA Takumi [Sat, 5 Mar 2011 11:15:48 +0000 (11:15 +0000)]
test: Mark 3 tests as XFAIL:cygwin,mingw.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127077 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agotest: Mark two tests as XFAIL:mingw.
NAKAMURA Takumi [Sat, 5 Mar 2011 11:15:38 +0000 (11:15 +0000)]
test: Mark two tests as XFAIL:mingw.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127076 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoMuch to my surprise, OverloadExprs can also point to function template decls.
Matt Beaumont-Gay [Sat, 5 Mar 2011 02:42:30 +0000 (02:42 +0000)]
Much to my surprise, OverloadExprs can also point to function template decls.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127061 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoWhen we're deserializing a template parameter declaration, temporarily
Douglas Gregor [Sat, 5 Mar 2011 01:35:54 +0000 (01:35 +0000)]
When we're deserializing a template parameter declaration, temporarily
use the translation unit as its declaration context, then deserialize
the actual lexical and semantic DeclContexts after the template
parameter is complete. This avoids problems when the DeclContext
itself (e.g., a class template) is dependent on the template parameter
(e.g., for the injected-class-name).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127056 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoCurrently we can only remap a file by creating a MemoryBuffer and replacing the file...
Argyrios Kyrtzidis [Sat, 5 Mar 2011 01:03:53 +0000 (01:03 +0000)]
Currently we can only remap a file by creating a MemoryBuffer and replacing the file contents with it.
Allow remapping a file by specifying another filename whose contents should be loaded if the original
file gets loaded. This allows to override files without having to create & load buffers in advance.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127052 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoIntroduce OwnsRemappedFileBuffers field in ASTUnit, indicating whether the ASTUnit...
Argyrios Kyrtzidis [Sat, 5 Mar 2011 01:03:48 +0000 (01:03 +0000)]
Introduce OwnsRemappedFileBuffers field in ASTUnit, indicating whether the ASTUnit should delete the remapped buffers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127051 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoGive warnings about static initializers of non-integral type their own warning
Nick Lewycky [Sat, 5 Mar 2011 00:32:47 +0000 (00:32 +0000)]
Give warnings about static initializers of non-integral type their own warning
flag so it can be individually controlled. The new flag is
  -Wc++0x-static-nonintegral-init.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127050 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoWhen diagnostics are suppressed (e.g., because of code completion), don't trigger...
Douglas Gregor [Fri, 4 Mar 2011 23:08:02 +0000 (23:08 +0000)]
When diagnostics are suppressed (e.g., because of code completion), don't trigger the ExprTemplates.empty() check at the end of a function body

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127046 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoDiagnose destructor templates. Fixes PR7904.
Douglas Gregor [Fri, 4 Mar 2011 22:45:55 +0000 (22:45 +0000)]
Diagnose destructor templates. Fixes PR7904.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127042 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoWhen clearing a LookupResult structure, clear out the naming class,
Douglas Gregor [Fri, 4 Mar 2011 22:32:08 +0000 (22:32 +0000)]
When clearing a LookupResult structure, clear out the naming class,
too. Fixes PR7900.

While I'm in this area, improve the diagnostic when the type being
destroyed doesn't match either of the types we found.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127041 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoInitialize variable.
Bill Wendling [Fri, 4 Mar 2011 21:46:03 +0000 (21:46 +0000)]
Initialize variable.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127039 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoTeach Sema::ActOnCXXNestedNameSpecifier and Sema::CheckTemplateIdType
Douglas Gregor [Fri, 4 Mar 2011 21:37:14 +0000 (21:37 +0000)]
Teach Sema::ActOnCXXNestedNameSpecifier and Sema::CheckTemplateIdType
to cope with non-type templates by providing appropriate
errors. Previously, we would either assert, crash, or silently build a
dependent type when we shouldn't. Fixes PR9226.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127037 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAfter an error of any kind has occurred, don't assert when attempting
Douglas Gregor [Fri, 4 Mar 2011 20:42:52 +0000 (20:42 +0000)]
After an error of any kind has occurred, don't assert when attempting
to find the instantiated declaration within a template instantiation
fails to do so. It's likely that the original instantiation got
dropped due to instantiation failures, which doesn't actually break
the invariants of the AST. This eliminates a number of
crash-on-invalid failures, e.g., PR9300.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127030 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoPatch up several Sema::FindInstantiatedDecl() callers, so that they'll
Douglas Gregor [Fri, 4 Mar 2011 19:46:35 +0000 (19:46 +0000)]
Patch up several Sema::FindInstantiatedDecl() callers, so that they'll
properly cope with NULL return values.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127024 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoEmit a stop point before a call expression so that debugger has some chance of gettin...
Devang Patel [Fri, 4 Mar 2011 18:54:42 +0000 (18:54 +0000)]
Emit a stop point before a call expression so that debugger has some chance of getting some footing when user wants to stop at 2nd bar() in following expression when all function calls are inlined.
  = bar() + ... + bar() + ...

clang keeps track of column numbers, so we could put location entries for all subexpressions but that will significantly bloat debug info in general, but a location for call expression is helpful here.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127018 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoWhen constructing source-location information for a
Douglas Gregor [Fri, 4 Mar 2011 18:53:13 +0000 (18:53 +0000)]
When constructing source-location information for a
DependentTemplateSpecializationType during tree transformation, retain
the NestedNameSpecifierLoc as it was used to translate the template
name, rather than reconstructing it from the template name.

Fixes PR9401.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127015 91177308-0d34-0410-b5e6-96231b3b80d8

13 years ago*Recursively* set the context of a template parameter, so that we also
Douglas Gregor [Fri, 4 Mar 2011 18:32:38 +0000 (18:32 +0000)]
*Recursively* set the context of a template parameter, so that we also
capture the template parameters of template template parameters.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127012 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoMake sure to put template parameters into their owning template's
Douglas Gregor [Fri, 4 Mar 2011 17:52:15 +0000 (17:52 +0000)]
Make sure to put template parameters into their owning template's
DeclContext once we've created it. This mirrors what we do for
function parameters, where the parameters start out with
translation-unit context and then are adopted by the appropriate
DeclContext when it is created. Also give template parameters public
access and make sure that they don't show up for the purposes of name
lookup.

Fixes PR9400, a regression introduced by r126920, which implemented
substitution of default template arguments provided in template
template parameters (C++ core issue 150).

How on earth could the DeclContext of a template parameter affect the
handling of default template arguments?

I'm so glad you asked! The link is
Sema::getTemplateInstantiationArgs(), which determines the outer
template argument lists that correspond to a given declaration. When
we're instantiating a default template argument for a template
template parameter within the body of a template definition (not it's
instantiation, per core issue 150), we weren't getting any outer
template arguments because the context of the template template
parameter was the translation unit. Now that the context of the
template template parameter is its owning template, we get the
template arguments from the injected-class-name of the owning
template, so substitution works as it should.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127004 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFixed source range for function template specializations.
Abramo Bagnara [Fri, 4 Mar 2011 17:20:30 +0000 (17:20 +0000)]
Fixed source range for function template specializations.

template <class T> void foo();
template <> void foo<int>(); /* Spec 1 */
template <> void foo<int>(); /* Spec 2 */

If we look at the main location of the first explicit specialization (Spec 1) it can be seen that it points to the name of the *second* explicit specialization (Spec 2), which is a redeclaration of Spec1.
Hence, the source range obtained for Spec1 is not only inaccurate, but also invalid (the end location comes before the start location).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127002 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFixed source range for ClassTemplateSpecializationDecl.
Abramo Bagnara [Fri, 4 Mar 2011 14:20:30 +0000 (14:20 +0000)]
Fixed source range for ClassTemplateSpecializationDecl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126999 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoMove private structs into anonymous namespaces.
Benjamin Kramer [Fri, 4 Mar 2011 13:12:48 +0000 (13:12 +0000)]
Move private structs into anonymous namespaces.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126997 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoImproved TemplateTypeParmDecl end location.
Abramo Bagnara [Fri, 4 Mar 2011 12:42:03 +0000 (12:42 +0000)]
Improved TemplateTypeParmDecl end location.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126996 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFixed end location of NonTypeTemplateParamDecl.
Abramo Bagnara [Fri, 4 Mar 2011 11:03:48 +0000 (11:03 +0000)]
Fixed end location of NonTypeTemplateParamDecl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126994 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFixed end location of FriendDecl.
Abramo Bagnara [Fri, 4 Mar 2011 10:59:18 +0000 (10:59 +0000)]
Fixed end location of FriendDecl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126993 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoDon't consider visibility from template parameter lists if we're
John McCall [Fri, 4 Mar 2011 10:39:25 +0000 (10:39 +0000)]
Don't consider visibility from template parameter lists if we're
computing for a nested decl with explicit visibility.  This is all part
of the general philosophy of explicit visibility attributes, where
any information that was obviously available at the attribute site
should probably be ignored.  Fixes PR9371.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126992 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAccess ivars with inbounds GEPs, even in -fwrapv. It's unlikely that
John McCall [Fri, 4 Mar 2011 08:25:59 +0000 (08:25 +0000)]
Access ivars with inbounds GEPs, even in -fwrapv.  It's unlikely that
this can have any optimization effect, given the opacity of objects pointers,
but you never know.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126990 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoLet's do super message sends with static allocas instead of dynamic ones.
John McCall [Fri, 4 Mar 2011 08:00:29 +0000 (08:00 +0000)]
Let's do super message sends with static allocas instead of dynamic ones.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126989 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoMake AttributedTypes for GC-qualified types and fix some miscellaneous
John McCall [Fri, 4 Mar 2011 04:00:19 +0000 (04:00 +0000)]
Make AttributedTypes for GC-qualified types and fix some miscellaneous
bugs with such types.  Not sure this is quite how I want the desugaring
and a.k.a. logic to go, but it suffices.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126986 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoCorrectly handle nested switch statements in CFGBuilder when on switch statement...
Ted Kremenek [Fri, 4 Mar 2011 01:03:41 +0000 (01:03 +0000)]
Correctly handle nested switch statements in CFGBuilder when on switch statement has a condition that evaluates to a constant.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126977 91177308-0d34-0410-b5e6-96231b3b80d8

13 years ago-Woverloaded-virtual shouldn't warn for static functions. Fixes rdar://9083431 &...
Argyrios Kyrtzidis [Thu, 3 Mar 2011 22:58:57 +0000 (22:58 +0000)]
-Woverloaded-virtual shouldn't warn for static functions. Fixes rdar://9083431 & http://llvm.org/PR9396.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126966 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFix PR9390 in not one, but two ways:
Douglas Gregor [Thu, 3 Mar 2011 21:48:55 +0000 (21:48 +0000)]
Fix PR9390 in not one, but two ways:

  1) When we do an instantiation of the injected-class-name type,
  provide a proper source location. This is just plain good hygiene.

  2) When we're building a NestedNameSpecifierLoc from a CXXScopeSpec,
  only return an empty NestedNameSpecifierLoc if there's no
  representation.

Both problems contributed to the horrible test case in PR9390 that I
couldn't reduce down to something palatable.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126961 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoEncode argument numbering in debug info so that code generator can emit them in order.
Devang Patel [Thu, 3 Mar 2011 20:13:15 +0000 (20:13 +0000)]
Encode argument numbering in debug info so that code generator can emit them in order.
This fixes few blocks.exp regressions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126960 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFixed source range for LabelDecl.
Abramo Bagnara [Thu, 3 Mar 2011 18:24:14 +0000 (18:24 +0000)]
Fixed source range for LabelDecl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126952 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoDon't emit unused warning for deleted functions. Fixes rdar://8365684 & http://llvm...
Argyrios Kyrtzidis [Thu, 3 Mar 2011 17:47:42 +0000 (17:47 +0000)]
Don't emit unused warning for deleted functions. Fixes rdar://8365684 & http://llvm.org/PR9391.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126950 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFinish updated test
Douglas Gregor [Thu, 3 Mar 2011 17:22:06 +0000 (17:22 +0000)]
Finish updated test

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126948 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd coverage test for CFGImplicitDtor::getDestructorDecl() when handling typedefs.
Ted Kremenek [Thu, 3 Mar 2011 17:07:11 +0000 (17:07 +0000)]
Add coverage test for CFGImplicitDtor::getDestructorDecl() when handling typedefs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126947 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoEliminate redundant nested-name-specifiers on
Douglas Gregor [Thu, 3 Mar 2011 17:04:51 +0000 (17:04 +0000)]
Eliminate redundant nested-name-specifiers on
TemplateSpecializationTypes, which also fixes PR9388.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126946 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoRemoved left brace location from LinkageSpecDecl.
Abramo Bagnara [Thu, 3 Mar 2011 16:52:29 +0000 (16:52 +0000)]
Removed left brace location from LinkageSpecDecl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126945 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFixed end source location for LinkageSpecDecl.
Abramo Bagnara [Thu, 3 Mar 2011 14:52:38 +0000 (14:52 +0000)]
Fixed end source location for LinkageSpecDecl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126943 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFixed source range for FileScopeAsmDecl. Others source range fixes will follow.
Abramo Bagnara [Thu, 3 Mar 2011 14:20:18 +0000 (14:20 +0000)]
Fixed source range for FileScopeAsmDecl. Others source range fixes will follow.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126939 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoWhen we use the default template arguments of a template template
Douglas Gregor [Thu, 3 Mar 2011 02:41:12 +0000 (02:41 +0000)]
When we use the default template arguments of a template template
parameter, save the instantiated default template arguments along with
the explicitly-specified template argument list. That way, we prefer
the default template template arguments corresponding to the template
template parameter rather than those of its template template argument.

This addresses the likely direction of C++ core issue 150, and fixes
PR9353/<rdar://problem/9069136>, bringing us closer to the behavior of
EDG and GCC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126920 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd a missing break, from John Wiegley
Douglas Gregor [Thu, 3 Mar 2011 02:20:19 +0000 (02:20 +0000)]
Add a missing break, from John Wiegley

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126919 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoTeach CFGImplicitDtor::getDestructorDecl() about arrays of objects with destructors.
Ted Kremenek [Thu, 3 Mar 2011 01:21:32 +0000 (01:21 +0000)]
Teach CFGImplicitDtor::getDestructorDecl() about arrays of objects with destructors.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126910 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoTeach CFGImplicitDtor::getDestructorDecl() about reference types.
Ted Kremenek [Thu, 3 Mar 2011 01:01:03 +0000 (01:01 +0000)]
Teach CFGImplicitDtor::getDestructorDecl() about reference types.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126909 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoLet's go with John and Ted's preferred fix.
Matt Beaumont-Gay [Thu, 3 Mar 2011 00:48:05 +0000 (00:48 +0000)]
Let's go with John and Ted's preferred fix.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126907 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoKeep GCC from complaining about falling off the end of the function.
Matt Beaumont-Gay [Wed, 2 Mar 2011 23:25:06 +0000 (23:25 +0000)]
Keep GCC from complaining about falling off the end of the function.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126897 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFix a typo.
Dan Gohman [Wed, 2 Mar 2011 22:39:34 +0000 (22:39 +0000)]
Fix a typo.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126890 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoRemove cruft
Douglas Gregor [Wed, 2 Mar 2011 21:57:24 +0000 (21:57 +0000)]
Remove cruft

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126888 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoForce CaseStmt to store its child statements in source-code order,
Douglas Gregor [Wed, 2 Mar 2011 21:45:00 +0000 (21:45 +0000)]
Force CaseStmt to store its child statements in source-code order,
which is important for libclang's token-annotation and
where's-my-cursor functionality. Fixes <rdar://problem/9004439>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126887 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoRevert "Add CC_Win64ThisCall and set it in the necessary places."
Tilmann Scheller [Wed, 2 Mar 2011 21:36:49 +0000 (21:36 +0000)]
Revert "Add CC_Win64ThisCall and set it in the necessary places."

This reverts commit 126863.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126886 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoApply sysroot to system c++ headers too. Fixes PR9372.
Rafael Espindola [Wed, 2 Mar 2011 21:30:07 +0000 (21:30 +0000)]
Apply sysroot to system c++ headers too. Fixes PR9372.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126884 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoOnly emit string initializers in-place if types match. Fixes PR9373.
Benjamin Kramer [Wed, 2 Mar 2011 21:27:44 +0000 (21:27 +0000)]
Only emit string initializers in-place if types match. Fixes PR9373.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126883 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFix the source range for a member access expression that includes a
Douglas Gregor [Wed, 2 Mar 2011 21:06:53 +0000 (21:06 +0000)]
Fix the source range for a member access expression that includes a
nested-name-specifier and improve the detection of implicit 'this'
bases. Fixes <rdar://problem/8750392>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126880 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoWork around a misdesigned GCC warning.
John McCall [Wed, 2 Mar 2011 21:01:41 +0000 (21:01 +0000)]
Work around a misdesigned GCC warning.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126879 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoRevert "Add preliminary support for MSVC-style vtables."
Tilmann Scheller [Wed, 2 Mar 2011 20:40:50 +0000 (20:40 +0000)]
Revert "Add preliminary support for MSVC-style vtables."

This reverts commit 126865.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126876 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoIntroduce CFGImplicitDtor::isNoReturn() to query whether a destructor actually return...
Ted Kremenek [Wed, 2 Mar 2011 20:32:29 +0000 (20:32 +0000)]
Introduce CFGImplicitDtor::isNoReturn() to query whether a destructor actually returns.  Use this for -Wreturn-type to prune false positives reported in PR 6884.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126875 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agorevert r126858.
Devang Patel [Wed, 2 Mar 2011 20:31:22 +0000 (20:31 +0000)]
revert r126858.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126874 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoIRGen. Fix IR when message returns reference type.
Fariborz Jahanian [Wed, 2 Mar 2011 20:09:49 +0000 (20:09 +0000)]
IRGen. Fix IR when message returns reference type.
// rdar://8604515.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126869 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd preliminary support for MSVC-style vtables.
Tilmann Scheller [Wed, 2 Mar 2011 19:38:28 +0000 (19:38 +0000)]
Add preliminary support for MSVC-style vtables.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126865 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd CC_Win64ThisCall and set it in the necessary places.
Tilmann Scheller [Wed, 2 Mar 2011 19:36:23 +0000 (19:36 +0000)]
Add CC_Win64ThisCall and set it in the necessary places.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126863 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoTeach libclang how to visit the children of a C++ base-class specifier
Douglas Gregor [Wed, 2 Mar 2011 19:17:03 +0000 (19:17 +0000)]
Teach libclang how to visit the children of a C++ base-class specifier
(i.e., the TypeLoc describing the base class type).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126861 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoEncode argument numbering in debug info so that code generator can emit them in order.
Devang Patel [Wed, 2 Mar 2011 19:11:22 +0000 (19:11 +0000)]
Encode argument numbering in debug info so that code generator can emit them in order.
This fixes few blocks.exp regressions.

Reapply r126795 with a fix (one character change) for gdb testsuite regressions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126858 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoEliminate an unnecessary TemporaryBase object from TreeTransform
Douglas Gregor [Wed, 2 Mar 2011 19:02:55 +0000 (19:02 +0000)]
Eliminate an unnecessary TemporaryBase object from TreeTransform

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126857 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoKill off the
Douglas Gregor [Wed, 2 Mar 2011 18:57:38 +0000 (18:57 +0000)]
Kill off the
TreeTransform::TransformDependentTemplateSpecializationType() with
poor source-location information handling. All of the
CXXScopeSpec::MakeTrivial() and
NestedNameSpecifierLocBuilder::MakeTrivial() callers actually make
sense now.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126856 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoEliminate TreeTransform::RebuildNestedNameSpecifier(), all four of
Douglas Gregor [Wed, 2 Mar 2011 18:54:26 +0000 (18:54 +0000)]
Eliminate TreeTransform::RebuildNestedNameSpecifier(), all four of
them, which are no longer used.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126855 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoEliminate an unnecessary use of CXXScopeSpec::MakeTrivial. We have proper nested...
Douglas Gregor [Wed, 2 Mar 2011 18:52:42 +0000 (18:52 +0000)]
Eliminate an unnecessary use of CXXScopeSpec::MakeTrivial. We have proper nested-name-specifier source-location information in DependentTemplateSpecializationTypeLocs now

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126854 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoKill off TreeTransform::TransformNestedNameSpecifier() in favor of the
Douglas Gregor [Wed, 2 Mar 2011 18:50:38 +0000 (18:50 +0000)]
Kill off TreeTransform::TransformNestedNameSpecifier() in favor of the
source-location-preserving
TreeTransform::TranformNestedNameSpecifierLoc(). No functionality
change: the victim had no callers (that themselves had callers) anyway.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126853 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoKill off the TreeTransform::TransformTemplateName overload that has
Douglas Gregor [Wed, 2 Mar 2011 18:46:51 +0000 (18:46 +0000)]
Kill off the TreeTransform::TransformTemplateName overload that has
poor source-location information.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126852 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoKill off one of the TreeTransform::TransformTypeInObjectScope()
Douglas Gregor [Wed, 2 Mar 2011 18:32:08 +0000 (18:32 +0000)]
Kill off one of the TreeTransform::TransformTypeInObjectScope()
overloads (the one with the poor source-location information).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126851 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFix a thinko found by Craig Silverstein
Douglas Gregor [Wed, 2 Mar 2011 18:10:05 +0000 (18:10 +0000)]
Fix a thinko found by Craig Silverstein

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126850 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoStart migrating TreeTransform's TransformTemplateName over to version
Douglas Gregor [Wed, 2 Mar 2011 18:07:45 +0000 (18:07 +0000)]
Start migrating TreeTransform's TransformTemplateName over to version
that preserve source-location information. This commit adds more
redundancy than it removes; WIP.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126849 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoRevert r126794.
Devang Patel [Wed, 2 Mar 2011 17:54:58 +0000 (17:54 +0000)]
Revert r126794.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126848 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoPush nested-name-specifier source location information into template
Douglas Gregor [Wed, 2 Mar 2011 17:09:35 +0000 (17:09 +0000)]
Push nested-name-specifier source location information into template
template arguments. I believe that this is the last place in the AST
where we were storing a source range for a nested-name-specifier
rather than a proper nested-name-specifier location structure. (Yay!)

There is still a lot of cleanup to do in the TreeTransform, which
doesn't take advantage of nested-name-specifiers with source-location
information everywhere it could.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126844 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoEliminate some unused getQualifierRange() member functions. We deal in nested-name...
Douglas Gregor [Wed, 2 Mar 2011 15:13:50 +0000 (15:13 +0000)]
Eliminate some unused getQualifierRange() member functions. We deal in nested-name-specifier locations now.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126842 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoDon't hard-code these constants, or at least don't hard-code them so hard.
John McCall [Wed, 2 Mar 2011 12:29:23 +0000 (12:29 +0000)]
Don't hard-code these constants, or at least don't hard-code them so hard.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126841 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoPretty up the wrong-number-of-arguments-for-attribute diagnostic by
John McCall [Wed, 2 Mar 2011 12:15:05 +0000 (12:15 +0000)]
Pretty up the wrong-number-of-arguments-for-attribute diagnostic by
using a custom plural form.  Split out the range diagnostics as their
own message.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126840 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoProvide an attribute, objc_method_family, to allow the inferred family
John McCall [Wed, 2 Mar 2011 11:33:24 +0000 (11:33 +0000)]
Provide an attribute, objc_method_family, to allow the inferred family
of an Objective-C method to be overridden on a case-by-case basis.  This
is a higher-level tool than ns_returns_retained &c.;  it lets users specify
that not only does a method have different retain/release semantics, but
that it semantically acts differently than one might assume from its name.
This in turn is quite useful to static analysis.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126839 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoSplit out a subgroup of -Wconversion called -Wsign-conversion. Note that
John McCall [Wed, 2 Mar 2011 07:36:25 +0000 (07:36 +0000)]
Split out a subgroup of -Wconversion called -Wsign-conversion.  Note that
unlike GCC, this is simply a subset of -Wconversion in all languages;  it
is not disabled by defualt in C++.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126836 91177308-0d34-0410-b5e6-96231b3b80d8