]> granicus.if.org Git - clang/log
clang
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

13 years agoHack in something so that we emit better debug information about
John McCall [Wed, 2 Mar 2011 06:57:14 +0000 (06:57 +0000)]
Hack in something so that we emit better debug information about
captured __block variables in the block-literal type.

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

13 years agoSupport a new InheritableAttr subclass, InheritableParamAttr, which is
John McCall [Wed, 2 Mar 2011 04:00:57 +0000 (04:00 +0000)]
Support a new InheritableAttr subclass, InheritableParamAttr, which is
used for attributes that are okay to inherit when written on a parameter.
Dependent on LLVM r126827.

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

13 years agoSemantic checking for exception specifications should be triggered by
John McCall [Wed, 2 Mar 2011 02:04:40 +0000 (02:04 +0000)]
Semantic checking for exception specifications should be triggered by
whether C++ exceptions are enabled, not exceptions in general.  PR9358.

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

13 years agoWhen we're substituting into a parameter-type-list nested inside the pattern
Douglas Gregor [Wed, 2 Mar 2011 02:04:06 +0000 (02:04 +0000)]
When we're substituting into a parameter-type-list nested inside the pattern
of an expansion, and we have a paramameter that is not a parameter
pack, don't suppress substitution of parameter packs within this
context.

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

13 years agoMove some of the logic about classifying Objective-C methods into
John McCall [Wed, 2 Mar 2011 01:50:55 +0000 (01:50 +0000)]
Move some of the logic about classifying Objective-C methods into
conventional categories into Basic and AST.  Update the self-init checker
to use this logic;  CFRefCountChecker is complicated enough that I didn't
want to touch it.

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

13 years agoPR9350: increment/decrement of char (and anything else narrower than int)
Eli Friedman [Wed, 2 Mar 2011 01:49:12 +0000 (01:49 +0000)]
PR9350: increment/decrement of char (and anything else narrower than int)
can't overflow due to promotion rules; emit a wrapping add for those cases.

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

13 years agobuild: Allow disabling movt/movw from build, for testing purposes.
Daniel Dunbar [Wed, 2 Mar 2011 00:55:57 +0000 (00:55 +0000)]
build: Allow disabling movt/movw from build, for testing purposes.

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

13 years agoPush nested-name-specifier source-location information into dependent
Douglas Gregor [Wed, 2 Mar 2011 00:47:37 +0000 (00:47 +0000)]
Push nested-name-specifier source-location information into dependent
template specialization types. This also required some parser tweaks,
since we were losing track of the nested-name-specifier's source
location information in several places in the parser. Other notable
changes this required:

  - Sema::ActOnTagTemplateIdType now type-checks and forms the
    appropriate type nodes (+ source-location information) for an
    elaborated-type-specifier ending in a template-id. Previously, we
    used a combination of ActOnTemplateIdType and
    ActOnTagTemplateIdType that resulted in an ElaboratedType wrapped
    around a DependentTemplateSpecializationType, which duplicated the
    keyword ("class", "struct", etc.) and nested-name-specifier
    storage.

  - Sema::ActOnTemplateIdType now gets a nested-name-specifier, which
    it places into the returned type-source location information.

  - Sema::ActOnDependentTag now creates types with source-location
    information.

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

13 years agoTeach CFGBuilder to prune trivially unreachable case statements.
Ted Kremenek [Tue, 1 Mar 2011 23:12:55 +0000 (23:12 +0000)]
Teach CFGBuilder to prune trivially unreachable case statements.

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

13 years agoEncode argument numbering in debug info so that code generator can emit them in order.
Devang Patel [Tue, 1 Mar 2011 22:59:40 +0000 (22:59 +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@126795 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoSince getDriver().getInstalledDir() returns a const char *, don't try to
Benjamin Kramer [Tue, 1 Mar 2011 22:50:47 +0000 (22:50 +0000)]
Since getDriver().getInstalledDir() returns a const char *, don't try to
compare it with getDriver().Dir.c_str(), since that is a pointer
comparison, not a "are these strings equal" comparison.

Instead, just compare with getDriver().Dir directly, so both sides will
get promoted to std::string, and the regular std::string comparison
operator applies.

Patch by Dimitry Andric!

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

13 years agoDon't warn about unused values in ternary ?: expressions unless both the LHS and...
Ted Kremenek [Tue, 1 Mar 2011 20:34:48 +0000 (20:34 +0000)]
Don't warn about unused values in ternary ?: expressions unless both the LHS and RHS are "unused" (side-effect free).

Patch by Justin Bogner!  Fixes PR 8282.

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

13 years agoPush nested-name-specifier source-location information into dependent
Douglas Gregor [Tue, 1 Mar 2011 20:11:18 +0000 (20:11 +0000)]
Push nested-name-specifier source-location information into dependent
template specialization types. There are still a few rough edges to
clean up with some of the parser actions dropping
nested-name-specifiers too early.

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

13 years agoKill off more names to fix this test
Douglas Gregor [Tue, 1 Mar 2011 19:55:40 +0000 (19:55 +0000)]
Kill off more names to fix this test

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

13 years agoRevert 123553, as sys::fs::unique_file is not finished yet.
Dan Gohman [Tue, 1 Mar 2011 19:50:49 +0000 (19:50 +0000)]
Revert 123553, as sys::fs::unique_file is not finished yet.

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

13 years agoDon't warning about shifting by too many bits in dead code.
Ted Kremenek [Tue, 1 Mar 2011 19:13:22 +0000 (19:13 +0000)]
Don't warning about shifting by too many bits in dead code.

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

13 years agoFix the test.
Roman Divacky [Tue, 1 Mar 2011 18:50:59 +0000 (18:50 +0000)]
Fix the test.

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

13 years agoDriver/Darwin: Be bug compatible with GCC and ignore -pg on ARM.
Daniel Dunbar [Tue, 1 Mar 2011 18:49:30 +0000 (18:49 +0000)]
Driver/Darwin: Be bug compatible with GCC and ignore -pg on ARM.

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

13 years agoFor C++, enhance -Warray-bounds to recursively analyze array subscript accesses in...
Ted Kremenek [Tue, 1 Mar 2011 18:41:00 +0000 (18:41 +0000)]
For C++, enhance -Warray-bounds to recursively analyze array subscript accesses in ?: expressions.

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

13 years agoReinstate the introduction of source-location information for
Douglas Gregor [Tue, 1 Mar 2011 18:12:44 +0000 (18:12 +0000)]
Reinstate the introduction of source-location information for
nested-name-speciciers within elaborated type names, e.g.,

  enum clang::NestedNameSpecifier::SpecifierKind

Fixes in this iteration include:

  (1) Compute the type-source range properly for a dependent template
  specialization type that starts with "template template-id ::", as
  in a member access expression

    dep->template f<T>::f()

  This is a latent bug I triggered with this change (because now we're
  checking the computed source ranges for dependent template
  specialization types). But the real problem was...

  (2) Make sure to set the qualifier range on a dependent template
  specialization type appropriately. This will go away once we push
  nested-name-specifier locations into dependent template
  specialization types, but it was the source of the
  valgrind errors on the buildbots.

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

13 years agoThe default CPU on FreeBSD for i386 should be i486, not pentium4.
Roman Divacky [Tue, 1 Mar 2011 18:11:37 +0000 (18:11 +0000)]
The default CPU on FreeBSD for i386 should be i486, not pentium4.

Patch by Dimitry Andric!

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

13 years agoDon't wanr about "negative shifts" in code that is unreachable. Fixes PR 5544.
Ted Kremenek [Tue, 1 Mar 2011 18:09:31 +0000 (18:09 +0000)]
Don't wanr about "negative shifts" in code that is unreachable.  Fixes PR 5544.

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

13 years agoOn FreeBSD, make sure /usr/local/include is *not* in the default include
Roman Divacky [Tue, 1 Mar 2011 18:08:03 +0000 (18:08 +0000)]
On FreeBSD, make sure /usr/local/include is *not* in the default include
path.  This avoids accidentally including the wrong headers.

Patch by Dimitry Andric!

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

13 years agoOn FreeBSD, we don't want 'getDriver().Dir + "/../lib"' added to the
Roman Divacky [Tue, 1 Mar 2011 18:03:28 +0000 (18:03 +0000)]
On FreeBSD, we don't want 'getDriver().Dir + "/../lib"' added to the
ToolChain's FilePaths.  If clang is installed as a port in /usr/local,
it is *not* supposed to use /usr/local/lib by default, for example.

Additionally, there are no clang-related executables in either
/usr/libexec, or getDriver().Dir + "/../libexec", anymore, so remove
that from the ToolChain's ProgramPaths.

Patch by Dimitry Andric!

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

13 years agoFor linking on FreeBSD, don't add a hardcoded "-L/usr/lib", but
Roman Divacky [Tue, 1 Mar 2011 17:53:14 +0000 (17:53 +0000)]
For linking on FreeBSD, don't add a hardcoded "-L/usr/lib", but
retrieve the library paths from the ToolChain object instead.

Copy the relevant code from linuxtools::Link::ConstructJob(), and
replace the std::string stuff with llvm::StringRef, while we're here.

Patch by Dimitry Andric!

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

13 years agoImplement -mrtd which sets the StdCall calling convention to be the default
Roman Divacky [Tue, 1 Mar 2011 17:40:53 +0000 (17:40 +0000)]
Implement -mrtd which sets the StdCall calling convention to be the default
one.

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

13 years agoAdd missing options.
Roman Divacky [Tue, 1 Mar 2011 17:36:40 +0000 (17:36 +0000)]
Add missing options.

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

13 years agoobjc IRGen for Next runtime message API.
Fariborz Jahanian [Tue, 1 Mar 2011 17:28:13 +0000 (17:28 +0000)]
objc IRGen for Next runtime message API.
The prototype for objc_msgSend() is technically variadic -
`id objc_msgSend(id, SEL, ...)`.
But all method calls should use a prototype that matches the method,
not the prototype for objc_msgSend itself().
// rdar://9048030

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

13 years agoRevert r126748, my second attempt at nested-name-specifier source
Douglas Gregor [Tue, 1 Mar 2011 17:25:47 +0000 (17:25 +0000)]
Revert r126748, my second attempt at nested-name-specifier source
location information for elaborated types. *sigh*

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

13 years agoImplement comparison of C++0x scoped enumeration types. Fixes PR9333.
Douglas Gregor [Tue, 1 Mar 2011 17:16:20 +0000 (17:16 +0000)]
Implement comparison of C++0x scoped enumeration types. Fixes PR9333.

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

13 years agoWhen digging into a cv-qualified return type that is a pointer type to
Douglas Gregor [Tue, 1 Mar 2011 17:04:42 +0000 (17:04 +0000)]
When digging into a cv-qualified return type that is a pointer type to
diagnose ignored qualifiers on return types, only assume that there is
a pointer chunk if the type is *structurally* a pointer type, not if
it's a typedef of a pointer type. Fixes PR9328/<rdar://problem/9055428>.

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

13 years agoWhen building a type for a typename specifier, check specifically for
Douglas Gregor [Tue, 1 Mar 2011 16:44:30 +0000 (16:44 +0000)]
When building a type for a typename specifier, check specifically for
a dependent template name rather than (indirectly and incorrectly)
trying to determine whether we can compute a context for the
nested-name-specifier. Fixes a GCC testsuite regression,
<rdar://problem/9068589>.

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

13 years agoReinstate r126737, extending the generation of type-source location
Douglas Gregor [Tue, 1 Mar 2011 16:31:39 +0000 (16:31 +0000)]
Reinstate r126737, extending the generation of type-source location
information for qualifier type names throughout the parser to address
several problems.

The commit message from r126737:

Push nested-name-specifier source location information into elaborated
name types, e.g., "enum clang::NestedNameSpecifier::SpecifierKind".

Aside from the normal changes, this also required some tweaks to the
parser. Essentially, when we're looking at a type name (via
getTypeName()) specifically for the purpose of creating an annotation
token, we pass down the flag that asks for full type-source location
information to be stored within the returned type. That way, we retain
source-location information involving nested-name-specifiers rather
than trying to reconstruct that information later, long after it's
been lost in the parser.

With this change, test/Index/recursive-cxx-member-calls.cpp is showing
much improved results again, since that code has lots of
nested-name-specifiers.

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

13 years agoRevert r126737, the most recent nested-name-specifier location change, for buildbot...
Douglas Gregor [Tue, 1 Mar 2011 15:34:37 +0000 (15:34 +0000)]
Revert r126737, the most recent nested-name-specifier location change, for buildbot breakage.

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

13 years agoDisable more warnings so that it is safe to use
Rafael Espindola [Tue, 1 Mar 2011 05:25:27 +0000 (05:25 +0000)]
Disable more warnings so that it is safe to use
CC="clang -use-gold-plugin -emit-llvm"
CXX="clang++ -use-gold-plugin -emit-llvm"

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

13 years agoMove the bool-conversions behind the DiagRuntimeBehavior logic. It's
Chandler Carruth [Tue, 1 Mar 2011 03:29:37 +0000 (03:29 +0000)]
Move the bool-conversions behind the DiagRuntimeBehavior logic. It's
possible for these to show up due to metaprogramming both in unevaluated
contexts and compile-time dead branches.

Those aren't the bugs we're looking for.

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

13 years agoIn preparation for fixing PR 6884, rework CFGElement to have getAs<> return pointers...
Ted Kremenek [Tue, 1 Mar 2011 03:15:10 +0000 (03:15 +0000)]
In preparation for fixing PR 6884, rework CFGElement to have getAs<> return pointers instead of fresh CFGElements.

- Also, consoldiate getDtorKind() and getKind() into one "kind".
- Add empty getDestructorDecl() method to CFGImplicitDtor.

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

13 years agoPush nested-name-specifier source location information into elaborated
Douglas Gregor [Tue, 1 Mar 2011 03:11:17 +0000 (03:11 +0000)]
Push nested-name-specifier source location information into elaborated
name types, e.g., "enum clang::NestedNameSpecifier::SpecifierKind".

Aside from the normal changes, this also required some tweaks to the
parser. Essentially, when we're looking at a type name (via
getTypeName()) specifically for the purpose of creating an annotation
token, we pass down the flag that asks for full type-source location
information to be stored within the returned type. That way, we retain
source-location information involving nested-name-specifiers rather
than trying to reconstruct that information later, long after it's
been lost in the parser.

With this change, test/Index/recursive-cxx-member-calls.cpp is showing
much improved results again, since that code has lots of
nested-name-specifiers.

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

13 years ago[analyzer] Also make sure that the parameter is coming from the current stack frame.
Argyrios Kyrtzidis [Tue, 1 Mar 2011 01:59:41 +0000 (01:59 +0000)]
[analyzer] Also make sure that the parameter is coming from the current stack frame.

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

13 years ago[analyzer] Remove SVal::getAsVarDecl() and reason about MemRegions, not Decls. Sugges...
Argyrios Kyrtzidis [Tue, 1 Mar 2011 01:47:48 +0000 (01:47 +0000)]
[analyzer] Remove SVal::getAsVarDecl() and reason about MemRegions, not Decls. Suggestion by Ted!

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

13 years agoUse CharUnits for TypeAlign variable in LayoutWideBitField(). No change in
Ken Dyck [Tue, 1 Mar 2011 01:36:00 +0000 (01:36 +0000)]
Use CharUnits for TypeAlign variable in LayoutWideBitField(). No change in
functionality intended.

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

13 years agoPush nested-name-specifier source location information into
Douglas Gregor [Tue, 1 Mar 2011 01:34:45 +0000 (01:34 +0000)]
Push nested-name-specifier source location information into
DependentNameTypeLoc. Teach the recursive AST visitor and libclang how to
walk DependentNameTypeLoc nodes.

Also, teach libclang about TypedefDecl source ranges, so that we get
those. The massive churn in test/Index/recursive-cxx-member-calls.cpp
is a good thing: we're annotating a lot more of this test correctly
now.

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

13 years ago[analyzer] Move lib/StaticAnalyzer/Checkers/ExprEngine.cpp -> lib/StaticAnalyzer...
Argyrios Kyrtzidis [Tue, 1 Mar 2011 01:24:23 +0000 (01:24 +0000)]
[analyzer] Move lib/StaticAnalyzer/Checkers/ExprEngine.cpp -> lib/StaticAnalyzer/Core
and hope the wrath of the buildbots will not descend upon me.

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

13 years agoChange the return type of GetVirtualPointersSize() to CharUnits. No change
Ken Dyck [Tue, 1 Mar 2011 01:22:45 +0000 (01:22 +0000)]
Change the return type of GetVirtualPointersSize() to CharUnits. No change
in functionality intended.

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

13 years ago[analyzer] Rename CheckerV2 -> Checker.
Argyrios Kyrtzidis [Tue, 1 Mar 2011 01:16:21 +0000 (01:16 +0000)]
[analyzer] Rename CheckerV2 -> Checker.

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

13 years ago[analyzer] Remove Checker V1.
Argyrios Kyrtzidis [Tue, 1 Mar 2011 01:16:08 +0000 (01:16 +0000)]
[analyzer] Remove Checker V1.

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

13 years ago[analyzer] Remove checker V1 registration and running from ExprEngine.
Argyrios Kyrtzidis [Tue, 1 Mar 2011 01:16:03 +0000 (01:16 +0000)]
[analyzer] Remove checker V1 registration and running from ExprEngine.

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

13 years agoImproves the coding style in SValBuilder. This patch:
Zhanyong Wan [Tue, 1 Mar 2011 00:45:32 +0000 (00:45 +0000)]
Improves the coding style in SValBuilder.  This patch:

- renames evalCastNL and evalCastL to evalCastFromNonLoc and
  evalCastFromLoc (avoid abbreviations that aren't well known).

- makes all function parameter names start with a lower case letter
  for consistency and distinction from member variables.

- avoids abbreviations in function parameter names.

Reviewed by kremenek@apple.com.

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

13 years agoFix some regressions in the GCC testsuite due to bad souce-location
Douglas Gregor [Tue, 1 Mar 2011 00:34:57 +0000 (00:34 +0000)]
Fix some regressions in the GCC testsuite due to bad souce-location
information. Fixes <rdar://problem/9063643>.

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

13 years ago-fwrapv should turn off the inbounds markers from geps used for pointer
Chris Lattner [Tue, 1 Mar 2011 00:03:48 +0000 (00:03 +0000)]
-fwrapv should turn off the inbounds markers from geps used for pointer
arithmetic.  This is part of PR9256, it would be great if someone else
wired up -fno-strict-overflow in the driver to -fwrapv.

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

13 years agoRefactor the construction of nested-name-specifiers with
Douglas Gregor [Mon, 28 Feb 2011 23:58:31 +0000 (23:58 +0000)]
Refactor the construction of nested-name-specifiers with
source-location information into a NestedNameSpecifierLocBuilder
class, which lives within the AST library and centralize all knowledge
of the format of nested-name-specifier location information here.

No functionality change.

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

13 years agoDon't warn about "clang -use-gold-plugin -c ...". With this users can say
Rafael Espindola [Mon, 28 Feb 2011 23:29:45 +0000 (23:29 +0000)]
Don't warn about "clang -use-gold-plugin -c ...". With this users can say
CC="clang -use-gold-plugin" CFLAGS=-emit-llvm ../configure...
and not be hit with a warning for each .c file.

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

13 years agoTeach Sema::CheckTypenameType to use nested-name-specifiers with
Douglas Gregor [Mon, 28 Feb 2011 22:42:13 +0000 (22:42 +0000)]
Teach Sema::CheckTypenameType to use nested-name-specifiers with
source-location information. We don't actually preserve this
information in any of the resulting TypeLocs (yet), so it doesn't
matter.

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

13 years agoUse single code path to handle c++ structs and classes while generating debug info.
Devang Patel [Mon, 28 Feb 2011 22:32:45 +0000 (22:32 +0000)]
Use single code path to handle c++ structs and classes while generating debug info.

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

13 years ago[analyzer] Remove unused checker stuff from AnalysisConsumer and some unused headers.
Argyrios Kyrtzidis [Mon, 28 Feb 2011 22:30:38 +0000 (22:30 +0000)]
[analyzer] Remove unused checker stuff from AnalysisConsumer and some unused headers.

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

13 years agoPush nested-name-specifier location information into DeclRefExpr and
Douglas Gregor [Mon, 28 Feb 2011 21:54:11 +0000 (21:54 +0000)]
Push nested-name-specifier location information into DeclRefExpr and
MemberExpr, the last of the expressions with qualifiers!

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