]> granicus.if.org Git - clang/log
clang
14 years agoFix two typos.
Benjamin Kramer [Fri, 11 Dec 2009 20:53:46 +0000 (20:53 +0000)]
Fix two typos.

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

14 years agoReorganize testcase.
John McCall [Fri, 11 Dec 2009 20:51:23 +0000 (20:51 +0000)]
Reorganize testcase.

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

14 years agoFix linkage of type info and vtable for classes without linkage.
Eli Friedman [Fri, 11 Dec 2009 20:48:18 +0000 (20:48 +0000)]
Fix linkage of type info and vtable for classes without linkage.

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

14 years agoMake sure mangling doesn't crash in another case. Add some more tests.
Eli Friedman [Fri, 11 Dec 2009 20:21:38 +0000 (20:21 +0000)]
Make sure mangling doesn't crash in another case.  Add some more tests.

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

14 years agoDon't enter a new scope for a namespace-qualified declarator unless we're
John McCall [Fri, 11 Dec 2009 20:04:54 +0000 (20:04 +0000)]
Don't enter a new scope for a namespace-qualified declarator unless we're
in a file context.  In well-formed code, only happens with friend functions.
Fixes PR 5760.

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

14 years agoWhen code completion of an overload set fails, produce results for ordinary name...
Douglas Gregor [Fri, 11 Dec 2009 19:06:04 +0000 (19:06 +0000)]
When code completion of an overload set fails, produce results for ordinary name lookup instead.

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

14 years agoAdd a function's cv-qualifiers to the code-completion results as an
Douglas Gregor [Fri, 11 Dec 2009 18:44:16 +0000 (18:44 +0000)]
Add a function's cv-qualifiers to the code-completion results as an
informative chunk.

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

14 years agoTeach code completion to instantiate templates when it needs to
Douglas Gregor [Fri, 11 Dec 2009 18:28:39 +0000 (18:28 +0000)]
Teach code completion to instantiate templates when it needs to

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

14 years agoMember function templates can occur after . or ->
Douglas Gregor [Fri, 11 Dec 2009 18:14:22 +0000 (18:14 +0000)]
Member function templates can occur after . or ->

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

14 years agoFix for PR5706: let mangleName deal with mangling names without identifiers
Eli Friedman [Fri, 11 Dec 2009 18:00:57 +0000 (18:00 +0000)]
Fix for PR5706: let mangleName deal with mangling names without identifiers
correctly.

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

14 years agoTweak code-completion results by suppressing class template
Douglas Gregor [Fri, 11 Dec 2009 17:31:05 +0000 (17:31 +0000)]
Tweak code-completion results by suppressing class template
specializations and class template partial specializations (they're
never named directly). Also, member access expressions only refer to
value declarations (fields, functions, enumerators, etc.) and
Objective-C property declarations; filter out everything else.

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

14 years agoXFAIL this for now, fixing linkage bugs causes the order of globals to change. Will...
Anders Carlsson [Fri, 11 Dec 2009 17:01:29 +0000 (17:01 +0000)]
XFAIL this for now, fixing linkage bugs causes the order of globals to change. Will fix later today.

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

14 years agoMove info vectors and add assertions in preparation of moving the vector directly...
Anders Carlsson [Fri, 11 Dec 2009 16:41:51 +0000 (16:41 +0000)]
Move info vectors and add assertions in preparation of moving the vector directly into RTTIBuilder.

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

14 years agoUse GetAddrOfRTTI when getting the RTTI pointer for a base class.
Anders Carlsson [Fri, 11 Dec 2009 16:37:06 +0000 (16:37 +0000)]
Use GetAddrOfRTTI when getting the RTTI pointer for a base class.

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

14 years agoClass template (partial) specializations should not show up in code completion results
Douglas Gregor [Fri, 11 Dec 2009 16:18:54 +0000 (16:18 +0000)]
Class template (partial) specializations should not show up in code completion results

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

14 years agoRandom string-related cleanups.
Benjamin Kramer [Fri, 11 Dec 2009 13:33:18 +0000 (13:33 +0000)]
Random string-related cleanups.

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

14 years agoUse StringRef.getAsInteger instead of temporary string + strtol. No intended function...
Benjamin Kramer [Fri, 11 Dec 2009 13:26:32 +0000 (13:26 +0000)]
Use StringRef.getAsInteger instead of temporary string + strtol. No intended functionality change.

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

14 years agoMove the code for converting a member pointer to a bool so that it is usable
Eli Friedman [Fri, 11 Dec 2009 09:26:29 +0000 (09:26 +0000)]
Move the code for converting a member pointer to a bool so that it is usable
for logical not.

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

14 years agoFix for PR5718: implement equality comparisons for member function pointers.
Eli Friedman [Fri, 11 Dec 2009 07:36:43 +0000 (07:36 +0000)]
Fix for PR5718: implement equality comparisons for member function pointers.

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

14 years agoEnhance understanding of VarRegions referenced by a block whose declarations are...
Ted Kremenek [Fri, 11 Dec 2009 06:43:27 +0000 (06:43 +0000)]
Enhance understanding of VarRegions referenced by a block whose declarations are outside the current stack frame.  Fixes <rdar://problem/7462324>.

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

14 years agoCompletely evaluate malloc/free in MallocChecker.cpp.
Zhongxing Xu [Fri, 11 Dec 2009 03:09:01 +0000 (03:09 +0000)]
Completely evaluate malloc/free in MallocChecker.cpp.

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

14 years agoTest member template using hiding.
John McCall [Fri, 11 Dec 2009 02:55:56 +0000 (02:55 +0000)]
Test member template using hiding.

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

14 years agoImprove linkage of RTTI data structures. Introduce CodeGenModule::GetAddrOfRTTI which...
Anders Carlsson [Fri, 11 Dec 2009 02:46:30 +0000 (02:46 +0000)]
Improve linkage of RTTI data structures. Introduce CodeGenModule::GetAddrOfRTTI which figures out the right linkage of the RTTI information for the given type and whether it should be defined or not. I will migrate clients over to GetAddrOfRTTI in subsequent commits (with tests).

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

14 years agoFix a recent regression from the initialization changes.
Eli Friedman [Fri, 11 Dec 2009 02:42:07 +0000 (02:42 +0000)]
Fix a recent regression from the initialization changes.

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

14 years agoCheck if the target of a using decl is already declared in this scope before
John McCall [Fri, 11 Dec 2009 02:33:26 +0000 (02:33 +0000)]
Check if the target of a using decl is already declared in this scope before
doing any of the other redeclaration checks.  We were missing a few cases.
Fixes PR 5752.

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

14 years agoImplement access declarations. Most of the work here is parsing them, which
John McCall [Fri, 11 Dec 2009 02:10:03 +0000 (02:10 +0000)]
Implement access declarations.  Most of the work here is parsing them, which
is difficult because they're so terribly, terribly ambiguous.

We implement access declarations in terms of using declarations, which is
quite reasonable.  However, we should really persist the access/using
distinction in the AST and use the appropriate name in diagnostics.  This
isn't a priority, so I'll just file a PR and hope someone else does it. :)

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

14 years agoGive the "cannot pass object of non-POD type 'class C' through variadic constructor...
Chris Lattner [Fri, 11 Dec 2009 01:52:50 +0000 (01:52 +0000)]
Give the "cannot pass object of non-POD type 'class C' through variadic constructor; call will abort at runtime" warning a -W flag (non-pod-varargs) and default it being an error by default.  There is no good reason to allow users to get bitten by this sort of thing by default.

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

14 years agoFix the handling of dependent enums per C++ DR 502.
Eli Friedman [Fri, 11 Dec 2009 01:34:50 +0000 (01:34 +0000)]
Fix the handling of dependent enums per C++ DR 502.

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

14 years agoUse named flags in RTTIBuilder::BuildPointerType.
Anders Carlsson [Fri, 11 Dec 2009 01:27:37 +0000 (01:27 +0000)]
Use named flags in RTTIBuilder::BuildPointerType.

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

14 years agoWhen extending the lifetime of a temporary, make sure to emit a branch to the cleanup...
Anders Carlsson [Fri, 11 Dec 2009 01:00:09 +0000 (01:00 +0000)]
When extending the lifetime of a temporary, make sure to emit a branch to the cleanup exit block. This fixes a broken module error in LLVMCConfigurationEmitter.cpp.

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

14 years agoUse 'class' instead of 'struct'.
Zhongxing Xu [Fri, 11 Dec 2009 00:55:44 +0000 (00:55 +0000)]
Use 'class' instead of 'struct'.

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

14 years agoWhen an exception needs to be freed by calling __cxa_exception_free, make sure to...
Anders Carlsson [Fri, 11 Dec 2009 00:32:37 +0000 (00:32 +0000)]
When an exception needs to be freed by calling __cxa_exception_free, make sure to stash away the exception pointer somewhere.

This fixes an "Instruction does not dominate all uses!" verification error when compiling TableGen.

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

14 years agoRemove this test for now, it is flaky.
Daniel Dunbar [Fri, 11 Dec 2009 00:27:30 +0000 (00:27 +0000)]
Remove this test for now, it is flaky.

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

14 years agoFileManager: Do not cache failed stats, it is easy to construct common
Daniel Dunbar [Fri, 11 Dec 2009 00:27:20 +0000 (00:27 +0000)]
FileManager: Do not cache failed stats, it is easy to construct common
inconsistent situations if we do, and they are not important for PCH performance
(which currently only needs the stats to construct the initial FileManager
entries).
 - No test case, sorry, the machinations are too involved.

This occurs when, for example, the build makes a PCH file and has a header map
or a -I for a directory that does not yet exist. It is possible we will cache
the negative stat on that directory, and then in the build we will never find
header files inside that dir.

For PCH we don't need these stats anyway for performance, so this also makes PCH
files smaller w/ no loss. I hope to eventually eliminate the stat cache
entirely.

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

14 years agoPatch to fix a crash trying to access a category name in
Fariborz Jahanian [Fri, 11 Dec 2009 00:26:36 +0000 (00:26 +0000)]
Patch to fix a crash trying to access a category name in
objective-c++ mode and also removed dead-code in this area.
(fixes radar 7456710).

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

14 years agoTestcase for recent checkin.
Mike Stump [Fri, 11 Dec 2009 00:10:15 +0000 (00:10 +0000)]
Testcase for recent checkin.

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

14 years agoImplement just a bit more of inline assembly.
Mike Stump [Fri, 11 Dec 2009 00:04:56 +0000 (00:04 +0000)]
Implement just a bit more of inline assembly.

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

14 years agoFix spacing.
Mike Stump [Fri, 11 Dec 2009 00:02:10 +0000 (00:02 +0000)]
Fix spacing.

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

14 years agoDon't complain about falling off the end of a function with an asm
Mike Stump [Thu, 10 Dec 2009 22:57:48 +0000 (22:57 +0000)]
Don't complain about falling off the end of a function with an asm
block, if the function is supposed to return a value as we don't know
exactly what the asm code does.

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

14 years agoclang_getCompletionChunkText() will treat optional strings as empty text blocks
Douglas Gregor [Thu, 10 Dec 2009 22:46:19 +0000 (22:46 +0000)]
clang_getCompletionChunkText() will treat optional strings as empty text blocks

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

14 years agoSupport unary type traits in a scalar context. Not that I've actually seen
Eli Friedman [Thu, 10 Dec 2009 22:40:32 +0000 (22:40 +0000)]
Support unary type traits in a scalar context.  Not that I've actually seen
this construct, but might as well for completeness.

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

14 years agoClean up enum constants so that they're finally sane. Fixes PR3173 and a
Eli Friedman [Thu, 10 Dec 2009 22:29:29 +0000 (22:29 +0000)]
Clean up enum constants so that they're finally sane.  Fixes PR3173 and a
recently introduced crash.

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

14 years agoMake sure that explicitly instantiated functions get the right linkage.
Anders Carlsson [Thu, 10 Dec 2009 22:25:34 +0000 (22:25 +0000)]
Make sure that explicitly instantiated functions get the right linkage.

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

14 years agoBeef up Clang-on-LLVM testing a bit, by making LLVM-Syntax recursive
Douglas Gregor [Thu, 10 Dec 2009 22:08:55 +0000 (22:08 +0000)]
Beef up Clang-on-LLVM testing a bit, by making LLVM-Syntax recursive
(since we now parse all of the headers appropriately) and teaching
LLVM-Code-Syntax about the extra paths needed to parse the backends.

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

14 years agoPrivatize class members.
Benjamin Kramer [Thu, 10 Dec 2009 21:50:21 +0000 (21:50 +0000)]
Privatize class members.

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

14 years agoActually try to trigger the last diagnostic in the declaration-collision test case.
John McCall [Thu, 10 Dec 2009 21:17:25 +0000 (21:17 +0000)]
Actually try to trigger the last diagnostic in the declaration-collision test case.
Surprisingly, we *do* diagnose one of them.  Since we don't really track scopes into
instantiation, this has to signal some kind of bug.

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

14 years agoNo need to add -x objecitve-c++
Fariborz Jahanian [Thu, 10 Dec 2009 20:57:43 +0000 (20:57 +0000)]
No need to add -x objecitve-c++

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

14 years agoAdd support for finding composite type of twp objective-c pointers
Fariborz Jahanian [Thu, 10 Dec 2009 20:46:08 +0000 (20:46 +0000)]
Add support for finding composite type of twp objective-c pointers
in objective-c++ mode.

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

14 years agoImprove the diagnostic when a new declaration conflicts with a using shadow
John McCall [Thu, 10 Dec 2009 19:51:03 +0000 (19:51 +0000)]
Improve the diagnostic when a new declaration conflicts with a using shadow
declaration.  Rename note_using_decl to note_using, which is possibly less confusing.
Add a test for non-class-scope using decl collisions and be sure to note the case
we can't diagnose yet.

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

14 years agoMove composite type finding of two objective-c expressions
Fariborz Jahanian [Thu, 10 Dec 2009 19:47:41 +0000 (19:47 +0000)]
Move composite type finding of two objective-c expressions
into its own helper method. No change in functionality.

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

14 years agoImplement C++ DR437, which involves exception-specifications that name
Douglas Gregor [Thu, 10 Dec 2009 18:13:52 +0000 (18:13 +0000)]
Implement C++ DR437, which involves exception-specifications that name
a type currently being defined, from Nicola Gigante!

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

14 years agoMove initialization via initializer list over to InitializationSequences.
Douglas Gregor [Thu, 10 Dec 2009 17:56:55 +0000 (17:56 +0000)]
Move initialization via initializer list over to InitializationSequences.

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

14 years agoImplement redeclaration checking and hiding semantics for using declarations. There
John McCall [Thu, 10 Dec 2009 09:41:52 +0000 (09:41 +0000)]
Implement redeclaration checking and hiding semantics for using declarations.  There
are a couple of O(n^2) operations in this, some analogous to the usual O(n^2)
redeclaration problem and some not.  In particular, retroactively removing
shadow declarations when they're hidden by later decls is pretty unfortunate.
I'm not yet convinced it's worse than the alternative, though.

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

14 years agoFix for PR5515: allow "merging" array bounds both forwards and backwards.
Eli Friedman [Thu, 10 Dec 2009 08:54:47 +0000 (08:54 +0000)]
Fix for PR5515: allow "merging" array bounds both forwards and backwards.

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

14 years agoTest for r90950.
Eli Friedman [Thu, 10 Dec 2009 08:51:23 +0000 (08:51 +0000)]
Test for r90950.

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

14 years agoMangle static variables inside Objective-C methods in Objective-C++. We currently...
Anders Carlsson [Thu, 10 Dec 2009 03:14:39 +0000 (03:14 +0000)]
Mangle static variables inside Objective-C methods in Objective-C++. We currently mangle them the same way as gcc does.

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

14 years agoGet rid of static variable.
Eli Friedman [Thu, 10 Dec 2009 02:21:21 +0000 (02:21 +0000)]
Get rid of static variable.

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

14 years agoIf we enter parens, colons can become un-sacred, allowing us to emit
Chris Lattner [Thu, 10 Dec 2009 02:08:07 +0000 (02:08 +0000)]
If we enter parens, colons can become un-sacred, allowing us to emit
a better diagnostic in the second example.

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

14 years agofix a more evil case of : / :: confusion arising in ?:.
Chris Lattner [Thu, 10 Dec 2009 02:02:58 +0000 (02:02 +0000)]
fix a more evil case of : / :: confusion arising in ?:.

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

14 years agofix incorrect parsing of bitfields pointed out by Doug. I chose
Chris Lattner [Thu, 10 Dec 2009 01:59:24 +0000 (01:59 +0000)]
fix incorrect parsing of bitfields pointed out by Doug.  I chose
to use ColonProtectionRAIIObject in the C codepath even though it
won't matter for consistency.

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

14 years agoActually store the pointer into the global variable, spotted by Eli.
Anders Carlsson [Thu, 10 Dec 2009 01:58:33 +0000 (01:58 +0000)]
Actually store the pointer into the global variable, spotted by Eli.

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

14 years agoSetup cleanup on eh edge out of the construction of the cleanup object
Mike Stump [Thu, 10 Dec 2009 01:52:30 +0000 (01:52 +0000)]
Setup cleanup on eh edge out of the construction of the cleanup object
during throw to deallocate the exception object.  WIP.

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

14 years agominimal fix for PR5743
Chris Lattner [Thu, 10 Dec 2009 01:38:15 +0000 (01:38 +0000)]
minimal fix for PR5743

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

14 years agoHandle emitting static variables that have reference type.
Anders Carlsson [Thu, 10 Dec 2009 01:05:11 +0000 (01:05 +0000)]
Handle emitting static variables that have reference type.

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

14 years agoSeparate generating code for static variables and global variables.
Anders Carlsson [Thu, 10 Dec 2009 00:57:45 +0000 (00:57 +0000)]
Separate generating code for static variables and global variables.

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

14 years agoFix tabs.
Anders Carlsson [Thu, 10 Dec 2009 00:57:18 +0000 (00:57 +0000)]
Fix tabs.

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

14 years agoSecond half of r91023, saving files is good.
Chris Lattner [Thu, 10 Dec 2009 00:45:15 +0000 (00:45 +0000)]
Second half of r91023, saving files is good.

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

14 years agomove GreaterThanIsOperatorScope into RAIIObjectsForParser. Add some more
Chris Lattner [Thu, 10 Dec 2009 00:44:03 +0000 (00:44 +0000)]
move GreaterThanIsOperatorScope into RAIIObjectsForParser.  Add some more
TODOs for other classes that could be moved out of Parser.h.  I don't plan
to do these in the near term though.

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

14 years agofix PR5740: a colon is sacred when parsing case statement expressions!
Chris Lattner [Thu, 10 Dec 2009 00:38:54 +0000 (00:38 +0000)]
fix PR5740: a colon is sacred when parsing case statement expressions!

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

14 years agorename testcase
Chris Lattner [Thu, 10 Dec 2009 00:37:13 +0000 (00:37 +0000)]
rename testcase

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

14 years agorefactor the 'ColonIsSacred' argument to ParseOptionalCXXScopeSpecifier
Chris Lattner [Thu, 10 Dec 2009 00:32:41 +0000 (00:32 +0000)]
refactor the 'ColonIsSacred' argument to ParseOptionalCXXScopeSpecifier
to be a bool in Parser that is twiddled by the ColonProtectionRAIIObject
class.  No functionality change.

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

14 years agoMove more decl related functions to CGDeclCXX.cpp
Anders Carlsson [Thu, 10 Dec 2009 00:30:05 +0000 (00:30 +0000)]
Move more decl related functions to CGDeclCXX.cpp

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

14 years agorename ExtensionRAIIObject.h -> RAIIObjectsForParser.h
Chris Lattner [Thu, 10 Dec 2009 00:21:05 +0000 (00:21 +0000)]
rename ExtensionRAIIObject.h -> RAIIObjectsForParser.h

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

14 years agoAdd CGDeclCXX.cpp and move EmitCXXGlobalVarDeclInit there.
Anders Carlsson [Thu, 10 Dec 2009 00:16:00 +0000 (00:16 +0000)]
Add CGDeclCXX.cpp and move EmitCXXGlobalVarDeclInit there.

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

14 years agospread 'const' love to some variables. this considerably reduces the amount of dirty...
Nuno Lopes [Thu, 10 Dec 2009 00:07:02 +0000 (00:07 +0000)]
spread 'const' love to some variables. this considerably reduces the amount of dirty data around.

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

14 years agoFixup spacing.
Mike Stump [Thu, 10 Dec 2009 00:06:18 +0000 (00:06 +0000)]
Fixup spacing.

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

14 years agoFix spacing.
Mike Stump [Thu, 10 Dec 2009 00:05:14 +0000 (00:05 +0000)]
Fix spacing.

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

14 years agoEnsure we only generate one terminate handler.
Mike Stump [Thu, 10 Dec 2009 00:02:42 +0000 (00:02 +0000)]
Ensure we only generate one terminate handler.

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

14 years agoRemove obsolete FIXME and some dead fallback code.
Mike Stump [Wed, 9 Dec 2009 23:52:09 +0000 (23:52 +0000)]
Remove obsolete FIXME and some dead fallback code.

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

14 years agoAdd terminate handler to cleanups on exceptional edges.
Mike Stump [Wed, 9 Dec 2009 23:49:53 +0000 (23:49 +0000)]
Add terminate handler to cleanups on exceptional edges.

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

14 years agoCode gen for ObjCIsaExpr AST used as lvalue.
Fariborz Jahanian [Wed, 9 Dec 2009 23:35:29 +0000 (23:35 +0000)]
Code gen for ObjCIsaExpr AST used as lvalue.
(fixes radar 7457534).

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

14 years agoAdd terminate handler for copy constructors for thrown objects. WIP.
Mike Stump [Wed, 9 Dec 2009 23:31:35 +0000 (23:31 +0000)]
Add terminate handler for copy constructors for thrown objects.  WIP.

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

14 years agoFix null dereference in OSAtomicChecker and special case SymbolicRegions. We still...
Ted Kremenek [Wed, 9 Dec 2009 23:29:55 +0000 (23:29 +0000)]
Fix null dereference in OSAtomicChecker and special case SymbolicRegions.  We still aren't handling them correctly; I've added to failing test cases to test/Analysis/NSString-failed-cases.m that should pass and then be merged in to test/Analysis/NSString.m.

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

14 years agoReimplement reference initialization (C++ [dcl.init.ref]) using the
Douglas Gregor [Wed, 9 Dec 2009 23:02:17 +0000 (23:02 +0000)]
Reimplement reference initialization (C++ [dcl.init.ref]) using the
new notion of an "initialization sequence", which encapsulates the
computation of the initialization sequence along with diagnostic
information and the capability to turn the computed sequence into an
expression. At present, I've only switched one CheckReferenceInit
callers over to this new mechanism; more will follow.

Aside from (hopefully) being much more true to the standard, the
diagnostics provided by this reference-initialization code are a bit
better than before. Some examples:

p5-var.cpp:54:12: error: non-const lvalue reference to type 'struct
Derived'
      cannot bind to a value of unrelated type 'struct Base'
  Derived &dr2 = b; // expected-error{{non-const lvalue reference to
  ...
           ^     ~
p5-var.cpp:55:9: error: binding of reference to type 'struct Base' to
a value of
      type 'struct Base const' drops qualifiers
  Base &br3 = bc; // expected-error{{drops qualifiers}}
        ^     ~~

p5-var.cpp:57:15: error: ambiguous conversion from derived class
      'struct Diamond' to base class 'struct Base':
    struct Diamond -> struct Derived -> struct Base
    struct Diamond -> struct Derived2 -> struct Base
  Base &br5 = diamond; // expected-error{{ambiguous conversion from
      ...
              ^~~~~~~
p5-var.cpp:59:9: error: non-const lvalue reference to type 'long'
      cannot bind to
      a value of unrelated type 'int'
  long &lr = i; // expected-error{{non-const lvalue reference to type
      ...
        ^    ~

p5-var.cpp:74:9: error: non-const lvalue reference to type 'struct
Base' cannot
      bind to a temporary of type 'struct Base'
  Base &br1 = Base(); // expected-error{{non-const lvalue reference to
  ...
        ^     ~~~~~~

p5-var.cpp:102:9: error: non-const reference cannot bind to bit-field
'i'
  int & ir1 = (ib.i); // expected-error{{non-const reference cannot
  ...
        ^     ~~~~~~
p5-var.cpp:98:7: note: bit-field is declared here
  int i : 17; // expected-note{{bit-field is declared here}}
      ^

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

14 years agoBreak out code for reuse. WIP.
Mike Stump [Wed, 9 Dec 2009 22:59:31 +0000 (22:59 +0000)]
Break out code for reuse.  WIP.

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

14 years agoFixes a bogus error when declaring an extern "C" array.
Fariborz Jahanian [Wed, 9 Dec 2009 21:39:38 +0000 (21:39 +0000)]
Fixes a bogus error when declaring an extern "C" array.
(fixes radar 7457109).

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

14 years agoAdd throw support. WIP.
Mike Stump [Wed, 9 Dec 2009 19:24:08 +0000 (19:24 +0000)]
Add throw support.  WIP.

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

14 years agoCodegen. support for ObjCIsaExpr AST which until now
Fariborz Jahanian [Wed, 9 Dec 2009 19:05:56 +0000 (19:05 +0000)]
Codegen. support for ObjCIsaExpr AST which until now
was not needed (fixes radar 7453430).

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

14 years agoFix 80-col violation.
Mike Stump [Wed, 9 Dec 2009 18:09:35 +0000 (18:09 +0000)]
Fix 80-col violation.

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

14 years agoAdd DeclContext::dump.
Anders Carlsson [Wed, 9 Dec 2009 17:27:46 +0000 (17:27 +0000)]
Add DeclContext::dump.

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

14 years agoRefactor OSAtomic evaluation logic into OSAtomicChecker.
Zhongxing Xu [Wed, 9 Dec 2009 12:23:28 +0000 (12:23 +0000)]
Refactor OSAtomic evaluation logic into OSAtomicChecker.

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

14 years agoUse a temporary destination set such that we can clear fake auto transitions.
Zhongxing Xu [Wed, 9 Dec 2009 12:16:07 +0000 (12:16 +0000)]
Use a temporary destination set such that we can clear fake auto transitions.
Otherwise, even when real evaluation occurs, the previous fake auto
transitions would still be in the destination set, causing fake state
bifurcation.

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

14 years agoclang -cc1: Mark -i* options as JoinedOrSeparate, since the driver forwards them
Daniel Dunbar [Wed, 9 Dec 2009 10:01:26 +0000 (10:01 +0000)]
clang -cc1: Mark -i* options as JoinedOrSeparate, since the driver forwards them
directly and one can write '-includefoo' if one really wants to.

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

14 years agoFirst pass at implementing C++ enum semantics: calculate (and store) an
John McCall [Wed, 9 Dec 2009 09:09:27 +0000 (09:09 +0000)]
First pass at implementing C++ enum semantics:  calculate (and store) an
"integer promotion" type associated with an enum decl, and use this type to
determine which type to promote to.  This type obeys C++ [conv.prom]p2 and
is therefore generally signed unless the range of the enumerators forces
it to be unsigned.

Kills off a lot of false positives from -Wsign-compare in C++, addressing
rdar://7455616

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

14 years agoOSAtomic simulation: use the original region as the location to load from,
Zhongxing Xu [Wed, 9 Dec 2009 08:32:57 +0000 (08:32 +0000)]
OSAtomic simulation: use the original region as the location to load from,
instead of the ElementRegion obtained from casts.

Test cast: the leak cannot occur bacause the true branch cannot be taken.

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

14 years agoLook through using declarations when searching for allocation overloads.
Anders Carlsson [Wed, 9 Dec 2009 07:39:44 +0000 (07:39 +0000)]
Look through using declarations when searching for allocation overloads.

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

14 years agoUpdate checker build.
Ted Kremenek [Wed, 9 Dec 2009 06:58:36 +0000 (06:58 +0000)]
Update checker build.

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

14 years agoremove dead code.
Zhongxing Xu [Wed, 9 Dec 2009 05:52:12 +0000 (05:52 +0000)]
remove dead code.

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

14 years agoInsert instead of assign to the dest node set, since we use the dest node set
Zhongxing Xu [Wed, 9 Dec 2009 05:48:53 +0000 (05:48 +0000)]
Insert instead of assign to the dest node set, since we use the dest node set
repeatedly.

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

14 years agoFix for PR5730: make sure to consistently call
Eli Friedman [Wed, 9 Dec 2009 04:53:56 +0000 (04:53 +0000)]
Fix for PR5730: make sure to consistently call
PerformObjectArgumentInitialization from BuildCXXMemberCallExpr.

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