Commit Graph

16538 Commits

Author SHA1 Message Date
Zhongxing Xu 23e082d32c Call PreVisitDeclStmt for C++ aggregate initializers. Patch by Jim Goodnow II.
llvm-svn: 116473
2010-10-14 05:22:59 +00:00
John McCall 7f570718d3 Compress bit fields / enums from ReferenceType, BuiltinType, FunctionType, and
ObjCObjectType into Type.

llvm-svn: 116472
2010-10-14 03:00:17 +00:00
John McCall e1139e4a88 Whoops. This really shouldn't compile in clang, either.
llvm-svn: 116470
2010-10-14 02:06:32 +00:00
John McCall c153891662 Perform range restrictions on regparm when applied to a type and
not a decl.

llvm-svn: 116469
2010-10-14 01:57:10 +00:00
John McCall 43b6168b3b Teach Diagnostic to recursively expand inside %plural formats.
llvm-svn: 116468
2010-10-14 01:55:31 +00:00
Chris Lattner 26f6c227dc allow I128 suffixes in msextensions mode just like i128 suffixes, patch
by Martin Vejnar!

llvm-svn: 116460
2010-10-14 00:24:10 +00:00
Chris Lattner 2edb926880 move logic for computing signed integer overflow when constant folding
into APInt.

llvm-svn: 116453
2010-10-13 23:46:56 +00:00
Douglas Gregor 5a2bb5ba98 Diagnose when a 'static' member function overrides a virtual function
in a base class. Fixes PR8168.

llvm-svn: 116448
2010-10-13 22:55:32 +00:00
Douglas Gregor a007d36c1b Generalize the checking for qualification of (non-friend) class
members. Provide a hard error when the qualification doesn't match the
current class type, or a warning + Fix-it if it does match the current
class type. Fixes PR8159.

llvm-svn: 116445
2010-10-13 22:19:53 +00:00
Douglas Gregor 392a84bdf6 Eliminate the use of ObjCSuperExpr in code completion.
llvm-svn: 116436
2010-10-13 21:24:53 +00:00
Douglas Gregor d07ba34a44 There is no reason for dereferencing a pointer-to-member to require
that the class type into which the pointer points be complete, even
though the standard requires it. GCC/EDG do not require a complete
type here, so we're calling this a problem with the standard. Fixes
PR8328.

llvm-svn: 116429
2010-10-13 20:41:14 +00:00
Douglas Gregor f10c97f36e _Bool is not a keyword in C++. Fixes PR7388 and PR8349.
llvm-svn: 116422
2010-10-13 20:00:38 +00:00
Douglas Gregor 52051cb173 Introduce a bit into Type that keeps track of whether there are any
unnamed or local types within that type. This bit is cached along with
the linkage of a type, so that it can be recomputed (e.g., when we see
that a typedef has given a name to an anonymous declaration).

Use this bit when checking C++03 [temp.arg.type]p2, so that we don't
walk template argument types repeatedly.

llvm-svn: 116413
2010-10-13 18:05:20 +00:00
Douglas Gregor b39215942e Fix a silly bug in the suppression of non-error diagnostics in a
SFINAE context, where we weren't getting the right diagnostic argument
count. I blame DiagnosticBuilder's weirdness. Fixes PR8372.

llvm-svn: 116411
2010-10-13 17:22:14 +00:00
Douglas Gregor 518da18d70 Compute whether a type is variably modified as we build the type,
rather than walking the type's structure every time we request this
information. Performance optimization; no functionality change.

llvm-svn: 116409
2010-10-13 16:58:14 +00:00
Fariborz Jahanian 26d1e2b370 Eliminates a clang warning.
llvm-svn: 116408
2010-10-13 16:19:16 +00:00
John McCall ccbc032146 Preserve the original scope when picking the right scope for a friend
declaration, because we'll need it later.  Hopefully fixed self-host.

llvm-svn: 116399
2010-10-13 06:22:15 +00:00
John McCall f7cfb2212c Support friend function declarations in local classes correctly.
Fixes a crash and diagnoses the error condition of an unqualified
friend which doesn't resolve to something.  I'm still not certain how
this is useful.

llvm-svn: 116393
2010-10-13 05:45:15 +00:00
Argyrios Kyrtzidis 8c64bbe032 Embrace C++ ABI 5.2.6 and consider that template instantiations don't have key functions (same as GCC).
llvm-svn: 116391
2010-10-13 02:39:41 +00:00
Douglas Gregor 7731d3fafc Teach the warning about unnamed/local types in template arguments to
actually walk the template argument type to find any unnamed/local
types within it. Fixes PR6784.

llvm-svn: 116382
2010-10-13 00:27:52 +00:00
Douglas Gregor 5bb5e4ad9d Introduce support for emitting diagnostics (warnings + their notes)
that are suppressed during template argument deduction. This change
queues diagnostics computed during template argument deduction. Then,
if the resulting function template specialization or partial
specialization is chosen by overload resolution or partial ordering
(respectively), we will emit the queued diagnostics at that point. 

This addresses most of PR6784. However, the check for unnamed/local
template arguments (which existed before this change) is still only
skin-deep, and needs to be extended to look deeper into types. It must
be improved to finish PR6784.

llvm-svn: 116373
2010-10-12 23:32:35 +00:00
Devang Patel 67f70aaf5a Fix debug info for anon union.
This is tested by anon-union.exp.

llvm-svn: 116372
2010-10-12 23:24:54 +00:00
Devang Patel e25b5f86d0 Fix anon union member assignment expression's location.
This is tested by anon-union.exp in gdb testsuite.

llvm-svn: 116371
2010-10-12 23:23:25 +00:00
John McCall de3fd2264c Handle dependent friends more explicitly and deal with the possibility
of templated-scope friends by marking them invalid and white-listing all
accesses until such time as we implement them.  Fixes a crash, this time
without a broken test case.

llvm-svn: 116364
2010-10-12 23:13:28 +00:00
Eli Friedman 36ebbec121 PR8325: don't do destructor checking when a pointer is thrown.
llvm-svn: 116336
2010-10-12 20:32:36 +00:00
John McCall 036855a0ed Enter the context of the declared function template when performing
deduction and the final substitution, but not while substituting the
explicit template arguments.  Fixes rdar://problem/8537391

llvm-svn: 116332
2010-10-12 19:40:14 +00:00
Douglas Gregor 6e9cf630f8 When finalizing a function template specialization following template
argument deduction, make sure to check the correctness of deduced template
type arguments (which we had previously skipped) along with other
kinds of template arguments. This fixes part of PR6784, but we're
still swallowing the extension warning about unnamed/local template
arguments.

llvm-svn: 116327
2010-10-12 18:51:08 +00:00
Douglas Gregor 758cb67fcf If we end up instantiating a function parameter whose default argument
has not yet been parsed, note that the default argument hasn't been
parsed and keep track of all of the instantiations of that function
parameter. When its default argument does get parsed, imbue the
instantiations with that default argument. Fixes PR8245.

llvm-svn: 116324
2010-10-12 18:23:32 +00:00
Chris Lattner 17c0eac879 fix PR7885, rejecting invalid uses of __builtin_constant_p.
llvm-svn: 116317
2010-10-12 17:47:42 +00:00
Douglas Gregor efc469587a Parse default arguments within member functions in source order, from
Manuel Klimek! Fixes PR7715.

llvm-svn: 116311
2010-10-12 16:25:54 +00:00
Duncan Sands 38b918c0cf Pacify gcc-4.4.
llvm-svn: 116300
2010-10-12 14:07:59 +00:00
John McCall 73d3618223 C's comma operator performs lvalue conversion on both its operands;
require them to have complete types.

llvm-svn: 116297
2010-10-12 07:14:40 +00:00
John McCall 01cbf2de0f I just do what the comments tell me to do.
llvm-svn: 116289
2010-10-12 02:19:57 +00:00
John McCall 36226621f6 Progress.
llvm-svn: 116287
2010-10-12 02:09:17 +00:00
Douglas Gregor 7bb8af613c When we load an ASTUnit from command-line arguments, hold on to the
diagnostics produced by the driver itself. Previously, we were
allowing these to either be dropped or to slip through to stderr.

Fixes <rdar://problem/7595339>.

llvm-svn: 116285
2010-10-12 00:50:20 +00:00
Cameron Esfahani f6c73c463f Fix spelling error.
llvm-svn: 116283
2010-10-12 00:21:25 +00:00
John McCall 36e7fe31d4 Add some infrastructure for dealing with expressions of 'placeholder' type,
i.e. expressions with an internally-convenient type which should not be
appearing in generally valid, complete ASTs.

llvm-svn: 116281
2010-10-12 00:20:44 +00:00
Fariborz Jahanian 77890879dd Fixes a typo which caused byte offset in debug info
for ivars to be 0. Fixes pr8353.

llvm-svn: 116273
2010-10-11 23:55:47 +00:00
Daniel Dunbar 48ed37d98e Basic: Tweak attempt to make version tags work from 'svn export's again, clip
off the extra parts of the $URL$ SVN keyword.

llvm-svn: 116269
2010-10-11 23:50:34 +00:00
Daniel Dunbar d097d913b6 Basic: Attempt to make version tags work from 'svn export's again.
llvm-svn: 116268
2010-10-11 23:44:19 +00:00
Daniel Dunbar 89329cb8f7 Driver/Darwin: Remove a useless warning about missing runtime libraries. These
are almost never needed, so the warning isn't very useful.

llvm-svn: 116263
2010-10-11 23:31:07 +00:00
Douglas Gregor bd82998e35 Eliminate CIndexer::getClangPath(), since libclang no longer depends
on the presence of a 'clang' executable. Simplify
CIndexer::getClangResourcesPath() a bit.

Patch up the CMake makefiles to install headers into two locations in
the build tree, for those silly cases where 'clang' will end up
looking into the wrong build directory for headers.

llvm-svn: 116260
2010-10-11 23:17:59 +00:00
Fariborz Jahanian fef5d16f45 Some refactoring of property rewriting stuff
in rewriter. No functionality change.

llvm-svn: 116254
2010-10-11 22:21:03 +00:00
Douglas Gregor b9ab0ed33e Eliminate the (de-)serialization of code completion results, now that
libclang does not support out-of-process code completion.

llvm-svn: 116253
2010-10-11 22:12:15 +00:00
Douglas Gregor 4e0f15a4a2 Eliminate -fdiagnostics-binary and all of the infrastructure for
emitting diagnostics in a binary form to be consumed by libclang,
since libclang no longer does any of its work out-of-process, making
this code dead. Besides, this stuff never worked at 100% anyway.

llvm-svn: 116250
2010-10-11 22:02:06 +00:00
Devang Patel 33ddf69fb3 Fix debug info for functions whose context is a namespace.
This is tested by namespace.exp in gdb testsuite.

llvm-svn: 116248
2010-10-11 21:58:41 +00:00
Douglas Gregor 36e3b5c79e Switch c-index-test from clang_codeComplete() over to
clang_codeCompleteAt(). This uncovered a few issues with the latter:

  - ASTUnit wasn't saving/restoring diagnostic state appropriately between
    reparses and code completions.
  - "Overload" completions weren't being passed through to the client

llvm-svn: 116241
2010-10-11 21:37:58 +00:00
Fariborz Jahanian f3f903a9f0 This patch does a few things in the area of objective-c
properties.
1. Generates the AST for lexical info. of accessing 
   getter/setter methods using dot-syntax notation.
   This fixes //rdar: //8528170.
2. Modifes rewriter to handle the AST putout in 1.
3. Supportes in rewriter ObjCImplicitSetterGetter ASTs.

llvm-svn: 116237
2010-10-11 21:29:12 +00:00
Daniel Dunbar 7cba5a76dd IRgen/Obj-C: Fix encoding of "long double".
- The mind boggles.

llvm-svn: 116226
2010-10-11 21:13:48 +00:00
Francois Pichet c2bc5ac149 Add parsing support for Microsoft attributes. MS attributes will just be skipped and not inserted into the AST for now.
llvm-svn: 116203
2010-10-11 12:59:39 +00:00
Axel Naumann b151c3c2d6 Declare argv parameters as const char* const* instead of to char** to clarify that they are not modified, and to allow for string literals as arguments.
llvm-svn: 116200
2010-10-11 09:18:43 +00:00
Axel Naumann 89c31490d8 Tighten up constness of argv parameters to allow for string literals as argumants and to reflect actual (non-modifying) use.
llvm-svn: 116199
2010-10-11 09:13:46 +00:00
Chris Lattner a09e8efd1f Per discussion with Sanjiv, remove the PIC16 target from mainline. When/if
it comes back, it will be largely a rewrite, so keeping the old codebase
in tree isn't helping anyone.

llvm-svn: 116191
2010-10-11 05:44:49 +00:00
Chris Lattner 29e78ac923 comment out unused function
llvm-svn: 116189
2010-10-11 05:38:10 +00:00
Argyrios Kyrtzidis 0c34b138df Make sure the VTables for template instantiations are emitted even if the key function doesn't have a body.
llvm-svn: 116186
2010-10-11 03:25:57 +00:00
Argyrios Kyrtzidis f0e31c8b9c Don't let typeinfo name symbols be 'internal hidden', it can lead to linker conflicts
with similarly named classes in anonymous namespaces.

llvm-svn: 116185
2010-10-11 03:25:53 +00:00
NAKAMURA Takumi 11f6be1ce8 lib/CodeGen/CodeGenModule.cpp: DLLImportLinkage should be processed also on declaration.
It enables clang to compile Mingw's headers.

llvm-svn: 116184
2010-10-11 02:30:56 +00:00
NAKAMURA Takumi 89acd1e7ef lib/Driver/Driver.cpp: Use the driver g++-4 for Cygwin-1.5.
llvm-svn: 116183
2010-10-11 02:28:42 +00:00
NAKAMURA Takumi e4faafba32 lib/Frontend/InitHeaderSearch.cpp: Fix compatibility to Cygming.
- lib/gcc/include should not be included. Clang oughta have alternatives. (PR7956)
  - Cygwin: /usr/include/w32api should be included. gcc/cygwin does.
  - gcc/cygwin uses gcc paths as /usr/lib not /lib. They are same on Cygwin environment, though, We have to take what gcc/cygwin does.
  - Cygwin-1.7: Use 4.3.4.
  - Cygwin-1.5: Use 4.3.2 for gcc-4.

llvm-svn: 116182
2010-10-11 02:27:37 +00:00
Chris Lattner 88fdea8ad9 fix PR8217, a silent miscompilation of invalid code.
llvm-svn: 116166
2010-10-10 18:16:20 +00:00
Chris Lattner 001b29ccc1 Allow a string literal to initialize a tail array (PR8217), patch
by Pierre Habouzit!

llvm-svn: 116165
2010-10-10 17:49:49 +00:00
Francois Pichet 52bea03e7a Unbreak the CMake build.
llvm-svn: 116164
2010-10-10 09:17:09 +00:00
Zhongxing Xu 271c9c7b6d Add experimental chroot check which checks improper use of chroot(). Patch by
Lei Zhang.

llvm-svn: 116163
2010-10-10 05:45:30 +00:00
Argyrios Kyrtzidis 073c9cb592 Implement __builtin_ia32_vec_ext_v2si function (required by Qt).
llvm-svn: 116162
2010-10-10 03:19:11 +00:00
NAKAMURA Takumi 6bdc8a2d8a lib/Driver/Tools.cpp: Disable cxa_atexit by default also on Cygwin.
llvm-svn: 116161
2010-10-10 01:53:03 +00:00
Benjamin Kramer bfac7dcda0 Don't rely on a StringRef being null-terminated (it's not) for deprecation messages.
Store pointer and length of the message in DelayedDiagnostic and hide the gory union details.

llvm-svn: 116153
2010-10-09 15:49:00 +00:00
Bill Wendling 65b2a965fb Add target implementations for the X86 builtins:
__builtin_ia32_vec_init_v8qi
  __builtin_ia32_vec_init_v4hi
  __builtin_ia32_vec_init_v2si

They are lowered to bitcasts. (These are all ready tested by the gcc testsuite.)
<rdar://problem/8529957>

llvm-svn: 116147
2010-10-09 08:47:25 +00:00
Argyrios Kyrtzidis 52da8da03b Fix g++.dg regressions introduced at r115347 (rdar://8529993)
llvm-svn: 116144
2010-10-09 04:39:54 +00:00
John McCall a2fabff4f6 Permit constant evaluation of const floating-point variables with
constant initializers.

llvm-svn: 116138
2010-10-09 01:34:31 +00:00
Nico Weber a6bde81bc8 Add support for UCNs for character literals
llvm-svn: 116129
2010-10-09 00:27:47 +00:00
Douglas Gregor 0bf3140424 Implement C++0x scoped enumerations, from Daniel Wallin! (and tweaked a
bit by me). 

llvm-svn: 116122
2010-10-08 23:50:27 +00:00
Fariborz Jahanian 73853e5bab Method implemented in class's implementation may implement
one declared in class's extension and not one declared
in class's superclass. This supresses a bogus warning on
method type mismatch.
Fixes //rdar: // 8530080

llvm-svn: 116118
2010-10-08 22:59:25 +00:00
Fariborz Jahanian 163488ffbf When dealing with an assignment with LHS being a property reference
expression, the entire assignment tree is rewritten into a property
setter messaging. This includes rewriting the RHS. 
Do not attempt to rewrite RHS again. Never rewrite a rewritten text!
Fixes //rdar: //8527018.

llvm-svn: 116104
2010-10-08 21:12:22 +00:00
Douglas Gregor be4092138f Improve XML output for class/struct/union declarations, from Martin Vejnar!
llvm-svn: 116103
2010-10-08 21:05:46 +00:00
Douglas Gregor 7a2b425ee1 Revert the hack Chris Lattner added in r97981 to work around
brokenness in the designated-initializer ASTs. The ASTs were fixed by
Alp Toker's patch (r116098) for PR6955. Fixes PR6537.

llvm-svn: 116101
2010-10-08 20:56:19 +00:00
Douglas Gregor 559c9fb134 This patch fixes multiple issues in clang's designated init builder and
completes support for C1X anonymous struct/union init features:

 * Indexed anonymous member initializers should not be expanded. Doing so makes
little sense and would cause unresolvable semantic ambiguity in valid code
(regression introduced by r69153).

 * Subobject initialization of (possibly nested) anonymous members are now
referred to with paths relative to the naming record context, eliminating the
synthesis of incorrect implicit InitListExprs that caused CodeGen to assert.

 * Field lookup was missing a null check in IdentifierInfo comparison which
caused lookup for a known (already resolved) field to match the first unnamed
data member it encountered leading to silent miscompilation.

 * Subobject paths are no longer built using the general purpose
Sema::BuildAnonymousStructUnionMemberPath(). If any corner cases crop up, we
will now assert earlier in Sema instead of passing invalid InitListExprs
through to CodeGen.

Fixes PR6955, from Alp Toker!

llvm-svn: 116098
2010-10-08 20:44:28 +00:00
Douglas Gregor 8ed5b77008 Fix the mapping of vertical-space cursor kinds to produce a newline,
rather than a space.

llvm-svn: 116097
2010-10-08 20:39:29 +00:00
Devang Patel 3db5480b27 Tighter check in r116060 blcoked enums also. Emit enum const's debug info.
llvm-svn: 116071
2010-10-08 18:24:19 +00:00
John McCall 942687084f __attribute__((aligned(n))) directly specifies the alignment of a declaration
unless it's a non-packed field, in which case it can only increase the
alignment.  [[align]] effectively works the same way for well-formed code
(because it's ill-formed for [[align]] to decrease alignment ever).

Fixes rdar://problem/8335865

llvm-svn: 116070
2010-10-08 18:24:19 +00:00
Devang Patel 5e8ee2bb89 Do not repeat debug info for file variable constants.
This is tested by file-statics.exp in gdb testsuite.

llvm-svn: 116060
2010-10-08 17:02:40 +00:00
Douglas Gregor bb6a881862 Fix three related, wily issues with the recompilation of precompiled
preambles:

  - When we rebuild a precompiled preamble, make sure to disable
    skipping anything in the main file; we may have had leftover
    preamble-skipping values in the lexer, which leads to very empty
    preamble. This is a correctness issue.

  - When we rebuild a precompiled preamble, clear out any prior state
    in the Diagnostic object. Otherwise, we might think that there
    were errors when we were building the preamble itself, and
    therefore reject the resulting preamble. This is mainly a
    performance issue.

  - Don't remove old remappings when digging out the remapping for the
    main file. Having the old mappings around does not hurt in the
    common case (later remappings will just overwrite them), and is
    important when we fail to find a preamble: we don't want to have
    removed the remapping, because we'll need it later.

llvm-svn: 116041
2010-10-08 04:03:57 +00:00
Argyrios Kyrtzidis b5c7c51392 When we encounter a '==' in a context expecting a '=', assume the user made a typo:
t.c:1:7: error: invalid '==' at end of declaration; did you mean '='?
int x == 0;
      ^~
      =

Implements rdar://8488464.

llvm-svn: 116035
2010-10-08 02:39:23 +00:00
John McCall acf0ee57b6 Track the location of the context requiring an implicit conversion and use it
to white-list conversions required by system headers.  rdar://problem/8232669

llvm-svn: 116029
2010-10-08 02:01:28 +00:00
Argyrios Kyrtzidis 74825bcfb9 Implement -fshort-enums (rdar://8490496).
llvm-svn: 116020
2010-10-08 00:25:19 +00:00
Devang Patel 251f859b23 Identify functions with prototype appropriately in debug info.
This is tested by callfuncs.exp in gdb testsuite.

llvm-svn: 115989
2010-10-07 22:03:49 +00:00
Argyrios Kyrtzidis 15a9edc7cf Fix an infinite loop, caused by unintended syntax bug (the 'break;' after 'default:' was intended to break out of the while loop).
Fixes rdar://8518859&8520617.

llvm-svn: 115985
2010-10-07 21:52:18 +00:00
Fariborz Jahanian e0587be735 Fix a crash encoding ivars of vector types and
to match gcc's encoding. Fixes //rdar: // 8519948.

llvm-svn: 115980
2010-10-07 21:25:25 +00:00
Abramo Bagnara 5d3e724fc5 Fixed cast to union with anonymous bitfields.
llvm-svn: 115979
2010-10-07 21:20:44 +00:00
Fariborz Jahanian 4fc98f664b Start and end location of a property-dot syntax expression
must match start and end location of the expression
as expected by the rewriter client. Fixes // rdar: // 8520727

llvm-svn: 115934
2010-10-07 18:12:21 +00:00
Douglas Gregor c0f5dfc9d5 Don't force spell checking when code-completing. Let the client decide
llvm-svn: 115931
2010-10-07 18:03:24 +00:00
Daniel Dunbar 6036264fb4 Driver: When clang is built with a VENDOR set, include the base LLVM version in
the version information, to help prevent user confusion about vendor version
numbers vs. LLVM version numbers.

llvm-svn: 115915
2010-10-07 15:00:30 +00:00
Fariborz Jahanian c74073cd20 Patch for adding message to unavailable attribute.
And its documentation.
Finishes off // rdar: // 6734520.

llvm-svn: 115862
2010-10-06 23:12:32 +00:00
Tom Care ea53e82c78 UnreachableCodeChecker cleanup and improvements
- Fixed some iterator style issues
- Don't process blocks that have been visited already
- Fixed a case where a unreachable block cycle was not reported
- Minor test case changes
- Added one test case from flow-sensitive version of the check. More coming.

llvm-svn: 115861
2010-10-06 23:02:25 +00:00
Fariborz Jahanian 776653a70a Simplified code for deprecated attribute wih message a little.
llvm-svn: 115856
2010-10-06 22:20:08 +00:00
Fariborz Jahanian 55106310ae Add message to attribute(deprecated).
attribute(unavailable) to do next.
// rdar:// 6734520.

llvm-svn: 115842
2010-10-06 21:18:44 +00:00
Douglas Gregor a3d3ba1cac Fix a double-free error that can occur in rare cases where loading
of the precompiled preamble (or any PCH file it depends on) fails
during reparsing.

llvm-svn: 115838
2010-10-06 21:11:08 +00:00
Devang Patel 284fa417ec Mark FunctionNoProtoType's argument as unspecified parameters.
llvm-svn: 115834
2010-10-06 20:51:45 +00:00
John McCall 569eafce63 Re-enable EH cleanups to destroy __block variables, now that we have a moment to
deal with the consequences.  Fixes rdar://problem/8224178.

llvm-svn: 115816
2010-10-06 18:56:43 +00:00
Nick Lewycky 3005242401 Silence unused variable warning in Release builds.
llvm-svn: 115806
2010-10-06 18:37:39 +00:00
Devang Patel c0601d1e99 Do not emit subrange for incomplete array type.
This is tested by ptype.exp in gdb testsuite.

llvm-svn: 115805
2010-10-06 18:30:00 +00:00
Fariborz Jahanian 4801cc6315 Issue deprecated warning when typeof uses typedef
based on underlying type's deprecatedness.

llvm-svn: 115800
2010-10-06 17:00:02 +00:00
Douglas Gregor 3999e15d93 Reject the allocation of variably-modified types in C++ 'new'
expressions. Fixes PR8209 in the narrowest way possible. I'm still
considering whether I want to implement the extension that permits the
use of VLA types in a 'new' expression.

llvm-svn: 115790
2010-10-06 16:00:31 +00:00
Devang Patel 5b389f495b Remove unused argument.
llvm-svn: 115789
2010-10-06 15:58:57 +00:00
Nico Weber 9762e0a234 Add support for 4-byte UCNs like \U12345678. Warn about UCNs in c90 mode.
llvm-svn: 115743
2010-10-06 04:57:26 +00:00
Anders Carlsson 0f7e94fd7b When checking for uninitialized fields in member initializers, special case static variables and enums. Fixes PR8075.
llvm-svn: 115732
2010-10-06 02:43:25 +00:00
John McCall 2a981c2056 Teach the driver to pass -fexceptions in Objective-C inputs on ARM.
I don't know when this stopped happening, but this seems to be the
right place to do it.

llvm-svn: 115730
2010-10-06 01:40:51 +00:00
John McCall 2551c1bbcd Provide a slightly specialized diagnostic for tautological comparisons
of an enum value.

llvm-svn: 115725
2010-10-06 00:25:24 +00:00
John McCall f449926a01 Use a more conventional/efficient implementation for isEnumeralType()
and isBuiltinType().

llvm-svn: 115724
2010-10-06 00:23:35 +00:00
Fariborz Jahanian b292e32fd2 Ue TagType, added a FIXME. Per John's comment.
llvm-svn: 115723
2010-10-06 00:23:25 +00:00
Fariborz Jahanian 121f5148fd Issue deprecated warning when typeof uses an
expression of deprecated type.

llvm-svn: 115713
2010-10-05 23:24:00 +00:00
John McCall 09d1369964 When instantiating a new-expression, force a rebuild if there were default
arguments in either the placement or constructor arguments.  This is
important if the default arguments refer to a declaration or create a
temporary.

llvm-svn: 115700
2010-10-05 22:36:42 +00:00
Fariborz Jahanian c080a333ce Method declaration and its implementation must match in all their types.
Previously, compiler warned only if it was unsafe if types
did not match. Fixes // rdar: //7933061

llvm-svn: 115683
2010-10-05 21:02:11 +00:00
John McCall e5dd32da11 Teach PopCleanupBlock to correctly handle the possibility of branching through
a EH-only cleanup as part of a fallthrough branch-through.  That this happens
for this test case is actually a separate bug.

llvm-svn: 115668
2010-10-05 20:48:15 +00:00
Douglas Gregor 44e5c1f16c Serialize the "inline" bit for namespaces. Fixes <rdar://problem/8515069>.
llvm-svn: 115667
2010-10-05 20:41:58 +00:00
Douglas Gregor 9b3932c0bc Fix a marvelous chained AST writing bug, where we end up with the
following amusing sequence:
  - AST writing schedules writing a type X* that it had never seen
  before
  - AST writing starts writing another declaration, ends up
  deserializing X* from a prior AST file. Now we have two type IDs for
  the same type!
  - AST writer tries to write X*. It only has the lower-numbered ID
  from the the prior AST file, so references to the higher-numbered ID
  that was scheduled for writing go off into lalaland.

To fix this, keep the higher-numbered ID so we end up writing the type
twice. Since this issue occurs so rarely, and type records are
generally rather small, I deemed this better than the alternative: to
keep a separate mapping from the higher-numbered IDs to the
lower-numbered IDs, which we would end up having to check whenever we
want to deserialize any type.

Fixes <rdar://problem/8511624>, I think.

llvm-svn: 115647
2010-10-05 18:37:06 +00:00
Fariborz Jahanian fc8315f56a Fix a block rewriter bug where copy/dispose entries in
block descriptor for outer block was missing even though
the block was importing objects into its inner blocks.
//rdar://84995992

llvm-svn: 115644
2010-10-05 18:05:06 +00:00
Zhanyong Wan ea6d7f332d Fix handling of the 'Invalid' argument in SourceManager's methods (patch by Dean Sturtevant, reviewed by chandlerc and Sebastian Redl).
llvm-svn: 115638
2010-10-05 17:56:33 +00:00
Sebastian Redl 009e7f203f Give every file that ASTReader loads a type: module, PCH, precompiled preamble or main file. Base Decls' PCHLevel on this to make it more sane.
llvm-svn: 115626
2010-10-05 16:15:19 +00:00
Sebastian Redl 2c373b9876 Thread PerFileData through the ASTReader again, this time with the LLVM changes.
llvm-svn: 115625
2010-10-05 15:59:54 +00:00
Douglas Gregor 2c2c4cd9fd Register the __builtin_va_list_type node when we parse it, rather than
waiting until we think we need it: we didn't catch all of the places
where we actually needed it, and we probably wouldn't ever. Fixes a
C++ PCH crasher.

llvm-svn: 115621
2010-10-05 15:41:24 +00:00
Zhongxing Xu 614e17dddf * Simplify code
* Fix dump() to make it consistent with the test case.

llvm-svn: 115609
2010-10-05 08:38:06 +00:00
Marcin Swiderski 20b88739ed Added support for base and member destructors in destructor.
llvm-svn: 115592
2010-10-05 05:37:00 +00:00
Argyrios Kyrtzidis dfbdfbba8f In Sema's TryRefInitWithConversionFunction, suppress user conversions for the overload candidates.
Fixes an infinite recursion in overload resolution for rdar://8499524.
Many thanks to Doug!

llvm-svn: 115588
2010-10-05 03:05:30 +00:00
John McCall 0077b22aa4 If we're resolving all outstanding fixups, and there are multiple fixups
for the same destination, then we must potentially rewrite the initial branch
of every fixup.  Without this patch, a short-circuit check meant to prevent
a switch case from being redundantly added was preventing later fixups from
being processed.  Fixes PR8175 (again).

llvm-svn: 115586
2010-10-05 02:33:56 +00:00
John McCall 9916e3fa93 In the fragile ObjC ABI, save the caught exception to the side if there are
both @catches and a @finally, because the second call to @objc_exception_try_enter
will clobber the exception slot.  Fixes rdar://problem/8440970.

llvm-svn: 115575
2010-10-04 23:42:51 +00:00
Devang Patel 3703ff4163 dyn_cast is more appropriate here.
llvm-svn: 115569
2010-10-04 22:28:23 +00:00
Devang Patel 95eea45aa5 Add missing '}' :)
llvm-svn: 115568
2010-10-04 22:13:18 +00:00
Devang Patel 44b8bf0f5b Emit debug info for an aggregate while processing MemberExpr if the aggregate's debug info was delayed untill now.
llvm-svn: 115564
2010-10-04 21:46:04 +00:00
Devang Patel cbc7bc94c9 Fix filename in header comment.
llvm-svn: 115561
2010-10-04 21:15:33 +00:00
Douglas Gregor dc72caa6de When a type comes from a previously-loaded PCH/AST file, don't try to write it into a chained PCH file.
llvm-svn: 115527
2010-10-04 18:21:45 +00:00
Marcin Swiderski 87b1bb6fd2 Added support for C++ initializers in CFG.
llvm-svn: 115493
2010-10-04 03:38:22 +00:00
Douglas Gregor af25cfaae0 When providing a block literal as a code completion for a
function/method argument, include the parameter name and always
include parentheses (even for zero-parameter blocks). Otherwise, the
block literal placeholder '^' can look very weird.

llvm-svn: 115444
2010-10-02 23:49:58 +00:00
Chris Lattner 07704f1d7e the mmx intrinsic for pshufw should map to the IR intrinsic, not
to a shufflevector.  Otherwise it doesn't turn into a pshufw.
This bug was introduced in the mmx rewrite.

llvm-svn: 115423
2010-10-02 21:32:59 +00:00
Douglas Gregor 9109629e55 Implement chained PCH support for the macro definitions stored within
the "detailed" preprocessing record.

llvm-svn: 115417
2010-10-02 19:29:26 +00:00
Anders Carlsson fe15a78ff2 Use ParseObjCSelectorPiece for parsing getter and setter names in @property declarations. Fixes PR8169.
llvm-svn: 115411
2010-10-02 17:45:21 +00:00
Chris Lattner 64d7f2a014 when expanding a builtin, if the argument is required to be a constant,
force it to be a constant instead of emitting with EmitScalarExpr.  In
-ftrapv mode, they are not the same.

This fixes rdar://8478728 + PR8221

llvm-svn: 115388
2010-10-02 00:09:12 +00:00
Douglas Gregor 0eaa2bfe79 Don't add an imported function into its lexical context until *after*
we've set all of its parameters. Fixes <rdar://problem/8499598>;
thanks to Sean for the diagnosis.

llvm-svn: 115387
2010-10-01 23:55:07 +00:00
Chris Lattner 07e96866a2 tidy
llvm-svn: 115383
2010-10-01 23:43:16 +00:00
Chris Lattner 407e7e3ace kill off CheckX86BuiltinFunctionCall
llvm-svn: 115382
2010-10-01 23:40:43 +00:00
Chris Lattner 04b03b1fc4 move imperative code to declarative definitions.
llvm-svn: 115381
2010-10-01 23:35:58 +00:00
Devang Patel d18c5aa20a Mark explict methods as explict in debug info.
llvm-svn: 115379
2010-10-01 23:32:17 +00:00
Chris Lattner 3be167f606 diagnose errors when a builtin that require constant arguments don't have them.
For example, on:

#include <emmintrin.h>
int foo(int N) {
 __m128i white2;
 white2 = _mm_slli_si128(white2, N);
 return 0;
} 

we used to get:
fatal error: error in backend: Cannot yet select: intrinsic %llvm.x86.sse2.psll.dq

now we get:
/Users/sabre/t.c:4:11: error: argument to '__builtin_ia32_pslldqi128' must be a
      constant integer
 white2 = _mm_slli_si128(white2, N);
          ^~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /Users/sabre/t.c:1:
/Volumes/Projects/cvs/llvm/Debug+Asserts/lib/clang/2.9/include/emmintrin.h:781:13: note: instantiated from:
  ((__m128i)__builtin_ia32_pslldqi128((__m128i)(VEC), (IMM)*8))
            ^                                         ~~~~~~~
1 error generated.

llvm-svn: 115374
2010-10-01 23:23:24 +00:00
Chris Lattner bd6e69368f enhance ASTContext::GetBuiltinType to return a bitmask indicating which arguments
are required to be ICE's.  No clients of this new functionality yet!

llvm-svn: 115366
2010-10-01 22:53:11 +00:00
Chris Lattner dc226c2b9b random cleanups, no functionality change.
llvm-svn: 115361
2010-10-01 22:42:38 +00:00
Gabor Greif 16e028617c Factor out enumerator APSInt adjustment into
a helper function (AdjustAPSInt) and use that
for adjusting the high bounds of case ranges
before APSInt comparisons. Fixes
http://llvm.org/bugs/show_bug.cgi?id=8135

Some minor refacorings while I am here.

llvm-svn: 115355
2010-10-01 22:05:14 +00:00
Francois Pichet 6d76e6cd92 Better diagnostic for superfluous scope specifier inside a class definition for member functions. + Fixit.
Example: 
class A {
   void A::foo(); //warning: extra qualification on member 'foo'
};

llvm-svn: 115347
2010-10-01 21:19:28 +00:00
Tom Care 7359459636 UnreachableCodeChecker does not need to inherit from CheckerVisitor, only Checker. It does not use any AST Stmt hooks, only VisitEndAnalysis.
llvm-svn: 115345
2010-10-01 20:52:07 +00:00
Douglas Gregor 36ea4d4f45 Revert r115336 ("Thread PerFileData through everything."), because
we're missing the corresponding changes in the LLVM repository.

llvm-svn: 115340
2010-10-01 20:33:34 +00:00
Sebastian Redl 7b1b2268e2 Thread PerFileData through everything. This allows us to remap stuff later.
llvm-svn: 115336
2010-10-01 19:59:15 +00:00
Sebastian Redl 3f6b753f9d Record module loaders and module source order.
llvm-svn: 115334
2010-10-01 19:59:12 +00:00
Douglas Gregor 7fb25418ed Implement the C++0x "trailing return type" feature, e.g.,
auto f(int) -> int

from Daniel Wallin!

(With a few minor bug fixes from me).

llvm-svn: 115322
2010-10-01 18:44:50 +00:00
Chris Lattner 8473339100 Various builtins a require an integer constant. Not providing
one results in an obscure error from the backend that doesn't make
sense.  Capture this information in the .def files for builtins with
a new "I" modifier letter indicating the an argument needs to be an ICE.

Nothing uses this yet, but sema will eventually enforce this (eliminating
some special cases from semachecking.cpp) and codegen will use this to 
force an ICE value, preventing backend error messages.

llvm-svn: 115302
2010-10-01 07:13:18 +00:00
Chris Lattner 1750cb037d __builtin_ia32_psrldqi128 too
llvm-svn: 115301
2010-10-01 06:58:49 +00:00
Chris Lattner 81f347fe6d the second argument to __builtin_ia32_pslldqi128 must be an immediate,
so it needs to be called from a macro, not a function.  This is a necessary
but insufficient step towards fixing PR8221

llvm-svn: 115299
2010-10-01 06:52:23 +00:00
Zhongxing Xu b06a2cdd2b Now the whether adding implicit dtors is controlled by cmd option.
llvm-svn: 115275
2010-10-01 03:31:06 +00:00
Zhongxing Xu 6d372f7c0f The return value is never used.
llvm-svn: 115272
2010-10-01 03:22:39 +00:00
Zhongxing Xu 307701e1b4 Use default augument.
llvm-svn: 115271
2010-10-01 03:09:09 +00:00
Zhongxing Xu 81714f2196 Simplify interface for addLocalScopeForStmt().
llvm-svn: 115270
2010-10-01 03:00:16 +00:00
Zhongxing Xu ea360a3b1a The old logic would add non-struct and non C++ struct variables to the local
scope. Now we only add C++ struct with non-trivial destructor variables to the
local scope.

llvm-svn: 115269
2010-10-01 02:47:11 +00:00
Marcin Swiderski 3546b1aea1 Added generating CFGAutomaticObjDtors for exception variable in catch statement.
llvm-svn: 115266
2010-10-01 01:46:52 +00:00
Marcin Swiderski 6d5ee0c7f9 Added generating CFGAutomaticObjDtors for init statement, condition variable and implicit scope in for statement.
llvm-svn: 115265
2010-10-01 01:38:14 +00:00
Marcin Swiderski e407a3ba1e dded generating CFGAutomaticObjDtors for condition variable and implicit scopes in switch statement.
llvm-svn: 115264
2010-10-01 01:24:41 +00:00
Douglas Gregor aa43301842 If we get a TU_CONTEXT update from a chained PCH file before we
actually have an ASTContext, delay the processing of that
update. Patch by Sebastian Redl! Fixes <rdar://problem/8499034>.

llvm-svn: 115263
2010-10-01 01:18:02 +00:00
Marcin Swiderski 1f4e15c56f Added generating CFGAutomaticObjDtors for condition variable and implicit scopes in while and do statements.
llvm-svn: 115262
2010-10-01 01:14:17 +00:00
Douglas Gregor 9e136b544d Enable chained precompiled headers for use with precompiled preambles
llvm-svn: 115260
2010-10-01 01:05:22 +00:00
Douglas Gregor eb114da506 When an identifier that has a macro definition in the original PCH
file is somehow changed in a chained PCH file, make sure that we write
out the macro definition. Fixes part of <rdar://problem/8499034>.

llvm-svn: 115259
2010-10-01 01:03:07 +00:00
Marcin Swiderski f883ade880 Added generating CFGAutomaticObjDtors for condition variable and implicit scopes in if statement.
llvm-svn: 115256
2010-10-01 00:52:17 +00:00
Marcin Swiderski e84cb97997 Fixed checking for trivial destructor in CFGBuilder::addLocalScopeForVarDecl. Checked type does not have to represent C++ class.
llvm-svn: 115254
2010-10-01 00:31:22 +00:00
Marcin Swiderski 667ffecd9e Added:
- Adding LocalScope for CompoundStmt,
- Adding CFGAutomaticObjDtors for end of scope, return, goto, break, continue,
- Regression tests for above cases.

llvm-svn: 115252
2010-10-01 00:23:17 +00:00
Fariborz Jahanian 885e9dff93 Output debug info. for ivars declared in class
extension and implementation.
Fixes rdar://8493239.

llvm-svn: 115248
2010-10-01 00:01:53 +00:00
Dale Johannesen 39d6f4b95c Clang part of MMX rewrite (goes with 115243).
llvm-svn: 115244
2010-09-30 23:57:50 +00:00
Marcin Swiderski 5e41573d26 Added methods for adding LocalScopes and CFGAutomaticObjDtors.
llvm-svn: 115237
2010-09-30 23:05:00 +00:00
Marcin Swiderski 321a707c9c Added methods for inserting CFGAutomaticObjDtors to CFGBlocks,
Fixed some misspells in comments.

llvm-svn: 115236
2010-09-30 22:54:37 +00:00
Marcin Swiderski e9862ce90a Added:
- post-increament, distance and bool conversion methods to LocalScope::const_iterator,
- adding VarDecl to LocalScope.

Fixed some misspells in comments.

llvm-svn: 115227
2010-09-30 22:42:32 +00:00
Fariborz Jahanian 7bf13c49c7 Rewriting array element type of qualified-id.
Fixes rdra://8475819.

llvm-svn: 115201
2010-09-30 20:41:32 +00:00
Devang Patel 91bbb5547d Introduce -flimit-debug-info.
In this experimental mode try avoiding debug info emission for classes as much as possible. The goal is to reduce size of produced debuginfo without reducing quality of debug info in general. This is a work in progress.

llvm-svn: 115188
2010-09-30 19:05:55 +00:00
Argyrios Kyrtzidis 58c65410ac Support implicit includes when generating a PCH and allow the user to pass a -include on the command line following the PCH include.
Fixes rdar://7382084.

llvm-svn: 115159
2010-09-30 16:53:50 +00:00
Argyrios Kyrtzidis 2f23b414e9 Driver: Ignore the found PCH file if its '-include' is not the first one.
llvm-svn: 115158
2010-09-30 16:53:47 +00:00
Marcin Swiderski 99a9040a1f Added two new command line arguments:
-cfg-add-implicit-dtors - sets CFG::BuildOptions::AddImplicitDtors for AnalysisCosumer to true,
-cfg-add-initializers - sets CFG::BuildOptions::AddInitializers for AnalysisCosumer to true.

llvm-svn: 115142
2010-09-30 07:41:24 +00:00
Ted Kremenek b0e7d77729 Include changes to VisitCXXMemberCallExpr (call visitor functions).
llvm-svn: 115120
2010-09-30 01:06:29 +00:00
Sebastian Redl 99219f16b9 Make the FileID import map key on FileID.
llvm-svn: 115118
2010-09-30 01:03:06 +00:00
Sebastian Redl 517523014d In MeasureTokenLength, the FileLoc supplied to the lexer must point to the start of the buffer, or we risk overflow.
llvm-svn: 115117
2010-09-30 01:03:03 +00:00
Ted Kremenek 3d6c0c0091 Tweak nil receiver checker to not warning about 64-bit return values.
Fixes: <rdar://problem/7513117>
llvm-svn: 115113
2010-09-30 00:37:10 +00:00
Tom Care 2f0419e1f8 AnalyzerStatsChecker improvements:
- Use BlockEntrance rather than BlockEdge to bring in line with UnreachableCodeChecker. Fixes an issue where unreached blocks would still be counted as reachable.
- Added warnings for all BlockAborted locations. This allows us to see where the analyzer stopped analyzing.

llvm-svn: 115110
2010-09-29 23:48:34 +00:00
Tom Care 472205be35 Change -analyzer-max-nodes to allow 0 as a parameter. This allows the analyzer to completely analyze a worklist regardless of time taken.
llvm-svn: 115108
2010-09-29 23:48:13 +00:00
Devang Patel 7c086227e6 Attach aritifical attribute with implicit parameters.
Radar 8493141.

llvm-svn: 115104
2010-09-29 23:09:21 +00:00
Devang Patel 330b65e350 Emit method access specifier.
Radar 8490416.

llvm-svn: 115090
2010-09-29 21:46:16 +00:00
Douglas Gregor 4ed49f375d When performing template argument deduction of a function template
against a function type, be sure to check the type of the resulting
function template specialization against the desired function type
after substituting the deduced/defaulted template arguments. Fixes PR8196.

llvm-svn: 115086
2010-09-29 21:14:36 +00:00
Devang Patel db2732ac42 Update to reflect DIFactory::CreateSubprogram() interface change from r115084.
llvm-svn: 115085
2010-09-29 21:05:52 +00:00
Devang Patel 984cdeef37 Remove dead code.
llvm-svn: 115079
2010-09-29 20:05:01 +00:00
Daniel Dunbar 181ca58074 Basic: Simplify getClangRepositoryPath and getClangRevision.
- I don't like returning StringRef's ever, unless it is actually important for
   performance, which it isn't here.

 - Also, stop validating getClangRevision to be an integer, I don't see a good
   reason to do this.

llvm-svn: 115071
2010-09-29 19:15:29 +00:00
Daniel Dunbar 8caf6415a8 Add support for attribute((naked)), patch by Zoxc on cfe-commits!
- Minor style tweaks by me.

llvm-svn: 115056
2010-09-29 18:20:25 +00:00
Douglas Gregor ac2e43082a Fix handling of dependent nested namespace specifiers in UsingDecls
during template instantiation, from Martin Vejnar!

llvm-svn: 115051
2010-09-29 17:58:28 +00:00
Daniel Dunbar b800fdb063 Basic: Add support for git svn to get the repo version in clang executable,
patch by Jonathan Mulder!

llvm-svn: 115049
2010-09-29 17:57:10 +00:00
Daniel Dunbar 37614d875f Frontend/XML: Add support for printing nested structures, patch by Martin Vejnár!
llvm-svn: 115041
2010-09-29 16:09:28 +00:00
Douglas Gregor 1f7d02fb6d Define _Bool, bool, true, and false macros in <stdbool.h> when we're
in a GNU-compatible C++ dialect. Fixes <rdar://problem/8477819>.

llvm-svn: 115028
2010-09-29 04:57:11 +00:00
Douglas Gregor 457104e98b Move the management of the set of conversion functions in a C++ class
into CXXRecordDecl. The only part that we do not handle this way are
using declarations, since that would require extra name lookup that we
don't currently want to pay for. This fixes <rdar://problem/8459981>,
so that LLDB can build a CXXRecordDecl and magically get all of the
right bits set.

llvm-svn: 115026
2010-09-29 04:25:11 +00:00
Douglas Gregor 8fb9512966 Move the maintenance of CXXRecordDecl::DefinitionData's Abstract bit
completely into CXXRecordDecl, by adding a new completeDefinition()
function. This required a little reshuffling of the final-overrider
checking code, since the "abstract" calculation in the presence of
abstract base classes needs to occur in
CXXRecordDecl::completeDefinition() but we don't want to compute final
overriders more than one in the common case.

llvm-svn: 115007
2010-09-29 00:15:42 +00:00
Chris Lattner d7821e4ec4 enhance tentative parsing to handle ms extensions, patch by Martin Vejnar!
llvm-svn: 115004
2010-09-28 23:35:09 +00:00
Douglas Gregor 7d9120c3ed Teach FunctionDecl::setPure() to (indirectly) mark the Abstract bit in
CXXRecordDecl::DefinitionData, rather than having Sema mark the bit.

llvm-svn: 114993
2010-09-28 21:55:22 +00:00
Douglas Gregor 11c024bbeb Reinstate r114925 and r114929, both steps toward
<rdar://problem/8459981>.

llvm-svn: 114984
2010-09-28 20:50:54 +00:00
Fariborz Jahanian 1db5c941ad vla expressions used in __typeof__ must be evaluated.
Fixes rdar://8476159.

llvm-svn: 114982
2010-09-28 20:42:35 +00:00
Douglas Gregor 9d5938ae8a Centralize the management of CXXRecordDecl::DefinitionData's Empty bit
in CXXRecordDecl itself. Yes, this is also part of <rdar://problem/8459981>.

This reinstates r114924, with one crucial bug fix: we were ignoring
the implicit fields created by anonymous structs/unions when updating
the bits in CXXRecordDecl, which means that a class/struct containing
only an anonymous class/struct would be considered "empty". Hilarity
follows. 

llvm-svn: 114980
2010-09-28 20:38:10 +00:00
Sebastian Redl c1ca90a246 Move ExternalSemaSource::ReadMethodPool's implementation to Sema.cpp so that the header can get away with forward declarations only for ObjCMethodList and Selector. Fixes <rdar://8467631>.
llvm-svn: 114978
2010-09-28 20:23:00 +00:00
Douglas Gregor a832d3e2cc Reinstate r114921, which I've exonerated via a self-host build.
Centralize the management of CXXRecordDecl::DefinitionData's Aggregate
and PlainOldData bits in CXXRecordDecl itself. Another milepost on the
road toward <rdar://problem/8459981>.

llvm-svn: 114977
2010-09-28 19:45:33 +00:00
Douglas Gregor 1ba435f0f9 When we have two identifiers in a row in Objective-C, make sure to
verify that we aren't in a message-send expression before digging into
the identifier or looking ahead more tokens. Fixes a regression
(<rdar://problem/8483253>) I introduced with bracket insertion.

llvm-svn: 114968
2010-09-28 17:48:56 +00:00
Argyrios Kyrtzidis d6ea6bd2a3 Don't warn with -Wbool-conversions if the user wrote an explicit cast like "(void *)false".
Fixes rdar://8459342.

llvm-svn: 114955
2010-09-28 14:54:11 +00:00
Argyrios Kyrtzidis 9f48354b71 Don't warn for an unused label if it has 'unused' attribute. Fixes rdar://8483139.
llvm-svn: 114954
2010-09-28 14:54:07 +00:00
Sebastian Redl 4102dd5eb5 Fix a bug in loading macro records. Fixes yet another crash in libclang.
llvm-svn: 114940
2010-09-28 02:55:49 +00:00
Sebastian Redl da6a21cdd2 Fix a use of an invalidated reference due to a hash map reallocating.
llvm-svn: 114937
2010-09-28 02:24:44 +00:00
Bill Wendling 11191f11b8 Accidentally committed some temporary changes on my branch when reverting patches.
llvm-svn: 114936
2010-09-28 01:28:56 +00:00
Bill Wendling 6d8c442e08 Temporarily revert 114929 114925 114924 114921. It looked like they (or at least
one of them) was causing a series of failures:

http://google1.osuosl.org:8011/builders/clang-x86_64-darwin10-selfhost/builds/4518

svn merge -c -114929 https://llvm.org/svn/llvm-project/cfe/trunk
--- Reverse-merging r114929 into '.':
U    include/clang/Sema/Sema.h
U    include/clang/AST/DeclCXX.h
U    lib/Sema/SemaDeclCXX.cpp
U    lib/Sema/SemaTemplateInstantiateDecl.cpp
U    lib/Sema/SemaDecl.cpp
U    lib/Sema/SemaTemplateInstantiate.cpp
U    lib/AST/DeclCXX.cpp
svn merge -c -114925 https://llvm.org/svn/llvm-project/cfe/trunk
--- Reverse-merging r114925 into '.':
G    include/clang/AST/DeclCXX.h
G    lib/Sema/SemaDeclCXX.cpp
G    lib/AST/DeclCXX.cpp
svn merge -c -114924 https://llvm.org/svn/llvm-project/cfe/trunk
--- Reverse-merging r114924 into '.':
G    include/clang/AST/DeclCXX.h
G    lib/Sema/SemaDeclCXX.cpp
G    lib/Sema/SemaDecl.cpp
G    lib/AST/DeclCXX.cpp
U    lib/AST/ASTContext.cpp
svn merge -c -114921 https://llvm.org/svn/llvm-project/cfe/trunk
--- Reverse-merging r114921 into '.':
G    include/clang/AST/DeclCXX.h
G    lib/Sema/SemaDeclCXX.cpp
G    lib/Sema/SemaDecl.cpp
G    lib/AST/DeclCXX.cpp

llvm-svn: 114933
2010-09-28 01:09:49 +00:00
Douglas Gregor 1f93ffb3e6 Centralize the management of CXXRecordDecl::DefinitionData's
HasTrivialConstructor, HasTrivialCopyConstructor,
HasTrivialCopyAssignment, and HasTrivialDestructor bits in
CXXRecordDecl's methods. This completes all but the Abstract bit and
the set of conversion functions, both of which will require a bit of
extra work. The majority of <rdar://problem/8459981> is now
implemented (but not all of it).

llvm-svn: 114929
2010-09-28 00:00:00 +00:00
Douglas Gregor d22553cf21 Centralize the management of CXXRecordDecl::DefinitionData's
Polymorphic bit in CXXRecordDecl itself. Yes, this is also part of
<rdar://problem/8459981>.

llvm-svn: 114925
2010-09-27 23:39:06 +00:00
Douglas Gregor 01daafc58a Centralize the management of CXXRecordDecl::DefinitionData's Empty bit
in CXXRecordDecl itself. Yes, this is also part of <rdar://problem/8459981>.

llvm-svn: 114924
2010-09-27 23:31:14 +00:00
Sebastian Redl 7abd8d58c2 My previous fix was incorrect for non-chained PCH reuse. Fix again.
llvm-svn: 114922
2010-09-27 23:20:01 +00:00
Douglas Gregor 1be93f5143 Centralize the management of CXXRecordDecl::DefinitionData's Aggregate
and PlainOldData bits in CXXRecordDecl itself. Another milepost on the
road toward <rdar://problem/8459981>.

llvm-svn: 114921
2010-09-27 23:16:44 +00:00
Douglas Gregor 8f9ebe54b3 Centralize the handling of CXXRecordDecl::DefinitionData's
DeclaredDestructor and UserDeclaredDestructor bits in CXXRecordDecl
itself. Another step on the road to <rdar://problem/8459981>.

llvm-svn: 114918
2010-09-27 22:48:58 +00:00
Fariborz Jahanian 3567c426c4 Patch to support transparent_union arguments
passed to nonnull attributed functions. Implements radar
6857843.

llvm-svn: 114917
2010-09-27 22:42:37 +00:00
Douglas Gregor ec3bec0c7a Kill FunctionDecl's IsCopyAssignment bit; it duplicated what could
already be determined by isCopyAssignmentOperator(), and was set too
late in the process for all clients to see the appropriate
value. Cleanup only; no functionality change.

llvm-svn: 114916
2010-09-27 22:37:28 +00:00
Sebastian Redl 9609b4f1a8 When chaining PCHs, only write PPRecords that don't come from PCH, and give them the correct IDs. Fixes a crash in XCode.
llvm-svn: 114913
2010-09-27 22:18:47 +00:00
Douglas Gregor a1ce1f80cf Centralize the handling of
CXXRecordDecl::DefinitionData::DeclaredCopyAssignment, for
copy-assignment operators. Another step toward <rdar://problem/8459981>.

llvm-svn: 114899
2010-09-27 22:06:20 +00:00
Bill Wendling 1308667f18 Revert my patch changing the MMX "shift" intrinsics that take immediates into
"shift with non-immediate" intrinsics. It gets here because we they aren't
immediates anymore.

llvm-svn: 114890
2010-09-27 21:22:25 +00:00
Douglas Gregor d30e79f839 Clean up the handling of the DeclaredDefaultConstructor and
DeclaredCopyConstructor bits in CXXRecordDecl's DefinitionData
structure. Rather than having Sema call addedConstructor or set the
bits directly at semi-random places, move all of the logic for
managing these bits into CXXRecordDecl itself and tie the
addedConstructor call into DeclContext::addDecl().

This makes it easier for AST-building clients to get the right bits
set in DefinitionData, and is one small part of <rdar://problem/8459981>.

llvm-svn: 114889
2010-09-27 21:17:54 +00:00
Nico Weber d75488d010 Correctly set "explicit template instantiation" kind on inner structs of templates whose explicit instantiation is first declared and then defined.
Fixes http://llvm.org/pr8207

llvm-svn: 114874
2010-09-27 21:02:09 +00:00
Fariborz Jahanian cb67d7b7c2 Issue warning for trivial cases of nonnull attributes
(on functions with no pointer arguments) but only when
the attribute has not been coming from a macro 
instantiation in a header file. Fixes first part
of radar 6857843.

llvm-svn: 114860
2010-09-27 19:05:51 +00:00
Fariborz Jahanian 30e8d58dbd Copying result of object property reference expression
into a temporary is elidable as well.
(Finishes up radar 8291337).

llvm-svn: 114845
2010-09-27 17:30:38 +00:00
Douglas Gregor a6f74e276d Remove libclang logging code
llvm-svn: 114836
2010-09-27 16:43:25 +00:00
Abramo Bagnara b59a5b6784 Fixed isConstantInitializer for __builtin_choose_expr.
llvm-svn: 114820
2010-09-27 07:13:32 +00:00
Michael J. Spencer 4362a1c987 Fix coding standard mistake from my last commit.
That, and keep aKor happy :P.

llvm-svn: 114816
2010-09-27 06:34:47 +00:00
Michael J. Spencer a0a820fadb Lexer: Implement GCC's version of pragma message.
llvm-svn: 114814
2010-09-27 06:19:02 +00:00
Daniel Dunbar f247675c55 Driver/Linux: Translate rewritten lib options back to standard -l form when
using generic GCC tools.

llvm-svn: 114793
2010-09-25 18:10:05 +00:00
Marcin Swiderski 8b99b8a782 In preparation for adding generation of destructors for objects with automatic storage added:
- LocalScope class with iterator used to pointing into it,
- fat doxygen comment for LocalScope indended usage,
- BlockScopePosPair class used for storing jump targets/sources (for: goto, break, continue), that replaces raw CFGBlock pointer used earlier for this purpose.

llvm-svn: 114790
2010-09-25 11:05:21 +00:00
Fariborz Jahanian c60da031c5 Fix a NYI in IRGen which was due to incorrect AST
for property reference expression (of c++ object type)
in the conditional expression. Fixes // rdar://8291337

llvm-svn: 114783
2010-09-25 01:08:05 +00:00
Douglas Gregor 2fb99df2c3 When setting the globally-visible declarations for a particular
identifier, we may have a Sema object but no translation unit scope
(because parsing is finished). In this case, we still need to update
the IdResolver, which might still be used when writing a PCH
containing another PCH (without chaining). This bug manifested as a
failure with precompiled preambles.

Also, add a little environment-variable-sensitive logging for
libclang.

llvm-svn: 114774
2010-09-24 23:29:12 +00:00
Anders Carlsson 991285e425 Allow the use of C++0x deleted functions as an extension in C++98.
llvm-svn: 114762
2010-09-24 21:25:25 +00:00
Douglas Gregor 2c84482abd Teach libclang to enable multithreading in LLVM, since libclang clients are likely to be multithreaded. Also move the printing of timers to somewhere better for multithreaded libclang clients
llvm-svn: 114760
2010-09-24 21:18:36 +00:00
Daniel Dunbar 4ed214a191 Driver: Add -fallow-unsupported which disables some of the eager error'ing we do
to prevent users from trying unsupported stuff. Useful for testing.

llvm-svn: 114749
2010-09-24 19:39:37 +00:00
Fariborz Jahanian aa0f2b3016 Fix rewriting of property declared in @protocol's.
Fixed //rdar://8472487.

llvm-svn: 114741
2010-09-24 18:36:58 +00:00
Fariborz Jahanian 8fb87aec78 Patch implements passing arrays to functions expecting
vla. Implements pr7827.

llvm-svn: 114737
2010-09-24 17:30:16 +00:00
Ted Kremenek 74a9f98522 Default synthesized ivars don't really have a location in the source. Using the location of the @implementation
is just confusing for clients that want to use SourceLocations for syntactic references.

Fixes: <rdar://problem/8470540>
llvm-svn: 114714
2010-09-24 01:23:01 +00:00
Nick Lewycky 6e1ce29b01 Revert r114712 due to failure on darwin buildbot.
llvm-svn: 114713
2010-09-24 00:46:53 +00:00
Nick Lewycky e351fed104 Make -M/-MM behave like in gcc; use -MF first then -o else use stdout.
llvm-svn: 114712
2010-09-23 23:49:25 +00:00
Nick Lewycky e47c245b90 Fix header comment so we don't break emacs.
llvm-svn: 114711
2010-09-23 23:48:20 +00:00
Douglas Gregor 0ac41389a4 Synchronize globally-cached code completion results with the results
provided when the optimization is disabled. In particular, split
the completion context CCC_Other into two contexts: CCC_Other, which
means that it's an undisclosed context for which any other results are
unwelcome, and CCC_Recovery, which is used in recovery cases.

Since we're now using the completion context within the completion
results builder, make sure that it's always set to something.

Fixes <rdar://problem/8470644>.

llvm-svn: 114704
2010-09-23 23:01:17 +00:00
Ted Kremenek 6274be47fa When warning about comparing an unsigned int to being >= 0, don't issue a warning if the zero value was an
enum or was expanded from a macro.

Fixes: <rdar://problem/8414119>
llvm-svn: 114695
2010-09-23 21:43:44 +00:00
Ted Kremenek cba5849c0b For properties declared in a @protocol and redeclared in a class extension, use the class extension
as the lexical DeclContext for the @property declaration that gets auto-created for the @interface.

Fixes: <rdar://problem/8467189>
llvm-svn: 114693
2010-09-23 21:18:05 +00:00
Argyrios Kyrtzidis e619e99a1b Fix bogus compiler errors when declaring anonymous union, outside a class, with
members with the same name as a decl outside the scope where the members are actually introduced.
Fixes http://llvm.org/PR6741

llvm-svn: 114641
2010-09-23 14:26:01 +00:00
Argyrios Kyrtzidis 4f92016ed3 If -fcolor-diagnostics is explicitly passed to the driver respect that even if the driver is of the opinion that
stderr can't handle them. (see http://llvm.org/PR8150)
Patch by Frits van Bommel!

llvm-svn: 114638
2010-09-23 12:56:06 +00:00
Argyrios Kyrtzidis 719a46bbf1 Don't crash on _Imaginary.
llvm-svn: 114637
2010-09-23 09:40:31 +00:00
Ted Kremenek fd5856adcb Refactor GRExprEngine::VisitCall() to use EvalArguments(), just like VisitCXXMemberCallExpr(). Ideally we should unify these code paths as much as possible, since they only differ by a few details.
llvm-svn: 114628
2010-09-23 05:14:51 +00:00
Daniel Dunbar 19964dbe3b IRgen/ABI/ARM: Return large vectors in memory.
llvm-svn: 114619
2010-09-23 01:54:32 +00:00
Daniel Dunbar b34b08098c IRgen/ABI/ARM: Trust the backend to pass vectors correctly for the given ABI.
- Therefore, we can lower out the NEON wrapper structs and pass the vectors
   directly. This makes a huge difference in the cleanliness of the IR after
   optimization.
 - I will trust, but verify, via future ABITest testing (for APCS-GNU, at
   least).

llvm-svn: 114618
2010-09-23 01:54:28 +00:00
Tom Care 14fefab721 Fix an inverse boolean and unnecessary new line in warning output from AnalyzerStatsChecker.
llvm-svn: 114581
2010-09-22 21:07:51 +00:00
Sebastian Redl c1d035f6a3 Change source manager serialization to be less tied to the PCH model.
llvm-svn: 114575
2010-09-22 20:19:08 +00:00
Douglas Gregor a1ed39be76 Fix a hard-to-reproduce crash-on-invalid, where we weren't checking for a valid result from ActOnIdExpression
llvm-svn: 114548
2010-09-22 16:33:13 +00:00
Argyrios Kyrtzidis ca0d0cd3b9 Implement -Wpadded and -Wpacked.
-Wpadded warns when undesired padding is introduced in a struct. (rdar://7469556)
-Wpacked warns if a struct is given the packed attribute, but the packed attribute has no effect
  on the layout or the size of the struct. Such structs may be mis-aligned for little benefit.

The warnings are emitted at the point where layout is calculated, that is at RecordLayoutBuilder.
To avoid calculating the layouts of all structs regardless of whether they are needed or not,
I let the layouts be lazily constructed when needed. This has the disadvantage that the above warnings
will be emitted only when they are used for IR gen, and not e.g with -fsyntax-only:

$ cat t.c
struct S {
  char c;
  int i;
};
void f(struct S* s) {}

$ clang -fsyntax-only -Wpadded t.c
$ clang -c -Wpadded t.c -o t.o
t.c:3:7: warning: padding struct 'struct S' with 3 bytes to align 'i' [-Wpadded]
  int i;
      ^
1 warning generated.

This is a good tradeoff between providing the warnings and not calculating layouts for all
structs in case the user has enabled a couple of rarely used warnings.

llvm-svn: 114544
2010-09-22 14:32:24 +00:00
Sebastian Redl 96371b446e Only preload SLocEntries after the entire PCH chain was loaded.
llvm-svn: 114518
2010-09-22 00:42:30 +00:00
Sebastian Redl 949fe9e03b Reshuffle PerFileData's members to make more sense.
llvm-svn: 114517
2010-09-22 00:42:27 +00:00
Daniel Dunbar da4f6b5151 Driver/Darwin: Add a runtime library just for ___eprintf -- when targeting i386
some projects still depend on ___eprintf being available.

llvm-svn: 114509
2010-09-22 00:03:52 +00:00
Chris Lattner b2f659b7a0 fix the rest of rdar://8461279 - clang miscompiles address-space qualified atomics
llvm-svn: 114503
2010-09-21 23:40:48 +00:00
Chris Lattner c9066d3072 same bug as before, this time with __sync_val_compare_and_swap.
llvm-svn: 114502
2010-09-21 23:35:30 +00:00
Chris Lattner 7cf46bfda0 fix __sync_bool_compare_and_swap to work with address-space qualified types.
llvm-svn: 114498
2010-09-21 23:24:52 +00:00
Fariborz Jahanian 521c72c756 Fixes an IRgen ICE due to cast of null pointer to
a vla type (fixes pr7827).

llvm-svn: 114495
2010-09-21 22:53:33 +00:00
John Thompson c467aa2fa4 Fixed pr20314-2.c failure, added E, F, p constraint letters.
llvm-svn: 114490
2010-09-21 22:04:54 +00:00
Ted Kremenek 2f07563f47 Correctly register the class extension as the lexical DeclContext for ObjC methods declared with @property in class extensions.
This matches the behavior for setters.

Also pass the class extension to ProcessPropertyDecl as the lexical DeclContext, even when not redeclaring the @property.

This fixes the remaining issues in <rdar://problem/7410145>.

llvm-svn: 114477
2010-09-21 20:52:59 +00:00
Fariborz Jahanian cb75021034 IRgen for gnu extension's conditional lvalue expression
with missing LHS. radar 8453812. Executable test is checked 
into llvm test suite.

llvm-svn: 114457
2010-09-21 18:32:21 +00:00
Ted Kremenek e3a7d1ba40 For ObjCPropertyDecls in class extensions, use the class extension as the lexical DeclContext for newly created
ObjCMethodDecls.  Further, use the location of the new property declaration as the location of new ObjCMethodDecls
(if they didn't previously exist).

This fixes more of the issues reported in <rdar://problem/7410145>.

llvm-svn: 114456
2010-09-21 18:28:43 +00:00
Douglas Gregor 0212fd7169 Add code completion for C++ constructors wherever we see the class (or
class template) and are in a context where we can have a value.

llvm-svn: 114441
2010-09-21 16:06:22 +00:00
Benjamin Kramer 3e0c527dcc Adjust for debug info API change.
llvm-svn: 114438
2010-09-21 15:59:59 +00:00
Argyrios Kyrtzidis 03f0e2b5b4 Do not warn with -Wuninitialized when the member is used in a sizeof or address-of expression.
Fixes rdar://8331312.

llvm-svn: 114426
2010-09-21 10:47:20 +00:00
Marcin Swiderski c0ca7316bc Added:
- definitions of interfaces for CFGInitializer and CFGAutomaticObjDtor,
- support for above classes to print_elem function (renamed print_stmt),
- support for VarDecls in StmtPrinterHelper.

llvm-svn: 114403
2010-09-21 05:58:15 +00:00
Douglas Gregor 7466127a4b When providing code completions for an argument in an Objective-C
message send, e.g.,

  [[NSString alloc] initWithCString:<CC>

look up all of the possible methods and determine the preferred type
for the argument expression based on the type of the corresponding
parameter.

llvm-svn: 114379
2010-09-21 00:03:25 +00:00
Fariborz Jahanian 8162d4ad31 Implements in IRgen gnu extensions missing LHS for
complex conditionals. Radar 8453812.

llvm-svn: 114376
2010-09-20 23:50:22 +00:00
Douglas Gregor f86e4da7ae Refactor code completion for expressions that occur as arguments in
Objective-C message sends. There is no functionality change here; this
is prep work for using the parameter types to help guide the
expression results when code-completing the argument.

llvm-svn: 114375
2010-09-20 23:34:21 +00:00
Douglas Gregor 5fb901deee Code completion has no reason to prefer values over types, especially
at the statement level or in Objective-C message receivers. Therefore,
just give types and declarations the same basic priority, and adjust
from there.

llvm-svn: 114374
2010-09-20 23:11:55 +00:00
Nate Begeman abb5a7370d Check in support for OpenCL conditional operator on vector types.
llvm-svn: 114371
2010-09-20 22:41:17 +00:00
Douglas Gregor 50832e0215 Slight refactoring in code-completion results generation, placing the
various priority adjustments for preferences (based on selectors,
types) in a single function to make extension easier.

llvm-svn: 114370
2010-09-20 22:39:41 +00:00
Douglas Gregor db5c09a8cd Get rid of the lame attempt to prioritize "void" functions at
statement context; it really isn't helpful in practice (remember
printf!) and we'll be doing other adjustments for statements very soon.

llvm-svn: 114358
2010-09-20 21:25:19 +00:00
Douglas Gregor 9dcf58a546 Tweak priorities for some types and macros:
- In Objective-C, we prefer BOOL to bool for historic reasons;
  slightly penalize "bool".
  - Treat Nil macro as a NULL pointer constant.
  - Treat YES, NO, true, and false macros as constants.
  - Treat the bool macro as a type.

llvm-svn: 114356
2010-09-20 21:11:48 +00:00
Douglas Gregor 8f78579f9d Fix CMake clangIndex library dependencies, from Logan Chien
llvm-svn: 114336
2010-09-20 18:32:29 +00:00
Daniel Dunbar c1dd0e97f3 Driver/Objective-C: Retool Objective-C ABI flags to be more usable, and actually
document behavior. Will wonders never cease.

llvm-svn: 114334
2010-09-20 18:19:55 +00:00
Douglas Gregor db8c6fd18f Check that an overloaded function name, when used by the ! operator,
actually resolves to a particular function. Fixes PR8181, from Faisal
Vali!

llvm-svn: 114331
2010-09-20 17:13:33 +00:00
Douglas Gregor 7319327007 Give implicitly-defined default constructors and destructors empty
bodies, from Martin Vejnar!

llvm-svn: 114329
2010-09-20 16:48:21 +00:00
Argyrios Kyrtzidis 72664df103 Implement -Wunused-label.
llvm-svn: 114315
2010-09-19 21:21:25 +00:00
Argyrios Kyrtzidis 9096341310 Warn when an expression result in a LabelStmt is unused.
llvm-svn: 114314
2010-09-19 21:21:10 +00:00
Fariborz Jahanian 4fbf4af0f6 Fixes IRgen bug in objc++ reference binding of a
getter expression. 
Fixes // rdar://8437240

llvm-svn: 114299
2010-09-18 20:47:25 +00:00
Fariborz Jahanian 2b1d88abfb Problem with gnu conditional extension with missing
LHS and when conditional expression is an array. Since
it will be decayed, saved expression must be saved with
decayed expression. This is necessary to preserve semantics
of this extension (and prevent an IRGen crash which expects
an array to always be decayed). I am sure there will be other
cases in c++ (aggregate conditionals for example) when saving of the 
expression must happen after some transformation on conditional
expression has happened. 
Doug, please review.  Fixes // rdar://8446940

llvm-svn: 114296
2010-09-18 19:38:38 +00:00
Douglas Gregor 521db40c15 Give the Objective-C _cmd an "unlikely" code completion priority; it's
very rarely used.

llvm-svn: 114286
2010-09-18 15:16:27 +00:00
Gabor Greif bf98608a3d do not rely on the implicit-dereference semantics of dyn_cast_or_null
llvm-svn: 114281
2010-09-18 13:00:17 +00:00
John McCall 386dfc738e static local variables with destructors don't require a global destructor
unless we're on a platform without __cxa_atexit (or use thereof has been
disabled).  This patch actually just disables the check completely for
static locals, but I've filed http://llvm.org/bugs/show_bug.cgi?id=8176 to
track the platform-specific fix.

llvm-svn: 114269
2010-09-18 05:25:11 +00:00
John McCall f09d96f76d Adjust a fixup's starting branch if it's being resolved because
it reached the outermost scope and it hasn't yet been forwarded
to a cleanup.  Fixed PR8175.

llvm-svn: 114259
2010-09-18 02:24:39 +00:00
Douglas Gregor eda7e545e6 Continue parsing more postfix expressions, even after semantic
errors. Improves code completion in yet another case.

llvm-svn: 114255
2010-09-18 01:28:11 +00:00
John Thompson 1224061281 Added '|' delimiter to separate inline asm multiple alternative constraints for Clang side of support.
llvm-svn: 114253
2010-09-18 01:15:13 +00:00
John Thompson 9a587aaaa9 Add more error checking to attribute vecreturn
llvm-svn: 114251
2010-09-18 01:12:07 +00:00
John McCall 8ea46b6654 Fix a bug with binding l-values to elided temporaries, and leave a couple
helpful asserts behind.

llvm-svn: 114250
2010-09-18 00:58:34 +00:00
Anton Yartsev 79d6af3839 formatted everything to fit within 80 columns
llvm-svn: 114249
2010-09-18 00:39:16 +00:00
Tom Care 0bd3431a5e Revert r114244 since it breaks a test in Analysis.
llvm-svn: 114246
2010-09-18 00:17:17 +00:00
Tom Care 0f99e64305 IdempotentOperationChecker no longer reports errors that are post-dominated by a sink. This fixes some false positives that were flagged because a path was incomplete (usually in a loop).
llvm-svn: 114244
2010-09-18 00:06:34 +00:00
Bill Wendling d632616f86 The MMX shift-with-immediate builtins require the equivalent
shift-with-immediate LLVM intrinsics.

llvm-svn: 114239
2010-09-17 23:46:16 +00:00