]> granicus.if.org Git - clang/log
clang
14 years agoAdd an option to specify the target C++ ABI to the frontend. Use it to
Charles Davis [Fri, 11 Jun 2010 01:06:47 +0000 (01:06 +0000)]
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

14 years agoImprove readability with TRY_TO, remove a redundant comment, and fix one aspect
Chandler Carruth [Fri, 11 Jun 2010 01:00:06 +0000 (01:00 +0000)]
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

14 years agoSplit DependentNameType into two types. DependentNameType represents the
John McCall [Fri, 11 Jun 2010 00:33:02 +0000 (00:33 +0000)]
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

14 years agoProvide a method to clear the current state of a TypeLocBuilder.
John McCall [Fri, 11 Jun 2010 00:26:38 +0000 (00:26 +0000)]
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

14 years agoAvoid repeating the list of operators twice in RecursiveASTVisitor through
Chandler Carruth [Thu, 10 Jun 2010 23:29:40 +0000 (23:29 +0000)]
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

14 years agoTweak a comment on the visitor to clarify one order of visit issue. Patch from
Chandler Carruth [Thu, 10 Jun 2010 23:27:51 +0000 (23:27 +0000)]
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

14 years agoMultiplies, some shifts, set_lane
Nate Begeman [Thu, 10 Jun 2010 18:11:55 +0000 (18:11 +0000)]
Multiplies, some shifts, set_lane

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

14 years agowww: Add note on running clang tests from a CMake build, patch by Peter Collingbourne
Daniel Dunbar [Thu, 10 Jun 2010 17:01:45 +0000 (17:01 +0000)]
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

14 years agoDriver: Also mark -F as RenderJoined, the linker doesn't like "-F FOO" either.
Daniel Dunbar [Thu, 10 Jun 2010 15:53:17 +0000 (15:53 +0000)]
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

14 years agoAnother chunk of the new RecursiveASTVisitor implementation: switch the return
Chandler Carruth [Thu, 10 Jun 2010 10:31:57 +0000 (10:31 +0000)]
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

14 years agoCreate a LinuxTargetInfo on ARM. This make clang correctly expand
Rafael Espindola [Thu, 10 Jun 2010 00:46:51 +0000 (00:46 +0000)]
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

14 years agosupport _lane ops, and multiplies by scalar.
Nate Begeman [Thu, 10 Jun 2010 00:17:56 +0000 (00:17 +0000)]
support _lane ops, and multiplies by scalar.

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

14 years agoAdd a stub Microsoft Visual C++ ABI class (with stub mangler).
Charles Davis [Wed, 9 Jun 2010 23:25:41 +0000 (23:25 +0000)]
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

14 years agotests: Update test for previous change.
Daniel Dunbar [Wed, 9 Jun 2010 23:24:59 +0000 (23:24 +0000)]
tests: Update test for previous change.

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

14 years agoDriver: -L should be marked as RenderJoined, the linker doesn't like "-L FOO".
Daniel Dunbar [Wed, 9 Jun 2010 23:20:37 +0000 (23:20 +0000)]
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

14 years agoDriver: Eliminate flags on aliases, they are unnecessary (and unused).
Daniel Dunbar [Wed, 9 Jun 2010 23:20:34 +0000 (23:20 +0000)]
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

14 years agoDriver: Change Option parsing to always create arguments referring to unaliased
Daniel Dunbar [Wed, 9 Jun 2010 22:44:34 +0000 (22:44 +0000)]
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

14 years agoDriver: Eliminate Arg subclasses, which are now unnecessary.
Daniel Dunbar [Wed, 9 Jun 2010 22:31:08 +0000 (22:31 +0000)]
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

14 years agoDriver: Keep the rendering style in the option, instead of as part of the Arg.
Daniel Dunbar [Wed, 9 Jun 2010 22:31:04 +0000 (22:31 +0000)]
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

14 years agoDriver: Change Arg to just hold the values directly, instead of implicitly
Daniel Dunbar [Wed, 9 Jun 2010 22:31:00 +0000 (22:31 +0000)]
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

14 years agoFrontend: Fix crashes on error paths.
Daniel Dunbar [Wed, 9 Jun 2010 22:30:54 +0000 (22:30 +0000)]
Frontend: Fix crashes on error paths.

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

14 years agoCommit my WIP on constexpr support. This commit: an XFAILed test and treating constex...
Sebastian Redl [Wed, 9 Jun 2010 21:19:43 +0000 (21:19 +0000)]
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

14 years agoFix two typos in comments.
Sebastian Redl [Wed, 9 Jun 2010 21:17:41 +0000 (21:17 +0000)]
Fix two typos in comments.

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

14 years agoRevert "Driver: Change Option parsing to always create arguments referring to
Daniel Dunbar [Wed, 9 Jun 2010 19:27:07 +0000 (19:27 +0000)]
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

14 years agoDriver: Change Option parsing to always create arguments referring to unaliased
Daniel Dunbar [Wed, 9 Jun 2010 19:19:01 +0000 (19:19 +0000)]
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

14 years agoDriver: Add an explicit offset to JoinedArg and JoinedAndSeparateArg, so that
Daniel Dunbar [Wed, 9 Jun 2010 18:49:38 +0000 (18:49 +0000)]
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

14 years agoDriver: Change Arg::render methods to use option name instead of string where
Daniel Dunbar [Wed, 9 Jun 2010 18:49:31 +0000 (18:49 +0000)]
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

14 years agoImplement codegen for hadd, hsub, max, min, mlal, movl, movn, padal, mov_n
Nate Begeman [Wed, 9 Jun 2010 18:04:15 +0000 (18:04 +0000)]
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

14 years agoAdded inherited info to template and non-type arguments of templates.
Abramo Bagnara [Wed, 9 Jun 2010 09:26:05 +0000 (09:26 +0000)]
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

14 years agoMajor redesign of the RecursiveASTVisitor. This implements the majority of the
Chandler Carruth [Wed, 9 Jun 2010 08:17:30 +0000 (08:17 +0000)]
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

14 years agoRemove an entry for a now deleted file. Fixes the neglected CMake build. ;]
Chandler Carruth [Wed, 9 Jun 2010 08:12:12 +0000 (08:12 +0000)]
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

14 years agoCorrectly handle > 257 substitutions in a single mangling, and don't introduce
John McCall [Wed, 9 Jun 2010 07:26:17 +0000 (07:26 +0000)]
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

14 years agoMerge StackAddrLeakChecker and ReturnStackAddressChecker.
Zhongxing Xu [Wed, 9 Jun 2010 06:08:24 +0000 (06:08 +0000)]
Merge StackAddrLeakChecker and ReturnStackAddressChecker.

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

14 years agoDirectly compare the StackFrameContext. This greatly simplifies logic and
Zhongxing Xu [Wed, 9 Jun 2010 05:50:38 +0000 (05:50 +0000)]
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

14 years agoMore accurate BuiltinsARM.def
Nate Begeman [Wed, 9 Jun 2010 05:30:26 +0000 (05:30 +0000)]
More accurate BuiltinsARM.def
vget_lane support

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

14 years agoFix a typo that breaks the GCC build. Turns out that Clang isn't
Douglas Gregor [Wed, 9 Jun 2010 05:25:34 +0000 (05:25 +0000)]
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

14 years agoAdded FixIt support to printf format string checking.
Tom Care [Wed, 9 Jun 2010 04:11:11 +0000 (04:11 +0000)]
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

14 years agoTweak our handling of the notion of a standard conversion sequence
Douglas Gregor [Wed, 9 Jun 2010 03:53:18 +0000 (03:53 +0000)]
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

14 years agoSimplify the code a bit and avoid a gcc waring about uninitialized variables.
Rafael Espindola [Wed, 9 Jun 2010 03:48:40 +0000 (03:48 +0000)]
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

14 years agoGet rid of getMangledCXXCtorName and getMangledCXXDtorName.
Anders Carlsson [Wed, 9 Jun 2010 02:36:32 +0000 (02:36 +0000)]
Get rid of getMangledCXXCtorName and getMangledCXXDtorName.

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

14 years agoMore mangling cleanup.
Anders Carlsson [Wed, 9 Jun 2010 02:30:12 +0000 (02:30 +0000)]
More mangling cleanup.

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

14 years agoGet rid of an unnecessary getMangledName overload.
Anders Carlsson [Wed, 9 Jun 2010 02:20:01 +0000 (02:20 +0000)]
Get rid of an unnecessary getMangledName overload.

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

14 years agoFix a gcc warning.
Rafael Espindola [Wed, 9 Jun 2010 02:17:08 +0000 (02:17 +0000)]
Fix a gcc warning.

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

14 years agoFix test.
Anders Carlsson [Wed, 9 Jun 2010 01:42:52 +0000 (01:42 +0000)]
Fix test.

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

14 years agoImplement transpose/zip/unzip & table lookup.
Nate Begeman [Wed, 9 Jun 2010 01:10:23 +0000 (01:10 +0000)]
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

14 years agoAdded helper function to Type class to determine if a type is a builtin type. This...
Tom Care [Wed, 9 Jun 2010 00:15:39 +0000 (00:15 +0000)]
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

14 years agoTry to fix buildbot tests.
Anders Carlsson [Tue, 8 Jun 2010 23:10:20 +0000 (23:10 +0000)]
Try to fix buildbot tests.

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

14 years agoFix memory leak in ASTContext where ASTRecordLayout objects involving C++ structures...
Ted Kremenek [Tue, 8 Jun 2010 23:00:58 +0000 (23:00 +0000)]
Fix memory leak in ASTContext where ASTRecordLayout objects involving C++ structures wouldn't have
their associated memory destroyed when using a BumpPtrAllocator.  These objects internally use
a DenseMap.

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

14 years agoFix memory leak in Preprocessor where MacroInfo objects in the MICache wouldn't have...
Ted Kremenek [Tue, 8 Jun 2010 23:00:53 +0000 (23:00 +0000)]
Fix memory leak in Preprocessor where MacroInfo objects in the MICache wouldn't have their
associated SmallVectors get deallocated.

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

14 years agoCode cleanup: remove explicit flush() in favor of using the ostream's str()
Jordy Rose [Tue, 8 Jun 2010 22:59:01 +0000 (22:59 +0000)]
Code cleanup: remove explicit flush() in favor of using the ostream's str()

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

14 years agoAdd test case.
Anders Carlsson [Tue, 8 Jun 2010 22:48:02 +0000 (22:48 +0000)]
Add test case.

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

14 years agoOn Darwin, initialization and destruction functions should go into the __StaticInit...
Anders Carlsson [Tue, 8 Jun 2010 22:47:50 +0000 (22:47 +0000)]
On Darwin, initialization and destruction functions should go into the __StaticInit section.

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

14 years agoAdd a global CreateGlobalInitOrDestructFunction and use it for creating global init...
Anders Carlsson [Tue, 8 Jun 2010 22:40:05 +0000 (22:40 +0000)]
Add a global CreateGlobalInitOrDestructFunction and use it for creating global init or destruction functions.

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

14 years agoRename __tcf_ to __cxx_global_array_dtor. Remove the UniqueAggreDestructorCount from...
Anders Carlsson [Tue, 8 Jun 2010 22:30:17 +0000 (22:30 +0000)]
Rename __tcf_ to __cxx_global_array_dtor. Remove the UniqueAggreDestructorCount from CodeGenFunction and let LLVM handle uniquing the internal functions instead.

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

14 years agoMove GenerateCXXAggrDestructorHelper to CGDeclCXX.cpp where it belongs.
Anders Carlsson [Tue, 8 Jun 2010 22:17:27 +0000 (22:17 +0000)]
Move GenerateCXXAggrDestructorHelper to CGDeclCXX.cpp where it belongs.

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

14 years agoSimplify GenerateCXXAggrDestructorHelper.
Anders Carlsson [Tue, 8 Jun 2010 22:14:59 +0000 (22:14 +0000)]
Simplify GenerateCXXAggrDestructorHelper.

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

14 years agoGlobally disable -fno-strict-aliasing, for reasons given in the comment.
Daniel Dunbar [Tue, 8 Jun 2010 21:55:02 +0000 (21:55 +0000)]
Globally disable -fno-strict-aliasing, for reasons given in the comment.

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

14 years agoWhen referring to a tag that was previously declared only as a friend,
Douglas Gregor [Tue, 8 Jun 2010 21:27:36 +0000 (21:27 +0000)]
When referring to a tag that was previously declared only as a friend,
build a new declaration for that tag type that will be visible for
future lookups of that tag.

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

14 years agoA built-in overload candidate is consider a non-template function when
Douglas Gregor [Tue, 8 Jun 2010 21:03:17 +0000 (21:03 +0000)]
A built-in overload candidate is consider a non-template function when
determining whether one overload candidate is better than
another. Fixes PR7319.

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

14 years agoBlock Code Gen. API. Call destructor on descriptior
Fariborz Jahanian [Tue, 8 Jun 2010 20:57:22 +0000 (20:57 +0000)]
Block Code Gen. API. Call destructor on descriptior
entry previously constructed via copy constructor.

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

14 years agoMakefiles: Remove unnecessary early include of Makefile.config.
Daniel Dunbar [Tue, 8 Jun 2010 20:57:22 +0000 (20:57 +0000)]
Makefiles: Remove unnecessary early include of Makefile.config.

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

14 years agoSimplify libIndex Makefile, which doesn't need to worry about altivec support.
Daniel Dunbar [Tue, 8 Jun 2010 20:57:18 +0000 (20:57 +0000)]
Simplify libIndex Makefile, which doesn't need to worry about altivec support.

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

14 years agoMakefiles: Set Clang CPP compiler flags in a single location, instead of scattered...
Daniel Dunbar [Tue, 8 Jun 2010 20:44:43 +0000 (20:44 +0000)]
Makefiles: Set Clang CPP compiler flags in a single location, instead of scattered throughout the project Makefiles.

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

14 years agoMakefile: Switch Clang Makefiles to always include the top-level Clang Makefile.
Daniel Dunbar [Tue, 8 Jun 2010 20:34:18 +0000 (20:34 +0000)]
Makefile: Switch Clang Makefiles to always include the top-level Clang Makefile.
 - This eliminates most dependencies on how Clang is installed relative to LLVM.

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

14 years agoUpdate Xcode project.
Anders Carlsson [Tue, 8 Jun 2010 20:02:04 +0000 (20:02 +0000)]
Update Xcode project.

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

14 years agoWarn about comparisons between arrays and improve self-comparison
Douglas Gregor [Tue, 8 Jun 2010 19:50:34 +0000 (19:50 +0000)]
Warn about comparisons between arrays and improve self-comparison
warnings, from Troy Straszheim! Fixes PR6163.

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

14 years agoTeach the PrintFunctionNames example to be a proper module, so that
Douglas Gregor [Tue, 8 Jun 2010 19:23:49 +0000 (19:23 +0000)]
Teach the PrintFunctionNames example to be a proper module, so that
Clang can load it as a plugin. Original fix by Troy D. Straszheim,
which I extended with Darwin support. Fixes PR6801.

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

14 years agoCorrectly handle fields with virtual bases containing empty subobjects.
Anders Carlsson [Tue, 8 Jun 2010 19:09:24 +0000 (19:09 +0000)]
Correctly handle fields with virtual bases containing empty subobjects.

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

14 years agoAdd ccc-analyzer support for '-imacros'. Fixes PR 7204.
Ted Kremenek [Tue, 8 Jun 2010 18:27:55 +0000 (18:27 +0000)]
Add ccc-analyzer support for '-imacros'.  Fixes PR 7204.

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

14 years agoFixes a typo which prevented proper code gen. for
Fariborz Jahanian [Tue, 8 Jun 2010 17:52:11 +0000 (17:52 +0000)]
Fixes a typo which prevented proper code gen. for
copy-in of c++ class objects into blocks.

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

14 years agoImplement a warning when converting the literal 'false' to a
Douglas Gregor [Tue, 8 Jun 2010 17:35:15 +0000 (17:35 +0000)]
Implement a warning when converting the literal 'false' to a
pointer. Original patch by Troy D. Straszheim; fixes PR7283.

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

14 years agoWhen checking whether we can place a base subobject at an offset, we don't need to...
Anders Carlsson [Tue, 8 Jun 2010 16:20:35 +0000 (16:20 +0000)]
When checking whether we can place a base subobject at an offset, we don't need to go past the highest offset that's known to contain an empty base subobject.

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

14 years agoMinor cleanups to the empty subobject map.
Anders Carlsson [Tue, 8 Jun 2010 15:56:03 +0000 (15:56 +0000)]
Minor cleanups to the empty subobject map.

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

14 years agoUpdate LINK_COMPONENTS for examples.
Daniel Dunbar [Tue, 8 Jun 2010 15:38:01 +0000 (15:38 +0000)]
Update LINK_COMPONENTS for examples.

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

14 years agoCorrectly mangle static variables of anonymous struct/union type.
Anders Carlsson [Tue, 8 Jun 2010 14:49:03 +0000 (14:49 +0000)]
Correctly mangle static variables of anonymous struct/union type.

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

14 years agoToken is POD-like.
Benjamin Kramer [Tue, 8 Jun 2010 11:23:26 +0000 (11:23 +0000)]
Token is POD-like.

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

14 years agoAdd a checker check if a global variable holds a local variable's address after
Zhongxing Xu [Tue, 8 Jun 2010 10:00:00 +0000 (10:00 +0000)]
Add a checker check if a global variable holds a local variable's address after
the function call is left where the local variable is declared.

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

14 years agoFix NEON intrinsic argument passing, support vext. Most now successfully make it...
Nate Begeman [Tue, 8 Jun 2010 06:03:01 +0000 (06:03 +0000)]
Fix NEON intrinsic argument passing, support vext.  Most now successfully make it through codegen to the .s file

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

14 years agoImplement -fcaret-diagnostics to undo -fno-caret-diagnostics.
Jeffrey Yasskin [Tue, 8 Jun 2010 04:56:20 +0000 (04:56 +0000)]
Implement -fcaret-diagnostics to undo -fno-caret-diagnostics.

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

14 years agoAdd a test to the previous commit.
Rafael Espindola [Tue, 8 Jun 2010 03:59:28 +0000 (03:59 +0000)]
Add a test to the previous commit.

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

14 years agoFix what looks like a merge problem that broke __clear_cache.
Rafael Espindola [Tue, 8 Jun 2010 03:52:53 +0000 (03:52 +0000)]
Fix what looks like a merge problem that broke __clear_cache.

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

14 years agoAdd test for previous commit.
Rafael Espindola [Tue, 8 Jun 2010 03:29:31 +0000 (03:29 +0000)]
Add test for previous commit.

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

14 years agoSince the enum values for each arch's builtins overlap, it is not appropriate to...
Nate Begeman [Tue, 8 Jun 2010 02:47:44 +0000 (02:47 +0000)]
Since the enum values for each arch's builtins overlap, it is not appropriate to check them when compiling or other archs.  Fixes a problem where compiling for NEON would use x86 sema rules.

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

14 years agoFix passing and returning of objects with non trivial copy constructors on
Rafael Espindola [Tue, 8 Jun 2010 02:42:08 +0000 (02:42 +0000)]
Fix passing and returning of objects with non trivial copy constructors on
ARM.

Fixes PR7310.

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

14 years agoImplement ARM NEON up through vcvt, alphabetically.
Nate Begeman [Tue, 8 Jun 2010 00:17:19 +0000 (00:17 +0000)]
Implement ARM NEON up through vcvt, alphabetically.

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

14 years agoExtend __builtin_shufflevector to expose the full power of the llvm shufflevector...
Nate Begeman [Tue, 8 Jun 2010 00:16:34 +0000 (00:16 +0000)]
Extend __builtin_shufflevector to expose the full power of the llvm shufflevector instruction.  This means it can now be used for vector truncation and concatenation.  This will be used for the ARM NEON implementation.

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

14 years agoDriver: Support invoking Clang on .ll or .bc inputs.
Daniel Dunbar [Mon, 7 Jun 2010 23:28:45 +0000 (23:28 +0000)]
Driver: Support invoking Clang on .ll or .bc inputs.
 - We actually pretend that we have two separate types for LLVM assembly/bitcode because we need to use the standard suffixes with LTO ('clang -O4 -c t.c' should generate 't.o').

It is now possible to do something like:
  $ clang -emit-llvm -S t.c -o t.ll ... assorted other compile flags ...
  $ clang -c t.ll -o t.o ... assorted other compile flags ...
and expect that the output will be almost* identical to:
  $ clang -c t.c -o t.o ... assorted other compile flags ...
because all the target settings (default CPU, target features, etc.) will all be initialized properly by the driver/frontend.

*: This isn't perfect yet, because in practice we will end up running the optimization passes twice. It's possible to get something equivalent out with a well placed -mllvm -disable-llvm-optzns, but I'm still thinking about the cleanest way to solve this problem more generally.

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

14 years agoFrontend: Add CodeGenAction support for handling LLVM IR.\r - This magically enables...
Daniel Dunbar [Mon, 7 Jun 2010 23:27:59 +0000 (23:27 +0000)]
Frontend: Add CodeGenAction support for handling LLVM IR.\r - This magically enables using 'clang -cc1' as a replacement for most of 'llvm-as', 'llvm-dis', 'llc' and 'opt' functionality.\r\rFor example, 'llvm-as' is:\r  $ clang -cc1 -emit-llvm-bc FOO.ll -o FOO.bc
and 'llvm-dis' is:\r  $ clang -cc1 -emit-llvm    FOO.bc -o -
and 'opt' is, e.g.:
  $ clang -cc1 -emit-llvm -O3 -o FOO.opt.ll FOO.ll
and 'llc' is, e.g.:
  $ clang -cc1 -S -o - FOO.ll

The nice thing about using the backend tools this way is that they are guaranteed to exactly match how the compiler generates code (for example, setting the same backend options).

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

14 years agoFrontend: Add FrontendAction support for handling LLVM IR inputs.
Daniel Dunbar [Mon, 7 Jun 2010 23:26:47 +0000 (23:26 +0000)]
Frontend: Add FrontendAction support for handling LLVM IR inputs.
 - These inputs follow an abbreviated execution path, but are still worth handling by FrontendAction so they reuse all the other clang -cc1 features.

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

14 years agoFrontendAction: Track active file kind.
Daniel Dunbar [Mon, 7 Jun 2010 23:25:49 +0000 (23:25 +0000)]
FrontendAction: Track active file kind.

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

14 years agoFrontend: Rename hasASTSupport to hasASTFileSupport, which is more accurate.
Daniel Dunbar [Mon, 7 Jun 2010 23:24:43 +0000 (23:24 +0000)]
Frontend: Rename hasASTSupport to hasASTFileSupport, which is more accurate.

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

14 years agoFrontend: Move some initialization from CompilerInstance to FrontendAction, to parall...
Daniel Dunbar [Mon, 7 Jun 2010 23:23:50 +0000 (23:23 +0000)]
Frontend: Move some initialization from CompilerInstance to FrontendAction, to parallel what is done for AST inputs.

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

14 years agoFrontend: Change FrontendAction::BeginSourceFile to take the input kind instead of...
Daniel Dunbar [Mon, 7 Jun 2010 23:23:06 +0000 (23:23 +0000)]
Frontend: Change FrontendAction::BeginSourceFile to take the input kind instead of an IsAST bool.

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

14 years agoFrontend: Lift InputKind enumeration to top level.
Daniel Dunbar [Mon, 7 Jun 2010 23:22:09 +0000 (23:22 +0000)]
Frontend: Lift InputKind enumeration to top level.

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

14 years agoFrontend: Drop unnecessary TargetData argument to EmitBackendOutput, we always
Daniel Dunbar [Mon, 7 Jun 2010 23:21:04 +0000 (23:21 +0000)]
Frontend: Drop unnecessary TargetData argument to EmitBackendOutput, we always
create modules which have target data strings.

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

14 years agoFrontend: Factor clang::EmitBackendOutput out of CodeGenAction.
Daniel Dunbar [Mon, 7 Jun 2010 23:20:08 +0000 (23:20 +0000)]
Frontend: Factor clang::EmitBackendOutput out of CodeGenAction.

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

14 years agoFrontend: Add CodeGenOptions::SimplifyLibCalls, and eliminate LangOptions argument...
Daniel Dunbar [Mon, 7 Jun 2010 23:19:17 +0000 (23:19 +0000)]
Frontend: Add CodeGenOptions::SimplifyLibCalls, and eliminate LangOptions argument to BackendConsumer.

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

14 years agoWhen using property-dot assignment syntax to call a setter method,
Fariborz Jahanian [Mon, 7 Jun 2010 22:02:01 +0000 (22:02 +0000)]
When using property-dot assignment syntax to call a setter method,
type of rhs need be compared to setter's argument and
not the getter type. Fixes radar 8062778

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

14 years agoFixed a block regression caused by trying to use
Fariborz Jahanian [Mon, 7 Jun 2010 19:39:39 +0000 (19:39 +0000)]
Fixed a block regression caused by trying to use
an existing ir for load of a bock variable. This cannot be
done across basic blocks.
Fixes radar 8064140.

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

14 years agoCatch free()s on non-regions and regions known to be not from malloc(), by checking...
Jordy Rose [Mon, 7 Jun 2010 19:32:37 +0000 (19:32 +0000)]
Catch free()s on non-regions and regions known to be not from malloc(), by checking the symbol type and memory space.

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