]> granicus.if.org Git - clang/log
clang
14 years agofix tests
Nuno Lopes [Tue, 27 Oct 2009 10:09:29 +0000 (10:09 +0000)]
fix tests

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

14 years agoOnly set the point of instantiation for an implicit or explicit
Douglas Gregor [Tue, 27 Oct 2009 06:26:26 +0000 (06:26 +0000)]
Only set the point of instantiation for an implicit or explicit
instantiation once we have committed to performing the
instantiation. As part of this, make our makeshift
template-instantiation location information suck slightly less.

Fixes PR5264.

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

14 years agoTypo in revision 85201.
Edward O'Callaghan [Tue, 27 Oct 2009 03:59:44 +0000 (03:59 +0000)]
Typo in revision 85201.

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

14 years agoConvert Preprocessor Clang tests to FileCheck in regards to PR5307.
Edward O'Callaghan [Tue, 27 Oct 2009 03:47:36 +0000 (03:47 +0000)]
Convert Preprocessor Clang tests to FileCheck in regards to PR5307.

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

14 years agoFix a broken test in rev. 85199.
Edward O'Callaghan [Tue, 27 Oct 2009 03:14:56 +0000 (03:14 +0000)]
Fix a broken test in rev. 85199.

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

14 years agoConvert Preprocessor Clang tests to FileCheck in regards to PR5307.
Edward O'Callaghan [Tue, 27 Oct 2009 02:36:32 +0000 (02:36 +0000)]
Convert Preprocessor Clang tests to FileCheck in regards to PR5307.

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

14 years agoAlmost missed this one... Doc update for last change.
Mike Stump [Tue, 27 Oct 2009 02:07:23 +0000 (02:07 +0000)]
Almost missed this one...  Doc update for last change.

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

14 years agoRefine noreturn handling. Fixes -Wmissing-noreturn so that it doesn't
Mike Stump [Tue, 27 Oct 2009 01:59:05 +0000 (01:59 +0000)]
Refine noreturn handling.  Fixes -Wmissing-noreturn so that it doesn't
complain that functions that have a return statement should be
declared noreturn.  Fixed PR5286.

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

14 years agoPreprocessor tests are whitespace sensitive, as per Revision: 85170 review.
Edward O'Callaghan [Tue, 27 Oct 2009 01:45:51 +0000 (01:45 +0000)]
Preprocessor tests are whitespace sensitive, as per Revision: 85170 review.

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

14 years agoUse a pred_iterator instead of a succ_iterator (wrong typedef).
Ted Kremenek [Tue, 27 Oct 2009 01:07:53 +0000 (01:07 +0000)]
Use a pred_iterator instead of a succ_iterator (wrong typedef).

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

14 years agoAdd test cases for <rdar://problem/7332673>.
Ted Kremenek [Tue, 27 Oct 2009 01:05:20 +0000 (01:05 +0000)]
Add test cases for <rdar://problem/7332673>.

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

14 years agoDocument -nobuiltininc
Rafael Espindola [Tue, 27 Oct 2009 00:29:40 +0000 (00:29 +0000)]
Document -nobuiltininc

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

14 years agoPrep for future __builtin_object_size refinements. The theory is that
Mike Stump [Mon, 26 Oct 2009 23:39:48 +0000 (23:39 +0000)]
Prep for future __builtin_object_size refinements.  The theory is that
someone will add an llvm intrinsic for us to use, so the optimizer can
figure out the hard cases.  WIP.

For those that want to help, double check with Eric before starting.
He has a bit of code this will plug into.

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

14 years ago__builtin_object_size refinements. Also handle stack based objects. WIP.
Mike Stump [Mon, 26 Oct 2009 23:05:19 +0000 (23:05 +0000)]
__builtin_object_size refinements.  Also handle stack based objects.  WIP.

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

14 years agoConvert a few tests to FileCheck for PR5307.
Edward O'Callaghan [Mon, 26 Oct 2009 22:51:02 +0000 (22:51 +0000)]
Convert a few tests to FileCheck for PR5307.

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

14 years agoUnify Unix and Windows code paths when executing 'clang'.
Ted Kremenek [Mon, 26 Oct 2009 22:14:08 +0000 (22:14 +0000)]
Unify Unix and Windows code paths when executing 'clang'.

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

14 years agoRemove unnecessary calls to 'flush()'.
Ted Kremenek [Mon, 26 Oct 2009 22:08:39 +0000 (22:08 +0000)]
Remove unnecessary calls to 'flush()'.

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

14 years agoAdd Code gen support for '->*' operator which fell
Fariborz Jahanian [Mon, 26 Oct 2009 21:58:25 +0000 (21:58 +0000)]
Add Code gen support for '->*' operator which fell
through the crack.

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

14 years ago__builtin_object_size refinements. When we run out of object, be sure
Mike Stump [Mon, 26 Oct 2009 21:38:39 +0000 (21:38 +0000)]
__builtin_object_size refinements.  When we run out of object, be sure
to clamp at 0 bytes left.  WIP.

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

14 years agoConvert a few tests to FileCheck for PR5307.
Edward O'Callaghan [Mon, 26 Oct 2009 20:49:20 +0000 (20:49 +0000)]
Convert a few tests to FileCheck for PR5307.

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

14 years agoAdd 'fixit' hint on mis-use of pointer-to-member
Fariborz Jahanian [Mon, 26 Oct 2009 20:45:27 +0000 (20:45 +0000)]
Add 'fixit' hint on mis-use of pointer-to-member
binary operators.

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

14 years agoAdd some missing header files to the Xcode project.
Steve Naroff [Mon, 26 Oct 2009 20:36:31 +0000 (20:36 +0000)]
Add some missing header files to the Xcode project.

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

14 years agoBe sure to zero-extend. And refactor.
Mike Stump [Mon, 26 Oct 2009 18:57:47 +0000 (18:57 +0000)]
Be sure to zero-extend.  And refactor.

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

14 years ago__builtin_object_size refinements. WIP.
Mike Stump [Mon, 26 Oct 2009 18:35:08 +0000 (18:35 +0000)]
__builtin_object_size refinements.  WIP.

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

14 years agoConvert some driver checks to FileCheck.
Sebastian Redl [Mon, 26 Oct 2009 18:07:30 +0000 (18:07 +0000)]
Convert some driver checks to FileCheck.

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

14 years agoclang-cc: Allow building for x86_64 with -mmacosx-version-min=10.4.
Daniel Dunbar [Mon, 26 Oct 2009 17:52:49 +0000 (17:52 +0000)]
clang-cc: Allow building for x86_64 with -mmacosx-version-min=10.4.

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

14 years agoSwitch vtable to linkeonce_odr. Patch by nlewycky.
Chandler Carruth [Mon, 26 Oct 2009 17:14:14 +0000 (17:14 +0000)]
Switch vtable to linkeonce_odr. Patch by nlewycky.

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

14 years agoAdd fixit hint to bitwise precedence warning.
Sebastian Redl [Mon, 26 Oct 2009 17:01:32 +0000 (17:01 +0000)]
Add fixit hint to bitwise precedence warning.

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

14 years agoassert -> llvm_unreachable
Douglas Gregor [Mon, 26 Oct 2009 16:27:58 +0000 (16:27 +0000)]
assert -> llvm_unreachable

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

14 years agoImplement a warning for mixing bitwise logical with comparison ops. Fixes PR5297.
Sebastian Redl [Mon, 26 Oct 2009 15:24:15 +0000 (15:24 +0000)]
Implement a warning for mixing bitwise logical with comparison ops. Fixes PR5297.

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

14 years agoRename -nostdclanginc to -nobuiltininc.
Rafael Espindola [Mon, 26 Oct 2009 13:36:57 +0000 (13:36 +0000)]
Rename -nostdclanginc to -nobuiltininc.

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

14 years ago'error' is usually used as a noreturn function. This can suppress some false
Zhongxing Xu [Mon, 26 Oct 2009 05:18:31 +0000 (05:18 +0000)]
'error' is usually used as a noreturn function. This can suppress some false
warnings. Eventually we need a way to import externally defined functions
summaries.

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

14 years agoUpdate location of DataTypes.h to reflect move in LLVM with r85086.
Chandler Carruth [Mon, 26 Oct 2009 01:37:10 +0000 (01:37 +0000)]
Update location of DataTypes.h to reflect move in LLVM with r85086.

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

14 years agoPhrase compile time assert in standard way.
Daniel Dunbar [Sun, 25 Oct 2009 23:11:15 +0000 (23:11 +0000)]
Phrase compile time assert in standard way.

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

14 years agorename getTypeSigned() -> isTypeSigned() per daniel's review.
Chris Lattner [Sun, 25 Oct 2009 22:49:18 +0000 (22:49 +0000)]
rename getTypeSigned() -> isTypeSigned() per daniel's review.

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

14 years agoFix PR5298 - -Wmissing-noreturn shouldn't warn if the function is already
Chris Lattner [Sun, 25 Oct 2009 22:43:07 +0000 (22:43 +0000)]
Fix PR5298 - -Wmissing-noreturn shouldn't warn if the function is already
declared noreturn.

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

14 years agoImplement rdar://6756623 - use of deprecated type in deprecated typedef should not...
Chris Lattner [Sun, 25 Oct 2009 22:31:57 +0000 (22:31 +0000)]
Implement rdar://6756623 - use of deprecated type in deprecated typedef should not warn

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

14 years agoMake sure we actually have a definition before asking if it is implicit. Fixes PR4674.
Sebastian Redl [Sun, 25 Oct 2009 22:31:45 +0000 (22:31 +0000)]
Make sure we actually have a definition before asking if it is implicit. Fixes PR4674.

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

14 years agoWhen parsing a top level struct declaration, make sure to
Chris Lattner [Sun, 25 Oct 2009 22:21:57 +0000 (22:21 +0000)]
When parsing a top level struct declaration, make sure to
process decl attributes instead of dropping them on the floor.
This allows us to diagnose cases like the testcase.  Also don't
diagnose deprecated stuff in ActOnTag: not all uses of tags
may be 'uses', and SemaType does this now.

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

14 years agomove calls to DiagnoseUseOfDecl (which warns about deprecated/unavailable
Chris Lattner [Sun, 25 Oct 2009 22:09:09 +0000 (22:09 +0000)]
move calls to DiagnoseUseOfDecl (which warns about deprecated/unavailable
types) out of Sema::getTypeName into ConvertDeclSpecToType.  getTypeName
is sometimes used as a predicate in the parser, so it could cause redundant
diags to be emitted.  This is also needed by two upcoming enhancements.

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

14 years agocleanups
Chris Lattner [Sun, 25 Oct 2009 22:05:13 +0000 (22:05 +0000)]
cleanups

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

14 years agoRemove the Skip parameter from GetTypeForDeclarator and dependents. Take the opportun...
Sebastian Redl [Sun, 25 Oct 2009 21:45:37 +0000 (21:45 +0000)]
Remove the Skip parameter from GetTypeForDeclarator and dependents. Take the opportunity to improve an error message and fix PR4498.

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

14 years agoremove a nonsensical todo
Chris Lattner [Sun, 25 Oct 2009 21:19:07 +0000 (21:19 +0000)]
remove a nonsensical todo

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

14 years agoTweak test, with -strict-whitespace $ won't match on Windows because the buffer
Daniel Dunbar [Sun, 25 Oct 2009 20:34:02 +0000 (20:34 +0000)]
Tweak test, with -strict-whitespace $ won't match on Windows because the buffer
will have \r\n.
 - Perhaps we should make FileCheck normalize line-endings, even in
   strict-whitespace mode?

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

14 years agomove the extwarn about using long long out of the entry of
Chris Lattner [Sun, 25 Oct 2009 18:25:04 +0000 (18:25 +0000)]
move the extwarn about using long long out of the entry of
GetTypeForDeclarator and into the code that handles long long
already.

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

14 years agosimplify interface to ConvertDeclSpecToType, check for inferred
Chris Lattner [Sun, 25 Oct 2009 18:21:37 +0000 (18:21 +0000)]
simplify interface to ConvertDeclSpecToType, check for inferred
block return types only when a TST isn't specified, not every time
through GetTypeForDeclarator.

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

14 years agochange ConvertDeclSpecToType to be a static function in SemaType.cpp
Chris Lattner [Sun, 25 Oct 2009 18:07:27 +0000 (18:07 +0000)]
change ConvertDeclSpecToType to be a static function in SemaType.cpp

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

14 years agochange Sema::ActOnFriendTypeDecl to use GetTypeForDeclarator instead
Chris Lattner [Sun, 25 Oct 2009 17:47:27 +0000 (17:47 +0000)]
change Sema::ActOnFriendTypeDecl to use GetTypeForDeclarator instead
of ConvertDeclSpecToType, which I'd like to keep private to SemaType.cpp.
We do this by cons'ing up a trivial Declarator for the type.

John, please review.

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

14 years agovarious cleanups for SemaType.cpp
Chris Lattner [Sun, 25 Oct 2009 17:36:50 +0000 (17:36 +0000)]
various cleanups for SemaType.cpp

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

14 years agominor reorg: check both attributes before decl.
Chris Lattner [Sun, 25 Oct 2009 17:21:40 +0000 (17:21 +0000)]
minor reorg: check both attributes before decl.

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

14 years agosimplify Sema::getTypeName a bit: if control gets out of the switch,
Chris Lattner [Sun, 25 Oct 2009 17:16:46 +0000 (17:16 +0000)]
simplify Sema::getTypeName a bit: if control gets out of the switch,
IIDecl cannot be null.  There is no need to check for both C++ mode and
presence of CXXRecordDecl.  ObjC interfaces can't have ScopeSpecs.

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

14 years agoIn objc mode, every identifier in a cast expression was using doing a
Chris Lattner [Sun, 25 Oct 2009 17:04:48 +0000 (17:04 +0000)]
In objc mode, every identifier in a cast expression was using doing a
type looking using getTypeName() and every property access was using
NextToken() to do lookahead to see if the identifier is followed by
a '.'.  Rearrange this code to not need lookahead and only do the
type lookup if we have "identifier." in the token stream.  Also
improve a diagnostic a bit.

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

14 years agoAudit the code for places where it is assumed that every base specifier refers to...
Sebastian Redl [Sun, 25 Oct 2009 17:03:50 +0000 (17:03 +0000)]
Audit the code for places where it is assumed that every base specifier refers to a RecordType. Add assertions or conditions as appropriate. This fixes another crash in the Apache stdlib vector.

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

14 years agoIgnore dependent bases in ADL. Fixes PR5271.
Sebastian Redl [Sun, 25 Oct 2009 09:35:33 +0000 (09:35 +0000)]
Ignore dependent bases in ADL. Fixes PR5271.

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

14 years agoAdd support for vector shifts, pretty straight forward.
Nate Begeman [Sun, 25 Oct 2009 02:26:48 +0000 (02:26 +0000)]
Add support for vector shifts, pretty straight forward.

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

14 years agoFix a bug in calculating shufflevector indices when constructing vectors from other...
Nate Begeman [Sun, 25 Oct 2009 02:26:01 +0000 (02:26 +0000)]
Fix a bug in calculating shufflevector indices when constructing vectors from other vectors.
If I can find it again, I will check in a testcase.

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

14 years agoFix cmake failure trying to get SVN info for non-SVN trees.
Daniel Dunbar [Sat, 24 Oct 2009 20:32:58 +0000 (20:32 +0000)]
Fix cmake failure trying to get SVN info for non-SVN trees.

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

14 years agoAdd a preprocessor define for adding a "near" section attribute for allowing
Sanjiv Gupta [Sat, 24 Oct 2009 18:08:20 +0000 (18:08 +0000)]
Add a preprocessor define for adding a "near" section attribute for allowing
objects to be placed at shared memory.

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

14 years agoRemove duplicated constructor declaration.
Benjamin Kramer [Sat, 24 Oct 2009 10:09:11 +0000 (10:09 +0000)]
Remove duplicated constructor declaration.

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

14 years agoSwitch alloca/sprintf to SmallString/raw_ostream.
Benjamin Kramer [Sat, 24 Oct 2009 09:57:09 +0000 (09:57 +0000)]
Switch alloca/sprintf to SmallString/raw_ostream.

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

14 years agoPreserve type source information in TypedefDecls. Preserve it across
John McCall [Sat, 24 Oct 2009 08:00:42 +0000 (08:00 +0000)]
Preserve type source information in TypedefDecls.  Preserve it across
template instantiation.  Preserve it through PCH.  Show it off to the indexer.

I'm healthily ignoring the vector type cases because we don't have a sensible
TypeLoc implementation for them anyway.

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

14 years agoFix overload resolution when calling a member template or taking the
Douglas Gregor [Sat, 24 Oct 2009 04:59:53 +0000 (04:59 +0000)]
Fix overload resolution when calling a member template or taking the
address of a member template when explicit template arguments are
provided.

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

14 years agoMake the local buffer overflow safe.
Fariborz Jahanian [Sat, 24 Oct 2009 00:16:42 +0000 (00:16 +0000)]
Make the local buffer overflow safe.

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

14 years agoFixe a buffer overflow problem which causes a crash
Fariborz Jahanian [Fri, 23 Oct 2009 23:55:43 +0000 (23:55 +0000)]
Fixe a buffer overflow problem which causes a crash
in a certain project. Need to have a permananent fix later
(FIXME added).

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

14 years agoImplement template instantiation for non-type template
Douglas Gregor [Fri, 23 Oct 2009 23:25:44 +0000 (23:25 +0000)]
Implement template instantiation for non-type template
parameters. Fixes PR5103.

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

14 years agoStore the builtin types as CanQualTypes. Expand a bit on the CanQual API,
John McCall [Fri, 23 Oct 2009 23:03:21 +0000 (23:03 +0000)]
Store the builtin types as CanQualTypes.  Expand a bit on the CanQual API,
but also remove some methods that cause ambiguities, and generally
make CanQual<blah> more analogous to QualType.

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

14 years agoMigrate Sema::ActOnCallExpr to Sema::FixOverloadedFunctionReference,
Douglas Gregor [Fri, 23 Oct 2009 22:18:25 +0000 (22:18 +0000)]
Migrate Sema::ActOnCallExpr to Sema::FixOverloadedFunctionReference,
so that we maintain better source information after template argument
deduction and overloading resolves down to a specific
declaration. Found and dealt with a few more cases that
FixOverloadedFunctionReference didn't cope with.

(Finally) added a test case that puts together this change with the
DeclRefExpr change to (optionally) include nested-name-specifiers and
explicit template argument lists.

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

14 years agoCorrect a comment.
Sebastian Redl [Fri, 23 Oct 2009 22:13:42 +0000 (22:13 +0000)]
Correct a comment.

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

14 years agoRemove OriginalTypeParmDecl; the original type is the one specified
John McCall [Fri, 23 Oct 2009 21:48:59 +0000 (21:48 +0000)]
Remove OriginalTypeParmDecl;  the original type is the one specified
in the DeclaratorInfo, if one is present.

Preserve source information through template instantiation.  This is made
more complicated by the possibility that ParmVarDecls don't have DIs, which
is possibly worth fixing in the future.

Also preserve source information for function parameters in ObjC method
declarations.

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

14 years agoAdd ASTContext::getTrivialDeclaratorInfo, which initializes a new
John McCall [Fri, 23 Oct 2009 21:14:09 +0000 (21:14 +0000)]
Add ASTContext::getTrivialDeclaratorInfo, which initializes a new
source info block with a single location.

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

14 years agoDiagnose misuse of '.*' and '->*' operators during parse
Fariborz Jahanian [Fri, 23 Oct 2009 21:01:39 +0000 (21:01 +0000)]
Diagnose misuse of '.*' and '->*' operators during parse
instead of crashing in code gen.

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

14 years agoFix operator precedence in Doug's most recent commit.
Sebastian Redl [Fri, 23 Oct 2009 19:38:17 +0000 (19:38 +0000)]
Fix operator precedence in Doug's most recent commit.

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

14 years agoApply the special enum restrictions from [over.match.oper]p3b2 in argument-dependent...
Sebastian Redl [Fri, 23 Oct 2009 19:23:15 +0000 (19:23 +0000)]
Apply the special enum restrictions from [over.match.oper]p3b2 in argument-dependent lookup too. This fixes PR5244.

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

14 years agoEliminate QualifiedDeclRefExpr, which captured the notion of a
Douglas Gregor [Fri, 23 Oct 2009 18:54:35 +0000 (18:54 +0000)]
Eliminate QualifiedDeclRefExpr, which captured the notion of a
qualified reference to a declaration that is not a non-static data
member or non-static member function, e.g.,

  namespace N { int i; }
  int j = N::i;

Instead, extend DeclRefExpr to optionally store the qualifier. Most
clients won't see or care about the difference (since
QualifierDeclRefExpr inherited DeclRefExpr). However, this reduces the
number of top-level expression types that clients need to cope with,
brings the implementation of DeclRefExpr into line with MemberExpr,
and simplifies and unifies our handling of declaration references.

Extended DeclRefExpr to (optionally) store explicitly-specified
template arguments. This occurs when naming a declaration via a
template-id (which will be stored in a TemplateIdRefExpr) that,
following template argument deduction and (possibly) overload
resolution, is replaced with a DeclRefExpr that refers to a template
specialization but maintains the template arguments as written.

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

14 years agoFixed a code gen bug (by fixing the AST) involving user-defined
Fariborz Jahanian [Fri, 23 Oct 2009 18:08:22 +0000 (18:08 +0000)]
Fixed a code gen bug (by fixing the AST) involving user-defined
pointer-to-member type conversion follwed by a pointer-to-member
standard conversion.

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

14 years agoRebuild dependently-sized ext vectors if either the element type or the size
John McCall [Fri, 23 Oct 2009 17:55:45 +0000 (17:55 +0000)]
Rebuild dependently-sized ext vectors if either the element type or the size
changed under the transform.

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

14 years agoSilence GCC 4.3 warning.
Benjamin Kramer [Fri, 23 Oct 2009 10:48:09 +0000 (10:48 +0000)]
Silence GCC 4.3 warning.

TreeTransform.h:2333: warning: suggest parentheses around && within ||

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

14 years agoEmit calls using the canonical prototype of the called function.
John McCall [Fri, 23 Oct 2009 08:22:42 +0000 (08:22 +0000)]
Emit calls using the canonical prototype of the called function.

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

14 years agoAdd comment.
Ted Kremenek [Fri, 23 Oct 2009 04:45:31 +0000 (04:45 +0000)]
Add comment.

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

14 years agoFix integer overflow in PCHReader when reading the length of an
Ted Kremenek [Fri, 23 Oct 2009 03:57:22 +0000 (03:57 +0000)]
Fix integer overflow in PCHReader when reading the length of an
identifier.  This caused a crash when reading PCH files that contained
long identifier names.

The issue is that 'StrLenPtr' was previously a 'const char *', meaning
the byte loaded from it would be interpretted as a signed integer.  If
the topmost bit was set, conversion to 'unsigned' would extend that
bit, causing an overflow.

The solution is to make 'StrLenPtr' an 'unsigned char *', always
treating the value as an unsigned integer.

This fixes: <rdar://problem/7328900>

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

14 years agoFixed undefined behavior in pushMappings when the stack has to resize.
John Thompson [Fri, 23 Oct 2009 02:21:17 +0000 (02:21 +0000)]
Fixed undefined behavior in pushMappings when the stack has to resize.

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

14 years agoAdd radar number.
Mike Stump [Fri, 23 Oct 2009 02:13:20 +0000 (02:13 +0000)]
Add radar number.

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

14 years agoFixup the return type of functions.
Mike Stump [Fri, 23 Oct 2009 01:52:13 +0000 (01:52 +0000)]
Fixup the return type of functions.

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

14 years agoFunctionTypeLocs don't necessarily provide ParmVarDecls, so don't crash if
John McCall [Fri, 23 Oct 2009 01:28:53 +0000 (01:28 +0000)]
FunctionTypeLocs don't necessarily provide ParmVarDecls, so don't crash if
one was PCH'ed without any.

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

14 years agoPreserve type source information when substituting into FieldDecls.
John McCall [Thu, 22 Oct 2009 23:33:21 +0000 (23:33 +0000)]
Preserve type source information when substituting into FieldDecls.
Just r84734 now that some fundamental work has been completed.

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

14 years agoPreserve source information for anonymous struct/union declarations.
John McCall [Thu, 22 Oct 2009 23:31:08 +0000 (23:31 +0000)]
Preserve source information for anonymous struct/union declarations.

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

14 years agoComplete code gen for '.*' binary expression for
Fariborz Jahanian [Thu, 22 Oct 2009 22:57:31 +0000 (22:57 +0000)]
Complete code gen for '.*' binary expression for
both scalar and aggregates.

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

14 years agoFixes a warning.
Fariborz Jahanian [Thu, 22 Oct 2009 22:49:47 +0000 (22:49 +0000)]
Fixes a warning.

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

14 years agoWhen building types from declarators, instead of building two types (one for
John McCall [Thu, 22 Oct 2009 22:37:11 +0000 (22:37 +0000)]
When building types from declarators, instead of building two types (one for
the DeclaratorInfo, one for semantic analysis), just build a single type whose
canonical type will reflect the semantic analysis (assuming the type is
well-formed, of course).

To make that work, make a few changes to the type system:
* allow the nominal pointee type of a reference type to be a (possibly sugared)
  reference type.  Also, preserve the original spelling of the reference type.
  Both of these can be ignored on canonical reference types.
* Remove ObjCProtocolListType and preserve the associated source information on
  the various ObjC TypeLocs.  Preserve the spelling of protocol lists except in
  the canonical form.
* Preserve some level of source type structure on parameter types, but
  canonicalize on the canonical function type.  This is still a WIP.

Drops code size, makes strides towards accurate source location representation,
slight (~1.7%) progression on Cocoa.h because of complexity drop.

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

14 years agoAlways emit error diagnostics when an error occurs within clang_createTranslationUnit...
Ted Kremenek [Thu, 22 Oct 2009 22:19:00 +0000 (22:19 +0000)]
Always emit error diagnostics when an error occurs within clang_createTranslationUnit() and clang_createTranslationUnitFromSource().  These kind of errors are ones that shouldn't be missed.

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

14 years agoDisable Microsoft extensions to fix failure on Windows.
John Thompson [Thu, 22 Oct 2009 20:34:27 +0000 (20:34 +0000)]
Disable Microsoft extensions to fix failure on Windows.

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

14 years agoCanonicality is a property of qualified types, not unqualified types.
John McCall [Thu, 22 Oct 2009 20:10:53 +0000 (20:10 +0000)]
Canonicality is a property of qualified types, not unqualified types.

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

14 years agofix #2 :)
Chris Lattner [Thu, 22 Oct 2009 19:56:49 +0000 (19:56 +0000)]
fix #2 :)

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

14 years agofix testcase, thanks Daniel.
Chris Lattner [Thu, 22 Oct 2009 19:56:26 +0000 (19:56 +0000)]
fix testcase, thanks Daniel.

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

14 years agoWhen replacing a template-id expression with a declaration reference expression after...
Douglas Gregor [Thu, 22 Oct 2009 18:02:20 +0000 (18:02 +0000)]
When replacing a template-id expression with a declaration reference expression after overloading completes, make sure to keep the qualifier. Still not ready with that test-case...

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

14 years agoSplit clang_getCursor() into clang_getCursor() and clang_getCursorWithHint().
Ted Kremenek [Thu, 22 Oct 2009 17:22:53 +0000 (17:22 +0000)]
Split clang_getCursor() into clang_getCursor() and clang_getCursorWithHint().

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

14 years agoWhen building and instantiating a template-id reference expression, such as
Douglas Gregor [Thu, 22 Oct 2009 17:20:55 +0000 (17:20 +0000)]
When building and instantiating a template-id reference expression, such as

  N::f<int>

keep track of the full nested-name-specifier. This is mainly QoI and
relatively hard to test; will try to come up with a printing-based
test once we also retain the explicit template arguments past overload
resolution.

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

14 years agoUpdate test; the driver can find a different gcc tool chain directory when
Daniel Dunbar [Thu, 22 Oct 2009 16:05:11 +0000 (16:05 +0000)]
Update test; the driver can find a different gcc tool chain directory when
simulating running on a different system.

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

14 years agoTry to instantiate templates before doing hierarchy checks in static_cast. Fixes...
Sebastian Redl [Thu, 22 Oct 2009 15:07:22 +0000 (15:07 +0000)]
Try to instantiate templates before doing hierarchy checks in static_cast. Fixes PR5261.

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

14 years agoWhen a template-id expression refers to a member function template, turn it into...
Douglas Gregor [Thu, 22 Oct 2009 07:19:14 +0000 (07:19 +0000)]
When a template-id expression refers to a member function template, turn it into an (implicit) member access expression. Fixes PR5220

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