Commit Graph

28845 Commits

Author SHA1 Message Date
Tilmann Scheller e60baf731b Revert "Add preliminary support for MSVC-style vtables."
This reverts commit 126865.

llvm-svn: 126876
2011-03-02 20:40:50 +00:00
Ted Kremenek e06a55c6b9 Introduce CFGImplicitDtor::isNoReturn() to query whether a destructor actually returns. Use this for -Wreturn-type to prune false positives reported in PR 6884.
llvm-svn: 126875
2011-03-02 20:32:29 +00:00
Devang Patel bd6f7f9770 revert r126858.
llvm-svn: 126874
2011-03-02 20:31:22 +00:00
Fariborz Jahanian ff9890302c IRGen. Fix IR when message returns reference type.
// rdar://8604515.

llvm-svn: 126869
2011-03-02 20:09:49 +00:00
Tilmann Scheller a6c995dbb2 Add preliminary support for MSVC-style vtables.
llvm-svn: 126865
2011-03-02 19:38:28 +00:00
Tilmann Scheller 454464b491 Add CC_Win64ThisCall and set it in the necessary places.
llvm-svn: 126863
2011-03-02 19:36:23 +00:00
Douglas Gregor 64f38ae7ee Teach libclang how to visit the children of a C++ base-class specifier
(i.e., the TypeLoc describing the base class type).

llvm-svn: 126861
2011-03-02 19:17:03 +00:00
Devang Patel 31e5fb52d1 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.

llvm-svn: 126858
2011-03-02 19:11:22 +00:00
Douglas Gregor cf256c1297 Eliminate an unnecessary TemporaryBase object from TreeTransform
llvm-svn: 126857
2011-03-02 19:02:55 +00:00
Douglas Gregor 1ee2406369 Kill off the
TreeTransform::TransformDependentTemplateSpecializationType() with
poor source-location information handling. All of the
CXXScopeSpec::MakeTrivial() and
NestedNameSpecifierLocBuilder::MakeTrivial() callers actually make
sense now.

llvm-svn: 126856
2011-03-02 18:57:38 +00:00
Douglas Gregor 1abdf36a2c Eliminate TreeTransform::RebuildNestedNameSpecifier(), all four of
them, which are no longer used.

llvm-svn: 126855
2011-03-02 18:54:26 +00:00
Douglas Gregor d4c41bcd7f Eliminate an unnecessary use of CXXScopeSpec::MakeTrivial. We have proper nested-name-specifier source-location information in DependentTemplateSpecializationTypeLocs now
llvm-svn: 126854
2011-03-02 18:52:42 +00:00
Douglas Gregor fd35cde35e 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.

llvm-svn: 126853
2011-03-02 18:50:38 +00:00
Douglas Gregor df846d11c1 Kill off the TreeTransform::TransformTemplateName overload that has
poor source-location information.

llvm-svn: 126852
2011-03-02 18:46:51 +00:00
Douglas Gregor 579c15f5d6 Kill off one of the TreeTransform::TransformTypeInObjectScope()
overloads (the one with the poor source-location information).

llvm-svn: 126851
2011-03-02 18:32:08 +00:00
Douglas Gregor 5f9591d3e5 Fix a thinko found by Craig Silverstein
llvm-svn: 126850
2011-03-02 18:10:05 +00:00
Douglas Gregor 9db535035d Start migrating TreeTransform's TransformTemplateName over to version
that preserve source-location information. This commit adds more
redundancy than it removes; WIP.

llvm-svn: 126849
2011-03-02 18:07:45 +00:00
Devang Patel a54696de8a Revert r126794.
llvm-svn: 126848
2011-03-02 17:54:58 +00:00
Douglas Gregor 9d80212115 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.

llvm-svn: 126844
2011-03-02 17:09:35 +00:00
Douglas Gregor 1f2f796690 Eliminate some unused getQualifierRange() member functions. We deal in nested-name-specifier locations now.
llvm-svn: 126842
2011-03-02 15:13:50 +00:00
John McCall 5fca7eaf85 Don't hard-code these constants, or at least don't hard-code them so hard.
llvm-svn: 126841
2011-03-02 12:29:23 +00:00
John McCall 80ee5963fd 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.

llvm-svn: 126840
2011-03-02 12:15:05 +00:00
John McCall 86bc21ffcf 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.

llvm-svn: 126839
2011-03-02 11:33:24 +00:00
John McCall 79adb25b86 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++.

llvm-svn: 126836
2011-03-02 07:36:25 +00:00
John McCall 81a325e038 Hack in something so that we emit better debug information about
captured __block variables in the block-literal type.

llvm-svn: 126834
2011-03-02 06:57:14 +00:00
John McCall f79e87d727 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.

llvm-svn: 126828
2011-03-02 04:00:57 +00:00
John McCall 8feeb49662 Semantic checking for exception specifications should be triggered by
whether C++ exceptions are enabled, not exceptions in general.  PR9358.

llvm-svn: 126820
2011-03-02 02:04:40 +00:00
Douglas Gregor c52264e719 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.

llvm-svn: 126819
2011-03-02 02:04:06 +00:00
John McCall b4526252db 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.

llvm-svn: 126817
2011-03-02 01:50:55 +00:00
Eli Friedman 846ded2e53 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.

llvm-svn: 126816
2011-03-02 01:49:12 +00:00
Daniel Dunbar 908b48565d build: Allow disabling movt/movw from build, for testing purposes.
llvm-svn: 126810
2011-03-02 00:55:57 +00:00
Douglas Gregor e7c2065379 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.

llvm-svn: 126808
2011-03-02 00:47:37 +00:00
Ted Kremenek eff9a7ff91 Teach CFGBuilder to prune trivially unreachable case statements.
llvm-svn: 126797
2011-03-01 23:12:55 +00:00
Devang Patel 3bc2dedb40 Encode argument numbering in debug info so that code generator can emit them in order.
This fixes few blocks.exp regressions.

llvm-svn: 126795
2011-03-01 22:59:40 +00:00
Benjamin Kramer 51477bd0d0 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!

llvm-svn: 126791
2011-03-01 22:50:47 +00:00
Ted Kremenek e96dad9544 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.

llvm-svn: 126779
2011-03-01 20:34:48 +00:00
Douglas Gregor a7a795bed1 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.

llvm-svn: 126776
2011-03-01 20:11:18 +00:00
Douglas Gregor 1bbd2d2ece Kill off more names to fix this test
llvm-svn: 126775
2011-03-01 19:55:40 +00:00
Dan Gohman 72346e97b3 Revert 123553, as sys::fs::unique_file is not finished yet.
llvm-svn: 126772
2011-03-01 19:50:49 +00:00
Ted Kremenek 26bbc3d494 Don't warning about shifting by too many bits in dead code.
llvm-svn: 126770
2011-03-01 19:13:22 +00:00
Roman Divacky 5e1af659e9 Fix the test.
llvm-svn: 126768
2011-03-01 18:50:59 +00:00
Daniel Dunbar 733b0f87df Driver/Darwin: Be bug compatible with GCC and ignore -pg on ARM.
llvm-svn: 126767
2011-03-01 18:49:30 +00:00
Ted Kremenek df26df726e For C++, enhance -Warray-bounds to recursively analyze array subscript accesses in ?: expressions.
llvm-svn: 126766
2011-03-01 18:41:00 +00:00
Douglas Gregor 844cb50266 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.
  

llvm-svn: 126765
2011-03-01 18:12:44 +00:00
Roman Divacky 432f10df68 The default CPU on FreeBSD for i386 should be i486, not pentium4.
Patch by Dimitry Andric!

llvm-svn: 126763
2011-03-01 18:11:37 +00:00
Ted Kremenek 63657fe995 Don't wanr about "negative shifts" in code that is unreachable. Fixes PR 5544.
llvm-svn: 126762
2011-03-01 18:09:31 +00:00
Roman Divacky 315c1675e8 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!

llvm-svn: 126761
2011-03-01 18:08:03 +00:00
Roman Divacky 2e5065d889 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!

llvm-svn: 126760
2011-03-01 18:03:28 +00:00
Roman Divacky ee8188a23b 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!

llvm-svn: 126757
2011-03-01 17:53:14 +00:00
Roman Divacky 65b88cdb3b Implement -mrtd which sets the StdCall calling convention to be the default
one.

llvm-svn: 126756
2011-03-01 17:40:53 +00:00