Commit Graph

20551 Commits

Author SHA1 Message Date
John McCall bb79b5f6f3 Raise the responsibility for passing -disable-llvm-verifier in NDEBUG builds
to the driver, and support it in CodeGenOptsToArgs().  Note that this changes
the default behavior of clang -cc1 to always run the verifier.

llvm-svn: 96077
2010-02-13 03:50:24 +00:00
Anders Carlsson eee53d9c06 More work on return type adjustments in the new vtable builder.
llvm-svn: 96070
2010-02-13 02:02:03 +00:00
Ted Kremenek 1a6672a3d4 Enhance RegionStore::InvalidateRegions() to correctly invalidate bindings
by scanning through the values of LazyCompoundVals.

llvm-svn: 96067
2010-02-13 01:52:33 +00:00
John McCall ef3057c419 Switch the standard DeclarationName comparator to be a tri-valued comparator.
Use that while fixing a nasty misuse of qsort in vtable codegen which, somehow,
has not actually caused a crash.

llvm-svn: 96062
2010-02-13 01:04:05 +00:00
Ted Kremenek 7950b78430 Pull logic for visiting value bindings in InvalidateRegionsWorker into a separate method.
No functionality change.

llvm-svn: 96060
2010-02-13 00:54:03 +00:00
Eli Friedman d5c9399696 Fix for PR6274: teach constant folding to evaluate __builtin_expect.
llvm-svn: 96054
2010-02-13 00:10:10 +00:00
Eli Friedman 18c28f6cdc if-0 out printf.
llvm-svn: 96052
2010-02-13 00:03:21 +00:00
John McCall cfcb775b56 Add an option to disable the LLVM verifier pass (which is still always
disabled in NDEBUG builds).  The option applies only to -cc1 invocations and is:
  -disable_llvm_verifier

llvm-svn: 96046
2010-02-12 23:47:27 +00:00
Douglas Gregor 8cdbe64de4 Funnel changes to the ImportedDecls list in the ASTImporter through a
single Imported function, in preparation for fixing a serious design
flaw.

llvm-svn: 96044
2010-02-12 23:44:20 +00:00
Ted Kremenek 8bd0929d41 Fix bug I introduced with assinging a temporary to a StringRef.
llvm-svn: 96041
2010-02-12 23:31:14 +00:00
Ted Kremenek a3e657064b Make the following functions thread-safe but having them return an std::string that is reconstructed
every time they are called:

getClangRevision()
getClangFullRepositoryVersion()
getClangFullVersion()

llvm-svn: 96033
2010-02-12 22:54:40 +00:00
Douglas Gregor 98c1018337 Implement AST importing and merging for enumeration types and
enumerators, along with ImplicitCastExprs to make it work.

llvm-svn: 96024
2010-02-12 22:17:39 +00:00
Fariborz Jahanian 5ec502e35b Complain if block-literal expression's parameter name is
missing (in c/objc mode). Fixes radar 7528255.

llvm-svn: 96017
2010-02-12 21:53:14 +00:00
Ted Kremenek 8f8dcbaadd (1) Correctly format external Javascript link.
(2) Reformat "annotations" topics list to use a collapsable tree.

llvm-svn: 96013
2010-02-12 21:05:44 +00:00
Fariborz Jahanian e5c118f60d Don't error when setting a sub-structure variable via objc properties
in objective-c++ mode (do it for objective-c only).

llvm-svn: 96012
2010-02-12 21:02:28 +00:00
Chris Lattner 5647d3192c fix a bug in SourceManager::getInstantiationLocSlowCase, where
we'd add an offset from the spelling location space to the 
instantiation location, which doesn't make sense and would
lead up to the text diagnostics crashing when presented with
non-sensical locations.

This fixes rdar://7597492, a crash on 255.vortex.

llvm-svn: 96004
2010-02-12 19:31:35 +00:00
Fariborz Jahanian dc68f9539c Patch to fix a warning which exposed a bug in building
a qualified objective-c pointer type. Fixes radar 7638810.
(Also removes a FIXME).

llvm-svn: 96003
2010-02-12 19:27:33 +00:00
Chris Lattner fc38aa7091 restructure code a bit: there are two potential issues
worth asserting about in this code: 1) if the source range
is bogus (begin loc after end loc), and 2) if the client
is trying to highlight a range that is purely whitespace.

It is possible to just silently ignore #2, but it seems like
it is always a bug, so lets keep asserting on this condition,
but with a better assert message.

llvm-svn: 95998
2010-02-12 18:52:52 +00:00
Anders Carlsson 0760481f26 Fix a refacto that broke the clang-on-clang build.
llvm-svn: 95994
2010-02-12 18:14:46 +00:00
Fariborz Jahanian a459c4453d Fixes a rewriter bug rewriting function decl.
with block-pointer-type as one or more of its
arguments. Fixes radar 7638400.

llvm-svn: 95992
2010-02-12 17:52:31 +00:00
Douglas Gregor 5089c769bb Improve representation of tag declarations first declared or defined
within the declarator of another declaration, from Enea Zaffanella!

llvm-svn: 95991
2010-02-12 17:40:34 +00:00
Anders Carlsson 5272c2574a Start stubbing out more of the covariant thunk support.
llvm-svn: 95990
2010-02-12 17:37:14 +00:00
Douglas Gregor 925df1b529 Improve documentation for DependentTypeOfExprType, DependentDecltypeType. No functionality change.
llvm-svn: 95989
2010-02-12 17:28:41 +00:00
Douglas Gregor 56521c5e8c Simplify incomplete-array merging code in the AST importer, thanks to
Daniel's suggestion.

llvm-svn: 95987
2010-02-12 17:23:39 +00:00
Douglas Gregor 8870a49310 Fix a latent bug found by Ahmed Charles, where we were calling
ASTContext::getFunctionType with the wrong set of arguments.

llvm-svn: 95986
2010-02-12 17:17:28 +00:00
Anders Carlsson 8e661e15f2 Keep track of whether a final overrider needs a return type adjustment.
llvm-svn: 95985
2010-02-12 17:13:23 +00:00
Anders Carlsson 136bd19224 Move overrider out into a separate struct.
llvm-svn: 95984
2010-02-12 16:55:34 +00:00
Chris Lattner aa1cccbbef Fix PR6282: the include guard optimization cannot happen if the
guard macro is already defined for the first occurrence of the
header.  If it is, the body will be skipped and not be properly
analyzed for the include guard optimization.

llvm-svn: 95972
2010-02-12 08:03:27 +00:00
Anders Carlsson e8a9756e63 Keep track of the address points for all primary bases, and add the ability to dump multiple address points for a single offset.
llvm-svn: 95970
2010-02-12 07:43:48 +00:00
Douglas Gregor f40863caff Work around an annoying, non-standard optimization in the glibc
headers, where malloc (and many other libc functions) are declared
with empty throw specifications, e.g.,  

  extern void *malloc (__SIZE_TYPE__ __size) throw () __attribute__
  ((__malloc__)) ;

The C++ standard doesn't seem to allow this, and redeclaring malloc as
the standard permits (as follows) resulted in Clang (rightfully!)
complaining about mis-matched exception specifications.

  void *malloc(size_t size);

We work around this by silently propagating an empty throw
specification "throw()" from a function with C linkage declared in a
system header to a redeclaration that has no throw specifier.

Ick.

llvm-svn: 95969
2010-02-12 07:32:17 +00:00
John McCall 84c416b9f6 Fix a bug causing an assertion when a covariant return type differed from
an overriden type only by reduced qualification.

llvm-svn: 95968
2010-02-12 06:15:07 +00:00
Douglas Gregor 87b4b4184c Improve a test slightly
llvm-svn: 95967
2010-02-12 06:08:51 +00:00
Douglas Gregor d3a5918742 In C++, allow builtins to be referred to via qualified name lookup, e.g.,
::__builtin_va_copy

Fixes one of the Firefox issues in PR5511.

llvm-svn: 95966
2010-02-12 05:48:04 +00:00
Anders Carlsson 65b4978f7f More work on vtable layout. We can now layout vtables with primary bases.
llvm-svn: 95965
2010-02-12 05:25:12 +00:00
John McCall 62d5d64ce9 Waste two bits in every clang::Type so that the type class can be read
in a single byte-load rather than some crazy bitmunging operation.

llvm-svn: 95964
2010-02-12 03:41:30 +00:00
Anders Carlsson 09da3372b6 When dumping vtables, dump whether a virtual member function is pure or not.
llvm-svn: 95963
2010-02-12 02:38:13 +00:00
Anders Carlsson 9fbf6d95f6 More work on the final overriders.
llvm-svn: 95954
2010-02-12 01:40:03 +00:00
Devang Patel f4df65cf60 Do not ignore anonymous records.
llvm-svn: 95953
2010-02-12 01:31:06 +00:00
Devang Patel e003dd1721 Cache new compile unit.
llvm-svn: 95952
2010-02-12 01:30:31 +00:00
Ted Kremenek e9711db487 Two changes to scan-build:
(1) When no 'clang' is found with 'scan-build', remember the one from
the path as scan-build sees it, not the build system.  This prevents
us from finding different clangs during the build.

(2) Don't set LDPLUSPLUS when running xcodebuild; instead rely on the
clang driver to do the right thing.

llvm-svn: 95943
2010-02-12 00:12:25 +00:00
Ted Kremenek 14015de619 Add comments.
llvm-svn: 95942
2010-02-12 00:10:34 +00:00
Douglas Gregor 2579105c4e Handle AST merges of incomplete class types.
llvm-svn: 95941
2010-02-12 00:09:27 +00:00
Tanya Lattner 90073804fb Implementing unused function warning.
llvm-svn: 95940
2010-02-12 00:07:30 +00:00
Charles Davis a90f7ca591 Warn about using the new force_align_arg_pointer attribute on a function
pointer. If you don't like the new warning, you can turn it off with
-Wno-force-align-arg-pointer.

llvm-svn: 95939
2010-02-11 23:57:08 +00:00
Fariborz Jahanian 4c4ca5a9d3 Fixes a rewriting bug where order of constructor expression arguments did not match
order of constructor arguments (all block API specific). This was exposed only in 
a large block literal expression in a large file where PtrSet container size 
execceded its limit and required reallocation.  Fixes radar 7638294

llvm-svn: 95936
2010-02-11 23:35:57 +00:00
Douglas Gregor 50dc219e8b When we have a dependent direct initializer but not a dependent
variable type, we can (and should) still check for completeness of the
variable's type. Do so, to work around an assertion that shows up in
Boost's shared_ptr.

llvm-svn: 95934
2010-02-11 22:55:30 +00:00
Ted Kremenek 9d6eb40ce7 Fix leak in CXXNewExpr where the SubExprs array would get allocated directly using 'new[]' instead of the allocator associated with ASTContext.
llvm-svn: 95933
2010-02-11 22:51:03 +00:00
John McCall 81472e34b2 Make this test not rely on the system <limits.h>. Hopefully fixes the
MSVC build.

llvm-svn: 95932
2010-02-11 22:45:16 +00:00
Ted Kremenek 9c8a6f5a8e Fix re-allocation in AttrWithString::ReplaceString() to use the allocator assosciated with ASTContext.
llvm-svn: 95931
2010-02-11 22:44:22 +00:00
Ted Kremenek 2c809308ca Allocate the SubExprs array in ObjCMessageExpr using the allocator associated with ASTContext. This fixes yet another leak (<rdar://problem/7639260>).
llvm-svn: 95930
2010-02-11 22:41:21 +00:00