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

10644 Коммитов

Автор SHA1 Сообщение Дата
Chandler Carruth 60cfcecaf4 Silence some release build warnings.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91234 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-13 01:37:04 +00:00
Daniel Dunbar 821e2eb026 Backend: Switch to using TargetOptions or TargetMachine to set some options instead of llvm::cl.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91229 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-12 23:01:36 +00:00
Fariborz Jahanian 191dcd7604 patch to add a property from a protocol to a class that adopts the protocol.
(fixes radar 7466494).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91227 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-12 21:26:21 +00:00
Douglas Gregor a88cfbfac9 Rework the way we handle template instantiation for
implicitly-generated AST nodes. We previously built instantiated nodes
for each of these AST nodes, then passed them on to Sema, which was
not prepared to see already-type-checked nodes (see PR5755). In some
places, we had ugly workarounds to try to avoid re-type-checking
(e.g., in VarDecl initializer instantiation).

Now, we skip implicitly-generated nodes when performing instantiation,
preferring instead to build just the AST nodes that directly reflect
what was written in the source code. This has several advantages:

  - We don't need to instantiate anything that doesn't have a direct
    correlation to the source code, so we can have better location
    information.
  - Semantic analysis sees the same thing at template instantiation
    time that it would see for a non-template.
  - At least one ugly hack (VarDecl initializers) goes away.

Fixes PR5755.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91218 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-12 18:16:41 +00:00
Zhongxing Xu d9c84c8381 Add initial support for realloc() in MallocChecker.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91216 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-12 12:29:38 +00:00
John McCall aa87d33309 Remember the type name's scope specifier in the DeclSpec.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91215 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-12 11:40:51 +00:00
Douglas Gregor 06d33699f1 When certain diagnostics involving run-time behavior would be emitted
in a potentially potentially evaluated context, queue those
diagnostics and only emit them if the context ends up being
potentially evaluated. This completes the fix for PR5761.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91213 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-12 07:57:52 +00:00
Douglas Gregor 75b699a883 Suppress warnings and errors about certain uses of non-POD types (in
__builtin_offsetof, passing through an ellipsis) when we're in an
unevaluated context. This is the first part of the fix to PR5761,
which deals with the simple case of an unevaluated context.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91210 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-12 07:25:49 +00:00
Jeffrey Yasskin 9f61aa9e28 Un-namespace-qualify llvm_unreachable. It's a macro, so the qualification gave
no extra safety anyway.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91207 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-12 05:05:38 +00:00
Eli Friedman de2baa7576 Fix for PR4642: move work in HTMLPrinter out of the destructor.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91205 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-12 03:36:52 +00:00
Anders Carlsson fcfdb2ba42 Fix tyop.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91204 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-12 02:43:16 +00:00
Mike Stump 9c276ae0f2 Implement runtime checks for undefined behavior. WIP.
This implements a new flag -fcatch-undefined-behavior.  The flag turns
on additional runtime checks for:

  T a[I];

  a[i]    abort when i < 0 or i >= I.

Future stuff includes shifts by >= bitwidth amounts.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91198 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-12 01:27:46 +00:00
Ted Kremenek 130d5ffbb2 We should only scan for nested blocks if we are analyzing the body of a function/method.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91196 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-12 01:04:14 +00:00
Ted Kremenek 6feaf57b46 Make using '-fshort-enums' an error until it is actually implemented (changes the ABI, so it is dangerous to not error out if we don't support it). Fixes <rdar://problem/7461006>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91191 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-12 00:38:18 +00:00
Anders Carlsson 20d45d2a9e Correctly diagnose [basic.stc.dynamic.allocation]p1
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91190 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-12 00:32:00 +00:00
Anders Carlsson a3ccda5891 Factor operator new declaration checking out into a separate function.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91189 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-12 00:26:23 +00:00
Anders Carlsson 46991d6364 More work on improving the operator delete diagnostics.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91187 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-12 00:16:02 +00:00
Anders Carlsson 1152c39c8a Fix build.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91182 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-11 23:31:21 +00:00
Anders Carlsson 9d59ecb4d2 Improve diagnostics for malformed delete operator function declarations.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91180 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-11 23:23:22 +00:00
Daniel Dunbar dd63b28107 Update docs/comments/utils/examples to refer to clang -cc1 instead of clang-cc.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91176 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-11 23:04:35 +00:00
Daniel Dunbar 8ff5b28d6e Driver: Switch to using "clang" "-cc1" instead of "clang-cc".
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91174 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-11 23:00:49 +00:00
Fariborz Jahanian 3b27f1a80e Patch to allow C-style cast from 'void *' to block pointer type.
(fixes radar 7465023).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91171 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-11 22:40:48 +00:00
John McCall 9d5f35e112 StmtDumper::VisitUnresolvedLookupExpr
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91163 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-11 21:50:11 +00:00
Fariborz Jahanian 1f7711d113 Consider conversion of objective-c pointer to 'bool' a
valid standard conversion to match g++'s behaviour.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91157 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-11 21:23:13 +00:00
Eli Friedman 20e098b7e7 Fix for PR5714: make sure globals that will be modified aren't marked const.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91156 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-11 21:23:03 +00:00
Benjamin Kramer d8e494faa9 Switch PathDiagnostic to StringRef.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91155 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-11 21:09:27 +00:00
Eli Friedman 470fb73d4e 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
2009-12-11 20:48:18 +00:00
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