Commit Graph

74167 Commits

Author SHA1 Message Date
Douglas Gregor 83c49b56fe Class template (partial) specializations should not show up in code completion results
llvm-svn: 91125
2009-12-11 16:18:54 +00:00
Gabor Greif cb4685c012 Simplify this class by removing the result cache.
This change removes the DefaultConstructible
and CopyAssignable constraints on the template
parameter T (the first one).

The second template parameter (R) is defaulted to be
identical to the first and controls the result type.
By specifying it to be (const T&) additionally the
CopyConstructible constraint on T can be removed.

This allows to use StringSwitch e.g. for llvm::Constant
instances.

Regarding the other review feedback regarding performance
because of taking pointers, this class should be completely
optimizable like before, since all methods are inline and
the pointer dereferencing and result value caching should be
possible behind the scenes by the "as-if" rule.

llvm-svn: 91123
2009-12-11 15:30:07 +00:00
Benjamin Kramer b11118bd0b Random string-related cleanups.
llvm-svn: 91119
2009-12-11 13:33:18 +00:00
Benjamin Kramer 8a4ad4adc1 Use StringRef.getAsInteger instead of temporary string + strtol. No intended functionality change.
llvm-svn: 91118
2009-12-11 13:26:32 +00:00
Bill Wendling 9f13fc7d63 Revert part of r91101 which was causing an infinite loop in the self-hosting
build bots.

llvm-svn: 91113
2009-12-11 10:43:41 +00:00
Eli Friedman 68396b16f6 Move the code for converting a member pointer to a bool so that it is usable
for logical not.

llvm-svn: 91112
2009-12-11 09:26:29 +00:00
Duncan Sands 5d96f3fcb6 Add utility method for determining whether a function argument
has the 'nest' attribute.

llvm-svn: 91109
2009-12-11 08:36:17 +00:00
Eli Friedman 1762cf2ad0 Fix for PR5718: implement equality comparisons for member function pointers.
llvm-svn: 91108
2009-12-11 07:36:43 +00:00
Ted Kremenek f6d9cebafd Enhance understanding of VarRegions referenced by a block whose declarations are outside the current stack frame. Fixes <rdar://problem/7462324>.
llvm-svn: 91107
2009-12-11 06:43:27 +00:00
Evan Cheng ff2ac71b25 Tests for 91103 and 91104.
llvm-svn: 91105
2009-12-11 06:02:21 +00:00
Evan Cheng 766a73fb04 Add support to 3-addressify 16-bit instructions.
llvm-svn: 91104
2009-12-11 06:01:48 +00:00
Evan Cheng c9a41c8b03 Coalesce insert_subreg undef, x first to avoid phase ordering issue.
llvm-svn: 91103
2009-12-11 06:01:00 +00:00
Bill Wendling a1bce0c42e Address comments on last patch:
- Loosen the restrictions when checking of it branches to a landing pad.
- Make the loop more efficient by checking the '.insert' return value.
- Do cheaper checks first.

llvm-svn: 91101
2009-12-11 03:14:18 +00:00
Zhongxing Xu 9cb53b86af Completely evaluate malloc/free in MallocChecker.cpp.
llvm-svn: 91100
2009-12-11 03:09:01 +00:00
John McCall 0048c5115d Test member template using hiding.
llvm-svn: 91099
2009-12-11 02:55:56 +00:00
Anders Carlsson fd7dfeb779 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).
llvm-svn: 91098
2009-12-11 02:46:30 +00:00
Eli Friedman ad6c2e5b3a Fix a recent regression from the initialization changes.
llvm-svn: 91097
2009-12-11 02:42:07 +00:00
John McCall a17e83e437 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.

llvm-svn: 91096
2009-12-11 02:33:26 +00:00
John McCall a009726ce3 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. :)

llvm-svn: 91095
2009-12-11 02:10:03 +00:00
Chris Lattner 56caf31afb 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.
llvm-svn: 91094
2009-12-11 01:52:50 +00:00
Bill Wendling a581aacdce A machine basic block may end in an unconditional branch, however it may have
more than one successor. Normally, these extra successors are dead. However,
some of them may branch to exception handling landing pads. If we remove those
successors, then the landing pads could go away if all predecessors to it are
removed. Before, it was checking if the direct successor was the landing
pad. But it could be the result of jumping through multiple basic blocks to get
to it. If we were to only check for the existence of an EH_LABEL in the basic
block and not remove successors if it's in there, then it could stop actually
dead basic blocks from being removed.

llvm-svn: 91092
2009-12-11 01:49:14 +00:00
Jim Grosbach 5c4e99fca6 Rough first pass at compare_and_swap atomic builtins for ARM mode. Work in progress.
llvm-svn: 91090
2009-12-11 01:42:04 +00:00
Eli Friedman d0e6097bb0 Fix the handling of dependent enums per C++ DR 502.
llvm-svn: 91089
2009-12-11 01:34:50 +00:00
Anders Carlsson c988201417 Use named flags in RTTIBuilder::BuildPointerType.
llvm-svn: 91088
2009-12-11 01:27:37 +00:00
Anders Carlsson fb8d445090 Add qualifiers for calls to member functions in dependent bases.
llvm-svn: 91087
2009-12-11 01:04:42 +00:00
Anders Carlsson 0c6a7d8f42 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.
llvm-svn: 91086
2009-12-11 01:00:09 +00:00
Zhongxing Xu 1239de1592 Use 'class' instead of 'struct'.
llvm-svn: 91085
2009-12-11 00:55:44 +00:00
Anders Carlsson afd1edb52e 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.

llvm-svn: 91084
2009-12-11 00:32:37 +00:00
Daniel Dunbar ff141799fb Remove this test for now, it is flaky.
llvm-svn: 91083
2009-12-11 00:27:30 +00:00
Daniel Dunbar 2f1a6c1104 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.

llvm-svn: 91082
2009-12-11 00:27:20 +00:00
Fariborz Jahanian 73fab4f3f4 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).

llvm-svn: 91081
2009-12-11 00:26:36 +00:00
Mike Stump 18f4196792 Testcase for recent checkin.
llvm-svn: 91080
2009-12-11 00:10:15 +00:00
Mike Stump 6da5d75449 Implement just a bit more of inline assembly.
llvm-svn: 91079
2009-12-11 00:04:56 +00:00
Mike Stump 37077bf651 Fix spacing.
llvm-svn: 91078
2009-12-11 00:02:10 +00:00
Devang Patel 2eec32d944 If VariableDIe is not created (may be because global was optimzed away) then do not try to use the variable die.
llvm-svn: 91077
2009-12-10 23:25:41 +00:00
Mike Stump e1f6280093 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.

llvm-svn: 91073
2009-12-10 22:57:48 +00:00
Douglas Gregor 01ddf7a65f clang_getCompletionChunkText() will treat optional strings as empty text blocks
llvm-svn: 91072
2009-12-10 22:46:19 +00:00
Eli Friedman d70bbfd7d8 Support unary type traits in a scalar context. Not that I've actually seen
this construct, but might as well for completeness.

llvm-svn: 91071
2009-12-10 22:40:32 +00:00
Eli Friedman ee275c82ff Clean up enum constants so that they're finally sane. Fixes PR3173 and a
recently introduced crash.

llvm-svn: 91070
2009-12-10 22:29:29 +00:00
Anders Carlsson 781161dc55 Make sure that explicitly instantiated functions get the right linkage.
llvm-svn: 91069
2009-12-10 22:25:34 +00:00
Douglas Gregor 96156a46e0 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.

llvm-svn: 91068
2009-12-10 22:08:55 +00:00
Benjamin Kramer e9ff5fe2e6 Privatize class members.
llvm-svn: 91067
2009-12-10 21:50:21 +00:00
John McCall 7a2865a217 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.

llvm-svn: 91063
2009-12-10 21:17:25 +00:00
Eric Christopher 4b91e0194b Add a test for the fix in revision 91009.
llvm-svn: 91062
2009-12-10 21:11:40 +00:00
Evan Cheng 4986588ddb It's not safe to coalesce a move where src and dst registers have different subregister indices. e.g.:
%reg16404:1<def> = MOV8rr %reg16412:2<kill>

llvm-svn: 91061
2009-12-10 20:59:45 +00:00
Fariborz Jahanian f63a028756 No need to add -x objecitve-c++
llvm-svn: 91060
2009-12-10 20:57:43 +00:00
Fariborz Jahanian 798d2bd546 Add support for finding composite type of twp objective-c pointers
in objective-c++ mode.

llvm-svn: 91059
2009-12-10 20:46:08 +00:00
Douglas Gregor 9f8ca58e30 Remove a broken, unused header
llvm-svn: 91058
2009-12-10 19:52:22 +00:00
John McCall e29c5cd239 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.

llvm-svn: 91057
2009-12-10 19:51:03 +00:00
Fariborz Jahanian a430f71406 Move composite type finding of two objective-c expressions
into its own helper method. No change in functionality.

llvm-svn: 91056
2009-12-10 19:47:41 +00:00