]> granicus.if.org Git - clang/log
clang
14 years agoSuggest "const" and "volatile" code completions after a function
Douglas Gregor [Fri, 27 Aug 2010 17:35:51 +0000 (17:35 +0000)]
Suggest "const" and "volatile" code completions after a function
declarator, the very definition of "low-hanging fruit".

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

14 years agoAdd the new alignment arguments for NEON load/store intrinsics, based on the
Bob Wilson [Fri, 27 Aug 2010 17:14:29 +0000 (17:14 +0000)]
Add the new alignment arguments for NEON load/store intrinsics, based on the
types of the pointer address expressions used with those intrinsics.

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

14 years agocreateMainFileID doesn't need its IncludePos argument, since
Dan Gohman [Fri, 27 Aug 2010 15:44:11 +0000 (15:44 +0000)]
createMainFileID doesn't need its IncludePos argument, since
the main file isn't an included file, and the IncludePos is
always SourceLocation().

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

14 years agoWhen code-completing inside an Objective-C method, give a slight
Douglas Gregor [Fri, 27 Aug 2010 15:29:55 +0000 (15:29 +0000)]
When code-completing inside an Objective-C method, give a slight
priority boost to methods with the same selector.

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

14 years agoAdd a super-cool code completion for send-to-super. When we're typing
Douglas Gregor [Fri, 27 Aug 2010 15:10:57 +0000 (15:10 +0000)]
Add a super-cool code completion for send-to-super. When we're typing
a message send to "super" from a method that appears to be meant to
override a superclass method (same kind, same selector, same argument
types), provide a "super" completion that fills in the selector along
with forwarding the method's arguments (as placeholders).

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

14 years agoFix CMake dependencies, from Fernando Pelliccioni!
Douglas Gregor [Fri, 27 Aug 2010 14:18:05 +0000 (14:18 +0000)]
Fix CMake dependencies, from Fernando Pelliccioni!

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

14 years agoPropagate whether an id-expression is the immediate argument of
John McCall [Fri, 27 Aug 2010 09:08:28 +0000 (09:08 +0000)]
Propagate whether an id-expression is the immediate argument of
an '&' expression from the second caller of ActOnIdExpression.

Teach template argument deduction that an overloaded id-expression
doesn't give a valid type for deduction purposes to a non-static
member function unless the expression has the correct syntactic
form.

Teach ActOnIdExpression that it shouldn't try to create implicit
member expressions for '&function', because this isn't a
permitted form of use for member functions.

Teach CheckAddressOfOperand to diagnose these more carefully.
Some of these cases aren't reachable right now because earlier
diagnostics interrupt them.

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

14 years agoDon't recurse twice when we can recurse once
Douglas Gregor [Fri, 27 Aug 2010 00:11:28 +0000 (00:11 +0000)]
Don't recurse twice when we can recurse once

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

14 years agoOne who seeks knowledge learns something new every day.
John McCall [Thu, 26 Aug 2010 23:41:50 +0000 (23:41 +0000)]
One who seeks knowledge learns something new every day.
One who seeks the Tao unlearns something new every day.
Less and less remains until you arrive at non-action.
When you arrive at non-action,
nothing will be left undone.

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

14 years agotest case for r112238.
Devang Patel [Thu, 26 Aug 2010 22:54:33 +0000 (22:54 +0000)]
test case for r112238.

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

14 years agoFix horrible GRExprEngine bug where switch statements with no 'case:' statements...
Ted Kremenek [Thu, 26 Aug 2010 22:19:33 +0000 (22:19 +0000)]
Fix horrible GRExprEngine bug where switch statements with no 'case:' statements would cause the path to get prematurely aborted.  Fixes <rdar://problem/8360854>.

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

14 years agoRemove redundant cast<...>.
Ted Kremenek [Thu, 26 Aug 2010 22:04:01 +0000 (22:04 +0000)]
Remove redundant cast<...>.

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

14 years agoFix a typo.
Dan Gohman [Thu, 26 Aug 2010 21:27:06 +0000 (21:27 +0000)]
Fix a typo.

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

14 years agoimprove comments.
Chris Lattner [Thu, 26 Aug 2010 20:08:43 +0000 (20:08 +0000)]
improve comments.

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

14 years agoadd radar #
Chris Lattner [Thu, 26 Aug 2010 20:05:48 +0000 (20:05 +0000)]
add radar #

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

14 years agofix 2xi16 to pass as i32 instead of <2 x i16>. The former passes in
Chris Lattner [Thu, 26 Aug 2010 20:05:13 +0000 (20:05 +0000)]
fix 2xi16 to pass as i32 instead of <2 x i16>.  The former passes in
memory (as required) the later now passes in an xmm register.  This
fixes gcc.dg/compat/vector_1 on x86-32.

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

14 years agoclang.xcodeproj updated.
Fariborz Jahanian [Thu, 26 Aug 2010 19:58:26 +0000 (19:58 +0000)]
clang.xcodeproj updated.

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

14 years agovector of long and ulong are also classified as INTEGER in x86-64 abi,
Chris Lattner [Thu, 26 Aug 2010 18:13:50 +0000 (18:13 +0000)]
vector of long and ulong are also classified as INTEGER in x86-64 abi,
this fixes rdar://8358475 a failure of the gcc.dg/compat/vector_1 abi
test.

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

14 years ago1 x ulonglong needs to be classified as INTEGER, just like 1 x longlong,
Chris Lattner [Thu, 26 Aug 2010 18:03:20 +0000 (18:03 +0000)]
1 x ulonglong needs to be classified as INTEGER, just like 1 x longlong,
this fixes a miscompilation on the included testcase, rdar://8359248

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

14 years ago...I forgot to check my new test after adding it, and lo, there's slightly different
John McCall [Thu, 26 Aug 2010 17:42:30 +0000 (17:42 +0000)]
...I forgot to check my new test after adding it, and lo, there's slightly different
behavior in C than in C++ (which is what the original test case was).

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

14 years agoMake sure we clear TypeSpecOwned when setting TypeSpecType to something when
John McCall [Thu, 26 Aug 2010 17:22:34 +0000 (17:22 +0000)]
Make sure we clear TypeSpecOwned when setting TypeSpecType to something when
it might previously have been a tag TST.

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

14 years agoTweak the @selector completion to collapse multiple informative and
Douglas Gregor [Thu, 26 Aug 2010 16:46:39 +0000 (16:46 +0000)]
Tweak the @selector completion to collapse multiple informative and
typed-text blocks into one of each.

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

14 years agoWhen code-completing a potential call to a C++ non-static member
Douglas Gregor [Thu, 26 Aug 2010 16:36:48 +0000 (16:36 +0000)]
When code-completing a potential call to a C++ non-static member
function, take into account the qualifiers on the object argument
(e.g., what will become "this"), filtering around uncallable member
functions and giving a slight priority boost to those with
exactly-matching qualifiers.

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

14 years agoWork around a gcc warning.
John McCall [Thu, 26 Aug 2010 16:36:35 +0000 (16:36 +0000)]
Work around a gcc warning.

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

14 years agoFix miscompilation. The cookie was not used when new'ing arrays with multiple dimensions.
Argyrios Kyrtzidis [Thu, 26 Aug 2010 15:23:38 +0000 (15:23 +0000)]
Fix miscompilation. The cookie was not used when new'ing arrays with multiple dimensions.

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

14 years agoclang-interpreter: libFrontend depends on libSerialization. Fix linux build by changi...
Benjamin Kramer [Thu, 26 Aug 2010 15:21:38 +0000 (15:21 +0000)]
clang-interpreter: libFrontend depends on libSerialization. Fix linux build by changing the link order.

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

14 years agoImplement code completion for @selector expressions
Douglas Gregor [Thu, 26 Aug 2010 15:07:07 +0000 (15:07 +0000)]
Implement code completion for @selector expressions

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

14 years agoMore ordering tweaks in this silly, silly test
Douglas Gregor [Thu, 26 Aug 2010 14:20:32 +0000 (14:20 +0000)]
More ordering tweaks in this silly, silly test

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

14 years agomark boost's tracking bug as fixed
Gabor Greif [Thu, 26 Aug 2010 14:20:18 +0000 (14:20 +0000)]
mark boost's tracking bug as fixed

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

14 years agoTweak wording in an assertion, from dawn@burble.org.
Douglas Gregor [Thu, 26 Aug 2010 14:07:34 +0000 (14:07 +0000)]
Tweak wording in an assertion, from dawn@burble.org.

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

14 years agoUpdate clang-interpreter for recent DiagnosticClient ownership changes.
Benjamin Kramer [Thu, 26 Aug 2010 13:48:56 +0000 (13:48 +0000)]
Update clang-interpreter for recent DiagnosticClient ownership changes.

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

14 years agoMove the sorting of code-completion results out of the main path and
Douglas Gregor [Thu, 26 Aug 2010 13:48:20 +0000 (13:48 +0000)]
Move the sorting of code-completion results out of the main path and
into the clients, e.g., the printing code-completion consumer and
c-index-test. Clients may want to re-sort the results anyway.

Provide a libclang function that sorts the results.

3rd try. How embarrassing.

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

14 years agoMissed a couple.
John McCall [Thu, 26 Aug 2010 10:20:09 +0000 (10:20 +0000)]
Missed a couple.

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

14 years agoApparently gcc doesn't always get injected class names right.
John McCall [Thu, 26 Aug 2010 09:52:08 +0000 (09:52 +0000)]
Apparently gcc doesn't always get injected class names right.

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

14 years agoMove things around so that Sema.h no longer depends on even DeclBase.h.
John McCall [Thu, 26 Aug 2010 09:15:37 +0000 (09:15 +0000)]
Move things around so that Sema.h no longer depends on even DeclBase.h.
It still depends on Type because DeclarationName.h does.

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

14 years agotame an assertion, fixing rdar://8357396
Chris Lattner [Thu, 26 Aug 2010 06:28:35 +0000 (06:28 +0000)]
tame an assertion, fixing rdar://8357396

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

14 years agoCGValue: Increase width of allowed alignment. We could switch to log2, but we
Daniel Dunbar [Thu, 26 Aug 2010 06:02:12 +0000 (06:02 +0000)]
CGValue: Increase width of allowed alignment. We could switch to log2, but we
don't currently need the bits anyway.

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

14 years agoRevert r112149, "Move the sorting of code-completion results out of the main
Daniel Dunbar [Thu, 26 Aug 2010 03:53:50 +0000 (03:53 +0000)]
Revert r112149, "Move the sorting of code-completion results out of the main
path and ...", it is failing tests.

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

14 years agoRevert r112154, "Fix thinko in sorting operation", it depends on r112149 which
Daniel Dunbar [Thu, 26 Aug 2010 03:53:44 +0000 (03:53 +0000)]
Revert r112154, "Fix thinko in sorting operation", it depends on r112149 which
doth lay upon the chopping block.

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

14 years agoTweak test to avoid checking for a specific ordering where none exists
Douglas Gregor [Thu, 26 Aug 2010 03:52:21 +0000 (03:52 +0000)]
Tweak test to avoid checking for a specific ordering where none exists

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

14 years agoDe-memberify the VarDecl and FunctionDecl StorageClass enums.
John McCall [Thu, 26 Aug 2010 03:08:43 +0000 (03:08 +0000)]
De-memberify the VarDecl and FunctionDecl StorageClass enums.
This lets us remove Sema.h's dependency on Expr.h and Decl.h.

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

14 years agoFix thinko in sorting operation
Douglas Gregor [Thu, 26 Aug 2010 02:54:05 +0000 (02:54 +0000)]
Fix thinko in sorting operation

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

14 years agoFix a typo.
Dan Gohman [Thu, 26 Aug 2010 02:27:03 +0000 (02:27 +0000)]
Fix a typo.

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

14 years agoMove the sorting of code-completion results out of the main path and
Douglas Gregor [Thu, 26 Aug 2010 02:23:45 +0000 (02:23 +0000)]
Move the sorting of code-completion results out of the main path and
into the clients, e.g., the printing code-completion consumer and
c-index-test. Clients may want to re-sort the results anyway.

Provide a libclang function that sorts the results.

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

14 years agoRestore r112114 now that SmallVector<...,0> is safe.
John McCall [Thu, 26 Aug 2010 02:13:20 +0000 (02:13 +0000)]
Restore r112114 now that SmallVector<...,0> is safe.

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

14 years agoMove some type defines from smmintrin.h to emmintrin.h to match where
Eric Christopher [Thu, 26 Aug 2010 02:09:25 +0000 (02:09 +0000)]
Move some type defines from smmintrin.h to emmintrin.h to match where
gcc defines them.

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

14 years agoAdd libclang API hook "clang_getIBOutletCollectionType" to query the collection type...
Ted Kremenek [Thu, 26 Aug 2010 01:42:22 +0000 (01:42 +0000)]
Add libclang API hook "clang_getIBOutletCollectionType" to query the collection type for iboutletcollection attributes.

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

14 years agoDriver/Darwin: Switch back to old toolchain, looks like new one isn't quite
Daniel Dunbar [Thu, 26 Aug 2010 01:41:44 +0000 (01:41 +0000)]
Driver/Darwin: Switch back to old toolchain, looks like new one isn't quite
ready yet.

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

14 years agozap dead ctor
Chris Lattner [Thu, 26 Aug 2010 01:17:33 +0000 (01:17 +0000)]
zap dead ctor

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

14 years agoIRgen/NEON: Fix codegen of vzip and vzipq.
Daniel Dunbar [Thu, 26 Aug 2010 00:55:57 +0000 (00:55 +0000)]
IRgen/NEON: Fix codegen of vzip and vzipq.
 - Will be adding an executable test case to test-suite repo.

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

14 years agoDriver: Fix thinko where I switched to always using the old toolchain, instead
Daniel Dunbar [Thu, 26 Aug 2010 00:55:55 +0000 (00:55 +0000)]
Driver: Fix thinko where I switched to always using the old toolchain, instead
of always using the new toolchain.

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

14 years agoDriver/Darwin: Pass the right arch specific dir for ARM, when linking.
Daniel Dunbar [Thu, 26 Aug 2010 00:55:52 +0000 (00:55 +0000)]
Driver/Darwin: Pass the right arch specific dir for ARM, when linking.

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

14 years agoRevert r112114, "Pull DelayedDiagnostic and AccessedEntity out into their own
Daniel Dunbar [Thu, 26 Aug 2010 00:52:50 +0000 (00:52 +0000)]
Revert r112114, "Pull DelayedDiagnostic and AccessedEntity out into their own
header.", it is teh broken.

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

14 years agoWith lax vector conversions (the default) make sure we convert between two
Eric Christopher [Thu, 26 Aug 2010 00:42:16 +0000 (00:42 +0000)]
With lax vector conversions (the default) make sure we convert between two
vectors that are the same size. Fix up testcases accordingly and add a new one
to make sure we still error if lax vector conversions are disabled.

Fixes rdar://8328190

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

14 years agoRevert "Move the sorting of code-completion results out of the main path and
Douglas Gregor [Thu, 26 Aug 2010 00:30:24 +0000 (00:30 +0000)]
Revert "Move the sorting of code-completion results out of the main path and
into the clients", because the C standard library sucks. Where's my
stable sort, huh?

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

14 years agoAdd DelayedDiagnostic.h to xcode project file.
Fariborz Jahanian [Thu, 26 Aug 2010 00:17:38 +0000 (00:17 +0000)]
Add DelayedDiagnostic.h to xcode project file.

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

14 years agoMore update of clang.xcodeproj for recent changes.
Fariborz Jahanian [Thu, 26 Aug 2010 00:13:24 +0000 (00:13 +0000)]
More update of clang.xcodeproj for recent changes.

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

14 years agoUpdate clang.xcodeproj for recent refactorings.
Fariborz Jahanian [Thu, 26 Aug 2010 00:06:40 +0000 (00:06 +0000)]
Update clang.xcodeproj for recent refactorings.

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

14 years agoFix typo in error message and testcase.
Eric Christopher [Wed, 25 Aug 2010 23:45:44 +0000 (23:45 +0000)]
Fix typo in error message and testcase.

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

14 years agoPull DelayedDiagnostic and AccessedEntity out into their own header.
John McCall [Wed, 25 Aug 2010 23:44:00 +0000 (23:44 +0000)]
Pull DelayedDiagnostic and AccessedEntity out into their own header.
This works courtesy of the new SmallVector<..., 0> specialization that
doesn't require a complete type.  Note that you'll need to pull at least
SmallVector.h from LLVM to compile successfully.

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

14 years agoRevert r112043, static volatiles are removed by the optimizer. Thanks Chris!
Argyrios Kyrtzidis [Wed, 25 Aug 2010 23:42:51 +0000 (23:42 +0000)]
Revert r112043, static volatiles are removed by the optimizer. Thanks Chris!

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

14 years agoFinally pass "two floats in a 64-bit unit" as a <2 x float> instead of
Chris Lattner [Wed, 25 Aug 2010 23:39:14 +0000 (23:39 +0000)]
Finally pass "two floats in a 64-bit unit" as a <2 x float> instead of
as a double in the x86-64 ABI.  This allows us to generate much better
code for certain things, e.g.:

_Complex float f32(_Complex float A, _Complex float B) {
  return A+B;
}

Used to compile into (look at the integer silliness!):

_f32:                                   ## @f32
## BB#0:                                ## %entry
movd %xmm1, %rax
movd %eax, %xmm1
movd %xmm0, %rcx
movd %ecx, %xmm0
addss %xmm1, %xmm0
movd %xmm0, %edx
shrq $32, %rax
movd %eax, %xmm0
shrq $32, %rcx
movd %ecx, %xmm1
addss %xmm0, %xmm1
movd %xmm1, %eax
shlq $32, %rax
addq %rdx, %rax
movd %rax, %xmm0
ret

Now we get:

_f32:                                   ## @f32
movdqa %xmm0, %xmm2
addss %xmm1, %xmm2
pshufd $16, %xmm2, %xmm2
pshufd $1, %xmm1, %xmm1
pshufd $1, %xmm0, %xmm0
addss %xmm1, %xmm0
pshufd $16, %xmm0, %xmm1
movdqa %xmm2, %xmm0
unpcklps %xmm1, %xmm0
ret

and compile stuff like:

extern float _Complex ccoshf( float _Complex ) ;
float _Complex ccosf ( float _Complex z ) {
 float _Complex iz;
 (__real__ iz) = -(__imag__ z);
 (__imag__ iz) = (__real__ z);
 return ccoshf(iz);
}

into:

_ccosf:                                 ## @ccosf
## BB#0:                                ## %entry
pshufd $1, %xmm0, %xmm1
xorps LCPI4_0(%rip), %xmm1
unpcklps %xmm0, %xmm1
movaps %xmm1, %xmm0
jmp _ccoshf                 ## TAILCALL

instead of:

_ccosf:                                 ## @ccosf
## BB#0:                                ## %entry
movd %xmm0, %rax
movq %rax, %rcx
shlq $32, %rcx
shrq $32, %rax
xorl $-2147483648, %eax      ## imm = 0xFFFFFFFF80000000
addq %rcx, %rax
movd %rax, %xmm0
jmp _ccoshf                 ## TAILCALL

There is still "stuff to be done" here for the struct case,
but this resolves rdar://6379669 - [x86-64 ABI] Pass and return
_Complex float / double efficiently

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

14 years agoFix miscompilation. The custom new[]/delete[] methods were not getting called for...
Argyrios Kyrtzidis [Wed, 25 Aug 2010 23:14:56 +0000 (23:14 +0000)]
Fix miscompilation. The custom new[]/delete[] methods were not getting called for arrays with more than 1 dimension.

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

14 years agoAdd missing null checks in PseudoConstantAnalysis
Tom Care [Wed, 25 Aug 2010 22:46:03 +0000 (22:46 +0000)]
Add missing null checks in PseudoConstantAnalysis

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

14 years agoImproved the handling of blocks and block variables in PseudoConstantAnalysis
Tom Care [Wed, 25 Aug 2010 22:37:26 +0000 (22:37 +0000)]
Improved the handling of blocks and block variables in PseudoConstantAnalysis
- Removed the assumption that __block vars are all non-constant
- Simplified some repetitive code in RunAnalysis
- Added block walking support
- Code/comments cleanup
- Separated out test for block pseudoconstants

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

14 years agoFix RUN line in test.
Ted Kremenek [Wed, 25 Aug 2010 22:16:06 +0000 (22:16 +0000)]
Fix RUN line in test.

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

14 years agoWhen annotating tokens, don't fallback to annotating with a null cursor for cursors...
Ted Kremenek [Wed, 25 Aug 2010 22:16:02 +0000 (22:16 +0000)]
When annotating tokens, don't fallback to annotating with a null cursor for cursors that come before a macro instantiation.  Fixes <rdar://problem/7974151>.

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

14 years agoMove the sorting of code-completion results out of the main path and
Douglas Gregor [Wed, 25 Aug 2010 22:15:42 +0000 (22:15 +0000)]
Move the sorting of code-completion results out of the main path and
into the clients, e.g., the printing code-completion consumer and
c-index-test. Clients may want to re-sort the results anyway.

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

14 years agoSplit out a header to hold APIs meant for the Sema implementation from Sema.h.
John McCall [Wed, 25 Aug 2010 22:03:47 +0000 (22:03 +0000)]
Split out a header to hold APIs meant for the Sema implementation from Sema.h.
Clients of Sema don't need to know (for example) the list of diagnostics we
support.

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

14 years agoFix a typo.
Dan Gohman [Wed, 25 Aug 2010 21:59:25 +0000 (21:59 +0000)]
Fix a typo.

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

14 years agoWhen combining the code-completion results from Sema long with the
Douglas Gregor [Wed, 25 Aug 2010 18:41:16 +0000 (18:41 +0000)]
When combining the code-completion results from Sema long with the
code-completion results cached by ASTUnit, sort the resulting result
set. This makes testing far, far easier, so this commit also includes
tests for the previous few fixes.

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

14 years agoFix horrible white space errors.
Michael J. Spencer [Wed, 25 Aug 2010 18:17:27 +0000 (18:17 +0000)]
Fix horrible white space errors.

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

14 years agoInitialize the translation-unit scope before lexing the first
Douglas Gregor [Wed, 25 Aug 2010 18:07:12 +0000 (18:07 +0000)]
Initialize the translation-unit scope before lexing the first
token. The first token might be something that ends up triggering code
completion, which in turn requires a valid Scope. Test case forthcoming.

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

14 years agoAdd a missing case
Douglas Gregor [Wed, 25 Aug 2010 18:04:30 +0000 (18:04 +0000)]
Add a missing case

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

14 years agoFix an off-by-one error when computing the precompiled preamble for
Douglas Gregor [Wed, 25 Aug 2010 18:04:15 +0000 (18:04 +0000)]
Fix an off-by-one error when computing the precompiled preamble for
code completion. We were allowing the preamble to include the line
that we're code-completing on. Again, testcase is forthcoming.

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

14 years agoMake the cursor kind of macro-name-only completions produced by
Douglas Gregor [Wed, 25 Aug 2010 18:03:13 +0000 (18:03 +0000)]
Make the cursor kind of macro-name-only completions produced by
ASTUnit match those produced directly by code completion. Test case is
forthcoming.

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

14 years agoRobustify test.
Devang Patel [Wed, 25 Aug 2010 17:32:22 +0000 (17:32 +0000)]
Robustify test.

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

14 years agoTest for previous commit
Douglas Gregor [Wed, 25 Aug 2010 17:11:34 +0000 (17:11 +0000)]
Test for previous commit

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

14 years agoAdd a code-completion context for "natural language" completions, so
Douglas Gregor [Wed, 25 Aug 2010 17:10:00 +0000 (17:10 +0000)]
Add a code-completion context for "natural language" completions, so
that ASTUnit knows not to try to provide completions there.

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

14 years agoIntroduce a preprocessor code-completion hook for contexts where we
Douglas Gregor [Wed, 25 Aug 2010 17:04:25 +0000 (17:04 +0000)]
Introduce a preprocessor code-completion hook for contexts where we
expect "natural" language and should not provide any completions,
e.g., comments, string literals, #error.

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

14 years agoImplement __builtin_printf, __builtin_fprintf. Fixes <rdar://problem/8336581>.
Douglas Gregor [Wed, 25 Aug 2010 15:47:31 +0000 (15:47 +0000)]
Implement __builtin_printf, __builtin_fprintf. Fixes <rdar://problem/8336581>.

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

14 years agoSilence a GCC warning saying that unsigned >= UO_PostInc is always true.
Benjamin Kramer [Wed, 25 Aug 2010 13:24:04 +0000 (13:24 +0000)]
Silence a GCC warning saying that unsigned >= UO_PostInc is always true.

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

14 years agoGCC didn't care for my attempt at API compatibility, so brute-force everything
John McCall [Wed, 25 Aug 2010 11:45:40 +0000 (11:45 +0000)]
GCC didn't care for my attempt at API compatibility, so brute-force everything
to the new constants.

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

14 years agoRandom space optimization.
John McCall [Wed, 25 Aug 2010 10:44:55 +0000 (10:44 +0000)]
Random space optimization.

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

14 years agoRecursive functions should be marked when used from another function. Fixes http...
Argyrios Kyrtzidis [Wed, 25 Aug 2010 10:34:54 +0000 (10:34 +0000)]
Recursive functions should be marked when used from another function. Fixes http://llvm.org/PR7923.

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

14 years agoMore incremental progress towards not including Expr.h in Sema.h.
John McCall [Wed, 25 Aug 2010 10:28:54 +0000 (10:28 +0000)]
More incremental progress towards not including Expr.h in Sema.h.

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

14 years agoMake sure volatile variables are emitted even if static. Fixes rdar://8315219
Argyrios Kyrtzidis [Wed, 25 Aug 2010 10:15:24 +0000 (10:15 +0000)]
Make sure volatile variables are emitted even if static. Fixes rdar://8315219

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

14 years agoRename *PendingImplicitInstantiations to *PendingInstantiations. No
Chandler Carruth [Wed, 25 Aug 2010 08:44:16 +0000 (08:44 +0000)]
Rename *PendingImplicitInstantiations to *PendingInstantiations. No
functionality changed.

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

14 years agoSplit FunctionScopeInfo and BlockScopeInfo into their own header.
John McCall [Wed, 25 Aug 2010 08:40:02 +0000 (08:40 +0000)]
Split FunctionScopeInfo and BlockScopeInfo into their own header.

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

14 years agoSupport explicit instantiation of function templates and members of class
Chandler Carruth [Wed, 25 Aug 2010 08:27:02 +0000 (08:27 +0000)]
Support explicit instantiation of function templates and members of class
templates when only the declaration is in scope. This requires deferring the
instantiation to be lazy, and ensuring the definition is required for that
translation unit. We re-use the existing pending instantiation queue,
previously only used to track implicit instantiations which were required to be
lazy. Fixes PR7979.

A subsequent change will rename *PendingImplicitInstantiations to
*PendingInstatiations for clarity given its broader role.

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

14 years agoRemove Sema.h's dependency on DeclCXX.h.
John McCall [Wed, 25 Aug 2010 07:42:41 +0000 (07:42 +0000)]
Remove Sema.h's dependency on DeclCXX.h.

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

14 years agoRemove the DenseSet dependency from Sema.h.
John McCall [Wed, 25 Aug 2010 07:03:20 +0000 (07:03 +0000)]
Remove the DenseSet dependency from Sema.h.

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

14 years agoTeach Sema to live without CodeCompleteConsumer.h.
John McCall [Wed, 25 Aug 2010 06:19:51 +0000 (06:19 +0000)]
Teach Sema to live without CodeCompleteConsumer.h.

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

14 years agoRemove AnalysisBasedWarnings.h's dependency on Type.h
John McCall [Wed, 25 Aug 2010 05:56:39 +0000 (05:56 +0000)]
Remove AnalysisBasedWarnings.h's dependency on Type.h

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

14 years agoMove more stuff out of Sema.h.
John McCall [Wed, 25 Aug 2010 05:32:35 +0000 (05:32 +0000)]
Move more stuff out of Sema.h.

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

14 years agoSort the forward declarations.
John McCall [Wed, 25 Aug 2010 04:28:15 +0000 (04:28 +0000)]
Sort the forward declarations.

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

14 years agotests: Disable this test for now, it is overly pessimistic and I am not sure how...
Daniel Dunbar [Wed, 25 Aug 2010 03:40:27 +0000 (03:40 +0000)]
tests: Disable this test for now, it is overly pessimistic and I am not sure how to fix it.

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

14 years agoIRgen: Fix a horrible bug in pointer to bool conversion, which we were treating
Daniel Dunbar [Wed, 25 Aug 2010 03:32:38 +0000 (03:32 +0000)]
IRgen: Fix a horrible bug in pointer to bool conversion, which we were treating
as a truncation not a comparison to null.

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

14 years agoExpression statements undergo lvalue-to-rvalue conversion in C,
John McCall [Wed, 25 Aug 2010 02:50:31 +0000 (02:50 +0000)]
Expression statements undergo lvalue-to-rvalue conversion in C,
but not in C++, so don't emit aggregate loads of volatile references
in null context in C++.  Happens to have been caught by an assertion.
We do not get the scalar case right.  Volatiles are really broken.

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

14 years agoReformatting.
John McCall [Wed, 25 Aug 2010 02:45:51 +0000 (02:45 +0000)]
Reformatting.

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