Граф коммитов

27666 Коммитов

Автор SHA1 Сообщение Дата
Douglas Gregor 94fdffa4a5 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
2011-03-01 20:11:18 +00:00
Douglas Gregor 438d7f05d3 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
2011-03-01 19:55:40 +00:00
Dan Gohman ef165c94cf 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
2011-03-01 19:50:49 +00:00
Ted Kremenek 425a31e03a 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
2011-03-01 19:13:22 +00:00
Roman Divacky d25f485fdf Fix the test.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126768 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-01 18:50:59 +00:00
Daniel Dunbar bbe8e3eff5 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
2011-03-01 18:49:30 +00:00
Ted Kremenek 3aea4dac83 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
2011-03-01 18:41:00 +00:00
Douglas Gregor 9e876876af 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
2011-03-01 18:12:44 +00:00
Roman Divacky 451f8caf37 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
2011-03-01 18:11:37 +00:00
Ted Kremenek 082bf7a47f 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
2011-03-01 18:09:31 +00:00
Roman Divacky 630766057e 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
2011-03-01 18:08:03 +00:00
Roman Divacky 20f1462f81 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
2011-03-01 18:03:28 +00:00
Roman Divacky 58e5ac9d41 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
2011-03-01 17:53:14 +00:00
Roman Divacky cfe9af250f 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
2011-03-01 17:40:53 +00:00
Roman Divacky 1c51b1ca1f Add missing options.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126755 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-01 17:36:40 +00:00
Fariborz Jahanian c0ddef2313 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
2011-03-01 17:28:13 +00:00
Douglas Gregor 2786864406 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
2011-03-01 17:25:47 +00:00
Douglas Gregor 90566c0e7b 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
2011-03-01 17:16:20 +00:00
Douglas Gregor fff951371d 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
2011-03-01 17:04:42 +00:00
Douglas Gregor ef24c4b85e 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
2011-03-01 16:44:30 +00:00
Douglas Gregor be38c5f5d8 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
2011-03-01 16:31:39 +00:00
Douglas Gregor 44cd9f9d68 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
2011-03-01 15:34:37 +00:00
Rafael Espindola 9c094fbcfa 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
2011-03-01 05:25:27 +00:00
Chandler Carruth e34e3f1658 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
2011-03-01 03:29:37 +00:00
Ted Kremenek 3c0349e87c 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
2011-03-01 03:15:10 +00:00
Douglas Gregor 239cbb023c 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
2011-03-01 03:11:17 +00:00
Argyrios Kyrtzidis 4ba48c4341 [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
2011-03-01 01:59:41 +00:00
Argyrios Kyrtzidis 25a792b036 [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
2011-03-01 01:47:48 +00:00
Ken Dyck 3b3e1a1e8b 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
2011-03-01 01:36:00 +00:00
Douglas Gregor 2494dd024b 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
2011-03-01 01:34:45 +00:00
Argyrios Kyrtzidis 7636d8853f [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
2011-03-01 01:24:23 +00:00
Ken Dyck 5dc989c4f6 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
2011-03-01 01:22:45 +00:00
Argyrios Kyrtzidis ec8605f1d7 [analyzer] Rename CheckerV2 -> Checker.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126726 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-01 01:16:21 +00:00
Argyrios Kyrtzidis d26a475068 [analyzer] Remove Checker V1.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126725 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-01 01:16:08 +00:00
Argyrios Kyrtzidis eb48bd1dd4 [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
2011-03-01 01:16:03 +00:00
Zhanyong Wan 9f8862aa64 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
2011-03-01 00:45:32 +00:00
Douglas Gregor 640519e971 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
2011-03-01 00:34:57 +00:00
Chris Lattner 2cb4222338 -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
2011-03-01 00:03:48 +00:00
Douglas Gregor 5f791bb444 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
2011-02-28 23:58:31 +00:00
Rafael Espindola 035ff0c674 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
2011-02-28 23:29:45 +00:00
Douglas Gregor e29425bd22 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
2011-02-28 22:42:13 +00:00
Devang Patel 5c5b5878d8 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
2011-02-28 22:32:45 +00:00
Argyrios Kyrtzidis c367a876d0 [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
2011-02-28 22:30:38 +00:00
Douglas Gregor 40d96a69c0 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
2011-02-28 21:54:11 +00:00
Fariborz Jahanian bf1f826dda Revert r126678.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126685 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-28 21:19:34 +00:00
Douglas Gregor 4c9be89bb6 Push nested-name-specifier source location information into
UnresolvedLookupExpr and UnresolvedMemberExpr.

Also, improve the computation that checks whether the base of a member
expression (either unresolved or dependent-scoped) is implicit. The
previous check didn't cover all of the cases we use in our
representation, which threw off source-location information for these
expressions (which, in turn, caused some breakage in libclang's token
annotation). 



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126681 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-28 20:01:57 +00:00
Fariborz Jahanian 3d04a0e534 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@126678 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-28 19:55:59 +00:00
Argyrios Kyrtzidis c4d2c9074b [analyzer] Remove '-analyzer-check-objc-mem' flag, the nominee for best misnomer award.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126676 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-28 19:49:42 +00:00
Argyrios Kyrtzidis 872b8d1e81 Move test/SemaObjC/method-arg-decay.m -> test/Analysis/method-arg-decay.m
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126675 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-28 19:49:21 +00:00
Argyrios Kyrtzidis d655ab28fd [analyzer] Run the ExprEngine depending on the CheckerManager having path-sensitive checkers.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126674 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-28 19:49:17 +00:00