Commit Graph

17581 Commits

Author SHA1 Message Date
Zhongxing Xu c7460964ac Malloc checker basically works now.
llvm-svn: 87094
2009-11-13 07:48:11 +00:00
Zhongxing Xu c4902a52a0 Hook up Malloc checker.
llvm-svn: 87093
2009-11-13 07:25:27 +00:00
Zhongxing Xu a4276b091d Check in a new interface of Checker, which will soon be used.
llvm-svn: 87092
2009-11-13 06:53:04 +00:00
Zhongxing Xu 0320ad28c7 GRStateManager::CurrentStmt is not used. Remove it.
llvm-svn: 87091
2009-11-13 06:04:01 +00:00
Daniel Dunbar 7d75afc56a Add CompilerInstance::createDiagnostics, and move clang-cc to it.
clang-cc.cpp is now under 1k lines, if anyone is counting.

llvm-svn: 87090
2009-11-13 05:52:34 +00:00
Daniel Dunbar 210a80086b Add a FIXME.
llvm-svn: 87089
2009-11-13 05:52:19 +00:00
Daniel Dunbar aaa148fd36 Add Preprocessor to CompilerInstance, and move clang-cc CreatePreprocessor to
CompilerInstance::createPreprocessor.

llvm-svn: 87088
2009-11-13 05:52:11 +00:00
Daniel Dunbar 1b4441915a Wherein the TargetInfo argument to Preprocessor is made 'const' and propogated.
llvm-svn: 87087
2009-11-13 05:51:54 +00:00
Zhongxing Xu 1721ef7a53 Include header for printf.
llvm-svn: 87086
2009-11-13 05:46:16 +00:00
Rafael Espindola 46129b0934 Use StringRef::split instead of SplitString.
llvm-svn: 87085
2009-11-13 05:13:58 +00:00
Anders Carlsson e828c36933 Add a special BuildVirtualCall that's going to be used for building calls to destructors. This is needed because when compiling:
struct A {
	virtual ~A();
};

void f(A* a) {
	delete a;
}

A's deleting destructor should be called.

llvm-svn: 87083
2009-11-13 04:45:41 +00:00
Anders Carlsson 78cfaa9e56 Fix two bugs with temporaries:
1. For 

A f() {
	return A();
}

we were incorrectly calling the A destructor on the returned object.

2. For

void f(A);
void g() {
	A a;
	f(a);
}

we were incorrectly not calling the copy constructor.

llvm-svn: 87082
2009-11-13 04:34:45 +00:00
Anders Carlsson 87f84c1e72 Move GlobalDecl to its own file. Also add DenseMapInfo traits.
llvm-svn: 87081
2009-11-13 04:25:07 +00:00
Daniel Dunbar 546a676ae5 Add {File,Source}Manager to CompilerInstance.
llvm-svn: 87079
2009-11-13 04:12:06 +00:00
Daniel Dunbar 636404a330 Add CompilerInstance, and starting moving clang-cc to it.
- The design philosophy is in the CompilerInstance doxyment, if you don't agree
   with it now would be a good time to speak up.

llvm-svn: 87078
2009-11-13 03:51:44 +00:00
Ted Kremenek 2466e0d92f Only flush plist diagnostics once.
llvm-svn: 87073
2009-11-13 03:14:14 +00:00
Ted Kremenek da00234109 Fix recently introduced use-after-free error reported in <rdar://problem/7387478>.
llvm-svn: 87072
2009-11-13 03:02:57 +00:00
Mike Stump fa81808a11 Refine construction vtables; they don't include bits that don't have
virtual bases unless they are morally virtual.

llvm-svn: 87071
2009-11-13 02:35:38 +00:00
Mike Stump 653d0b99df Refine the construction vtables with respect to offsets. WIP.
llvm-svn: 87067
2009-11-13 02:13:54 +00:00
Daniel Dunbar 27b19dc1b5 Move input kind identification (-x) into FrontendOptions.
llvm-svn: 87066
2009-11-13 02:06:12 +00:00
Ted Kremenek 3c55718016 Pull static variable within function (for slightly faster startup time).
llvm-svn: 87065
2009-11-13 01:58:01 +00:00
Mike Stump 83066c8dee Allow the tracking of address points for construction vtables as well.
llvm-svn: 87063
2009-11-13 01:54:23 +00:00
Ted Kremenek a2968e59e3 retain/release checker: refactor some of the summary lookup logic for instance method summaries. No real functionality change, but it paves the way for new enhancements.
llvm-svn: 87062
2009-11-13 01:54:21 +00:00
Ted Kremenek aedb7434c8 Add clang-cc option "-analyzer-experimental-checks" to enable experimental path-sensitive checks. The idea is to separate "barely working" or "skunkworks" checks from ones that should always run. Later we need more fine-grain checker control.
llvm-svn: 87053
2009-11-13 01:15:47 +00:00
Daniel Dunbar 1e886ebe8c Move -target-{triple,abi} options into FrontendOptions.
llvm-svn: 87051
2009-11-13 01:02:19 +00:00
Daniel Dunbar 4a1f60f777 Move code completion options to clang-cc
llvm-svn: 87050
2009-11-13 01:02:10 +00:00
Chris Lattner 956d71a63a add a fixme, inheriting from PointerIntPair is gross :)
llvm-svn: 87048
2009-11-13 00:57:01 +00:00
Daniel Dunbar a5c3d989fb Move FixItAtLocations into FrontendOptions
llvm-svn: 87046
2009-11-12 23:52:56 +00:00
Daniel Dunbar eb51586a85 clang-cc: Keep Verbose option with HeaderSearchOptions, for now.
llvm-svn: 87045
2009-11-12 23:52:46 +00:00
Daniel Dunbar f996c05d74 Add FrontendOptions, and starting moving clang-cc to it.
llvm-svn: 87044
2009-11-12 23:52:32 +00:00
Mike Stump 2b34bc5a96 Refine which vtbl is refernced in VTTs.
llvm-svn: 87043
2009-11-12 23:36:21 +00:00
Mike Stump ca0de33113 Refine offsets into vtables for the VTT.
llvm-svn: 87041
2009-11-12 23:14:15 +00:00
Mike Stump 8677bc27bf Refine vtable pointers for secondary vtables inside VTTs to point to
the right base vtable.  WIP.

llvm-svn: 87039
2009-11-12 22:56:32 +00:00
Douglas Gregor 9533e2803f We need the definition of NamedDecl in DeclContextInternals.h, since Clang is type-checking the template definition more thoroughly
llvm-svn: 87037
2009-11-12 22:12:17 +00:00
Mike Stump 2cefe38365 Fix the offset calculations for non-virtual bases with overrides.
Refine the VTT entries for virtual bases to refer to the complete
object's vtable instead of constructor vtables.

Refine the AddressPoint calculations for VTT entries for virtual bases.

llvm-svn: 87021
2009-11-12 20:47:57 +00:00
Fariborz Jahanian eb80c98a72 Fix a code gen bug in i386-apple-darwin (objc fragile abi), sending
message to 'super'. Fixes radar 7205866.

llvm-svn: 87017
2009-11-12 20:14:24 +00:00
Daniel Dunbar b0a1942196 Spell empty StringRef correctly (0 is a null StringRef, which is not the same).
llvm-svn: 87011
2009-11-12 18:40:12 +00:00
Douglas Gregor 49ba3cabdd Recognize (and check) pointer-to-member template arguments that are
non-type template parameters or constants of pointer-to-member
type. Once checked, be sure to retain those pointer-to-member
constants as expressions if they are dependent, or as declarations if
they are not dependent.

llvm-svn: 87010
2009-11-12 18:38:13 +00:00
Devang Patel 94f798c079 "Attach debug info with llvm instructions" mode was enabled a month ago. Now make it permanent and remove old way of inserting intrinsics to encode debug info for locations and types.
llvm-svn: 87007
2009-11-12 18:21:39 +00:00
Devang Patel 6e98d7af22 Use getNameAsCString() instead of getName().data()
llvm-svn: 87001
2009-11-12 17:49:47 +00:00
Douglas Gregor 4e948ce769 When instantiating a reference to a non-type template parameter of pointer to
member type (e.g., T Class::*Member), build a pointer-to-member
constant expression. Previously, we we just building a simple
declaration reference expression, which meant that the expression was
not treated as a pointer to member.

llvm-svn: 87000
2009-11-12 17:40:13 +00:00
Chandler Carruth bc55fe26c6 Move CompileOptions -> CodeGenOptions, and sink it into the CodeGen library.
This resolves the layering violation where CodeGen depended on Frontend.

llvm-svn: 86998
2009-11-12 17:24:48 +00:00
Anders Carlsson 9a1cd87d17 Set CK_BaseToDerived in TryStaticDowncast.
llvm-svn: 86996
2009-11-12 16:53:16 +00:00
Douglas Gregor 6051c8d344 Give CanQual<T> an implicit conversion to bool, so that it can be used
in "if" statements like:

  if (CanQual<ReferenceType> RefType = T.getAs<ReferenceType>())

Thanks to Clang for pointing out this mistake :)

llvm-svn: 86995
2009-11-12 16:49:45 +00:00
Anders Carlsson a70ad93f8a Add a CK_BaseToDerived cast kind.
llvm-svn: 86994
2009-11-12 16:43:42 +00:00
Douglas Gregor 19ac2d6494 When comparing template parameter lists, distinguish between three cases:
- Comparing template parameter lists to determine if we have a redeclaration
  - Comparing template parameter lists to determine if we have equivalent
    template template parameters
  - Comparing template parameter lists to determine whether a template 
    template argument is valid for a given template template parameter.

Previously, we did not distinguish between the last two cases, which
got us into trouble when we were looking for exact type matches
between the types of non-type template parameters that were dependent
types. Now we do, so we properly delay checking of template template
arguments until instantiation time.

Also, fix an accidental fall-through in a case statement that was
causing crashes.

llvm-svn: 86992
2009-11-12 16:20:59 +00:00
Daniel Dunbar 068ae76e02 Disallow FIX-ITs when generating code.
llvm-svn: 86990
2009-11-12 15:42:53 +00:00
Douglas Gregor ef986e8fc3 Improve source-location information for implicitly-generated member call expressions
llvm-svn: 86989
2009-11-12 15:31:47 +00:00
Daniel Dunbar 91cd960d50 clang-cc: Coalesce frontend options further.
llvm-svn: 86988
2009-11-12 15:23:20 +00:00
Benjamin Kramer 1eb8569bcb Fix MSVC build.
llvm-svn: 86983
2009-11-12 12:30:05 +00:00