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

10617 Коммитов

Автор SHA1 Сообщение Дата
Eli Friedman 6f9f25dfc7 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
2009-12-11 20:21:38 +00:00
John McCall e7e278bce2 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
2009-12-11 20:04:54 +00:00
Douglas Gregor ef96eac2b8 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
2009-12-11 19:06:04 +00:00
Douglas Gregor a61a87980d 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
2009-12-11 18:44:16 +00:00
Douglas Gregor d1cd31aeb8 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
2009-12-11 18:28:39 +00:00
Douglas Gregor ce82196076 Member function templates can occur after . or ->
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91137 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-11 18:14:22 +00:00
Eli Friedman ecb7e932e9 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
2009-12-11 18:00:57 +00:00
Douglas Gregor 7628294ee8 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
2009-12-11 17:31:05 +00:00
Anders Carlsson 44636d11ea 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
2009-12-11 16:41:51 +00:00
Anders Carlsson 4e7135613a 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
2009-12-11 16:37:06 +00:00
Douglas Gregor e29ffaae9b 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
2009-12-11 16:18:54 +00:00
Benjamin Kramer 8d04258483 Random string-related cleanups.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91119 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-11 13:33:18 +00:00
Benjamin Kramer 330358056a 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
2009-12-11 13:26:32 +00:00
Eli Friedman 3a1737030e 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
2009-12-11 09:26:29 +00:00
Eli Friedman b81c786de5 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
2009-12-11 07:36:43 +00:00
Ted Kremenek 2b87ae45e1 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
2009-12-11 06:43:27 +00:00
Zhongxing Xu a49c6b7da5 Completely evaluate malloc/free in MallocChecker.cpp.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91100 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-11 03:09:01 +00:00
Anders Carlsson 31b7f52d8c 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
2009-12-11 02:46:30 +00:00
Eli Friedman 03981014e4 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
2009-12-11 02:42:07 +00:00
John McCall d7533ec10b 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
2009-12-11 02:33:26 +00:00
John McCall 60fa3cfd7a 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
2009-12-11 02:10:03 +00:00
Eli Friedman ed0716b7b7 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
2009-12-11 01:34:50 +00:00
Anders Carlsson d6baec80f2 Use named flags in RTTIBuilder::BuildPointerType.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91088 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-11 01:27:37 +00:00
Anders Carlsson 6ec687d2ad 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
2009-12-11 01:00:09 +00:00
Zhongxing Xu 7fb1464c99 Use 'class' instead of 'struct'.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91085 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-11 00:55:44 +00:00
Anders Carlsson 8370c58b92 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
2009-12-11 00:32:37 +00:00
Daniel Dunbar 475ddb4547 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
2009-12-11 00:27:20 +00:00
Fariborz Jahanian 737061fc29 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
2009-12-11 00:26:36 +00:00
Mike Stump 95059b5013 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
2009-12-11 00:04:56 +00:00
Mike Stump 0924a8a06f Fix spacing.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91078 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-11 00:02:10 +00:00
Mike Stump c9875bfa6f 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
2009-12-10 22:57:48 +00:00
Eli Friedman 9dfebdcdcd 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
2009-12-10 22:40:32 +00:00
Eli Friedman 29a7f3342c 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
2009-12-10 22:29:29 +00:00
Anders Carlsson 548e60efea 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
2009-12-10 22:25:34 +00:00
Benjamin Kramer 648d846e4f Privatize class members.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91067 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-10 21:50:21 +00:00
Fariborz Jahanian 5501636b41 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
2009-12-10 20:46:08 +00:00
John McCall 41ce66f8e2 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
2009-12-10 19:51:03 +00:00
Fariborz Jahanian eebc4750fd 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
2009-12-10 19:47:41 +00:00
Douglas Gregor 0966f35898 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
2009-12-10 18:13:52 +00:00
Douglas Gregor d87b61f639 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
2009-12-10 17:56:55 +00:00
John McCall 9f54ad4381 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
2009-12-10 09:41:52 +00:00
Eli Friedman 153c33ed95 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
2009-12-10 08:54:47 +00:00
Anders Carlsson 7b06f6c20e 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
2009-12-10 03:14:39 +00:00
Eli Friedman 940670512d Get rid of static variable.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91041 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-10 02:21:21 +00:00
Chris Lattner 932dff777d 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
2009-12-10 02:08:07 +00:00
Chris Lattner a69d0ed3ab 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
2009-12-10 02:02:58 +00:00
Chris Lattner a1efc8c8c6 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
2009-12-10 01:59:24 +00:00
Anders Carlsson 864143fe14 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
2009-12-10 01:58:33 +00:00
Mike Stump 5030a98e20 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
2009-12-10 01:52:30 +00:00
Chris Lattner f2c8e7dee9 minimal fix for PR5743
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91032 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-10 01:38:15 +00:00