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

22180 Коммитов

Автор SHA1 Сообщение Дата
Charles Davis 971154db24 When mangling for the Microsoft C++ ABI, mangle variables in the global
namespace, too.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105809 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-11 04:25:47 +00:00
Tom Care 876e994957 Small fixes regarding printf fix suggestions.
- Added some handling of flags that become invalid when changing the conversion specifier.
- Changed fixit behavior to remove unnecessary length modifiers.
- Separated some tests out and added some comments.

modified:
  lib/Analysis/PrintfFormatString.cpp
  test/Sema/format-strings-fixit.c


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105807 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-11 04:22:02 +00:00
Charles Davis e60cea829b Start implementing the Microsoft-style name mangler. Mangle simple names
(but not their types; that's later).

NOTE: Right now, variables in the global namespace don't get mangled, even
though they're supposed to be. This is because the default mangler
implements the shouldMangleDeclName() method that tells clang not to mangle
them. This will be fixed in a later patch.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105805 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-11 03:07:32 +00:00
Charles Davis 98b7c5c496 Add an option to specify the target C++ ABI to the frontend. Use it to
select either the default Itanium ABI or the new, experimental Microsoft ABI.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105804 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-11 01:06:47 +00:00
Chandler Carruth 6c321e3500 Improve readability with TRY_TO, remove a redundant comment, and fix one aspect
of the recursion on VarDecls. Patch by Craig Silverstein.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105803 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-11 01:00:06 +00:00
John McCall 33500955d7 Split DependentNameType into two types. DependentNameType represents the
case of an elaborated-type-specifier like 'typename A<T>::foo', and
DependentTemplateSpecializationType represents the case of an
elaborated-type-specifier like 'typename A<T>::template B<T>'.  The TypeLoc
representation of a DependentTST conveniently exactly matches that of an
ElaboratedType wrapping a TST.

Kill off the explicit rebuild methods for RebuildInCurrentInstantiation;
the standard implementations work fine because the nested name specifier
is computable in the newly-entered context.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105801 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-11 00:33:02 +00:00
John McCall 480076c3de Provide a method to clear the current state of a TypeLocBuilder.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105800 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-11 00:26:38 +00:00
Chandler Carruth 7d66f8cafd Avoid repeating the list of operators twice in RecursiveASTVisitor through
a set of preprocessor macros. Patch by Zhanyong Wan.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105796 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-10 23:29:40 +00:00
Chandler Carruth b5c202f9e4 Tweak a comment on the visitor to clarify one order of visit issue. Patch from
Zhanyong Wan.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105795 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-10 23:27:51 +00:00
Nate Begeman 548f7daa59 Multiplies, some shifts, set_lane
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105793 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-10 18:11:55 +00:00
Daniel Dunbar df29378014 www: Add note on running clang tests from a CMake build, patch by Peter Collingbourne
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105791 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-10 17:01:45 +00:00
Daniel Dunbar ed5d5eea46 Driver: Also mark -F as RenderJoined, the linker doesn't like "-F FOO" either.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105789 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-10 15:53:17 +00:00
Chandler Carruth e3e210c3aa Another chunk of the new RecursiveASTVisitor implementation: switch the return
value semantics such that we recurse while the visitors return true, and halt
as soon as one returns false. Patch by csilvers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105787 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-10 10:31:57 +00:00
Rafael Espindola 022a8a59f6 Create a LinuxTargetInfo on ARM. This make clang correctly expand
__USER_LABEL_PREFIX__.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105771 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-10 00:46:51 +00:00
Nate Begeman d075c01c35 support _lane ops, and multiplies by scalar.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105770 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-10 00:17:56 +00:00
Charles Davis c3926645d7 Add a stub Microsoft Visual C++ ABI class (with stub mangler).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105767 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-09 23:25:41 +00:00
Daniel Dunbar 41f1423d29 tests: Update test for previous change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105766 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-09 23:24:59 +00:00
Daniel Dunbar 482f1c8c4d Driver: -L should be marked as RenderJoined, the linker doesn't like "-L FOO".
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105765 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-09 23:20:37 +00:00
Daniel Dunbar 8a9b18c04c Driver: Eliminate flags on aliases, they are unnecessary (and unused).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105764 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-09 23:20:34 +00:00
Daniel Dunbar 3856ab3502 Driver: Change Option parsing to always create arguments referring to unaliased
options.
 - This matches the intent of the .td files, and will simplify alias handling.
 - PR7321.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105763 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-09 22:44:34 +00:00
Daniel Dunbar 532c1ec307 Driver: Eliminate Arg subclasses, which are now unnecessary.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105762 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-09 22:31:08 +00:00
Daniel Dunbar e375c4a02a Driver: Keep the rendering style in the option, instead of as part of the Arg.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105761 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-09 22:31:04 +00:00
Daniel Dunbar 4465a776a5 Driver: Change Arg to just hold the values directly, instead of implicitly
deriving them from the Arg type.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105760 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-09 22:31:00 +00:00
Daniel Dunbar bfbb39deab Frontend: Fix crashes on error paths.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105759 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-09 22:30:54 +00:00
Sebastian Redl 737801257f Commit my WIP on constexpr support. This commit: an XFAILed test and treating constexpr as a top-level const.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105752 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-09 21:19:43 +00:00
Sebastian Redl 515ddd8f7a Fix two typos in comments.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105751 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-09 21:17:41 +00:00
Daniel Dunbar e5af3b3eef Revert "Driver: Change Option parsing to always create arguments referring to
unaliased", this isn't quite right yet.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105747 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-09 19:27:07 +00:00
Daniel Dunbar 22685f40db Driver: Change Option parsing to always create arguments referring to unaliased
options.
 - This matches the intent of the .td files, and will simplify alias handling.
 - PR7321.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105744 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-09 19:19:01 +00:00
Daniel Dunbar 312a8b726e Driver: Add an explicit offset to JoinedArg and JoinedAndSeparateArg, so that
they can be independent of the exact option that created them.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105739 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-09 18:49:38 +00:00
Daniel Dunbar a3f28c341a Driver: Change Arg::render methods to use option name instead of string where
possible.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105738 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-09 18:49:31 +00:00
Nate Begeman df98e1d1da Implement codegen for hadd, hsub, max, min, mlal, movl, movn, padal, mov_n
Make note about how to handle the dozen or so multiply by scalar ops.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105734 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-09 18:04:15 +00:00
Abramo Bagnara d92f7a297c Added inherited info to template and non-type arguments of templates.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105716 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-09 09:26:05 +00:00
Chandler Carruth dfc35e3317 Major redesign of the RecursiveASTVisitor. This implements the majority of the
new design discussed on cfe-dev, with further steps in that direction to come.
It is already much more complete than the previous visitor.

Patch by Zhanyong and Craig with 80 column wraps and one missing declaration
added by me.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105709 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-09 08:17:30 +00:00
Chandler Carruth a3b6727d31 Remove an entry for a now deleted file. Fixes the neglected CMake build. ;]
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105708 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-09 08:12:12 +00:00
John McCall 6ab30e0c02 Correctly handle > 257 substitutions in a single mangling, and don't introduce
a spurious substitution for an unscoped dependent template-id after introducing
a substitution for the scoped template-id.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105699 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-09 07:26:17 +00:00
Zhongxing Xu 9b1468311d Merge StackAddrLeakChecker and ReturnStackAddressChecker.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105687 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-09 06:08:24 +00:00
Zhongxing Xu 2c46458d4c Directly compare the StackFrameContext. This greatly simplifies logic and
improves generality. Thanks Ted.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105686 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-09 05:50:38 +00:00
Nate Begeman 95450f6ffc More accurate BuiltinsARM.def
vget_lane support


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105684 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-09 05:30:26 +00:00
Douglas Gregor c8c4b4088c Fix a typo that breaks the GCC build. Turns out that Clang isn't
diagnosing this code as an error when it should, so I've filed
http://llvm.org/bugs/show_bug.cgi?id=7325. 


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105683 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-09 05:25:34 +00:00
Tom Care 3bfc5f49e0 Added FixIt support to printf format string checking.
- Refactored LengthModifier to be a class.
- Added toString methods in all member classes of FormatSpecifier.
- FixIt suggestions keep user specified flags unless incorrect.

Limitations:
- The suggestions are not conversion specifier sensitive. For example, if we have a 'pad with zeroes' flag, and the correction is a string conversion specifier, we do not remove the flag. Clang will warn us on the next compilation.

A    test/Sema/format-strings-fixit.c
M    include/clang/Analysis/Analyses/PrintfFormatString.h
M    lib/Analysis/PrintfFormatString.cpp
M    lib/Sema/SemaChecking.cpp


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105680 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-09 04:11:11 +00:00
Douglas Gregor 5a57efd7bf Tweak our handling of the notion of a standard conversion sequence
being a subsequence of another standard conversion sequence. Instead
of requiring exact type equality for the second conversion step,
require type *similarity*, which is type equality with cv-qualifiers
removed at all levels. This appears to match the behavior of EDG and
VC++ (albeit not GCC), and feels more intuitive. Big thanks to John
for the line of reasoning that supports this change: since
cv-qualifiers are orthogonal to the second conversion step, we should
ignore them in the type comparison.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105678 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-09 03:53:18 +00:00
Rafael Espindola e140af3e27 Simplify the code a bit and avoid a gcc waring about uninitialized variables.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105676 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-09 03:48:40 +00:00
Anders Carlsson 9a8822bb15 Get rid of getMangledCXXCtorName and getMangledCXXDtorName.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105673 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-09 02:36:32 +00:00
Anders Carlsson dc709a8aea More mangling cleanup.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105672 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-09 02:30:12 +00:00
Anders Carlsson afd04290de Get rid of an unnecessary getMangledName overload.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105671 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-09 02:20:01 +00:00
Rafael Espindola 3f4cb120fe Fix a gcc warning.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105670 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-09 02:17:08 +00:00
Anders Carlsson 9df792c199 Fix test.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105668 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-09 01:42:52 +00:00
Nate Begeman 1c2a88cfae Implement transpose/zip/unzip & table lookup.
Test out some basic constant-checking.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105667 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-09 01:10:23 +00:00
Tom Care 9b065ddabf Added helper function to Type class to determine if a type is a builtin type. This complements the existing function that determines if a type is a specific builtin type.
Modified:
    include/clang/AST/Type.h


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105664 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-09 00:15:39 +00:00
Anders Carlsson 56833bc2af Try to fix buildbot tests.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105660 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-08 23:10:20 +00:00