Commit Graph

189 Commits

Author SHA1 Message Date
Nick Lewycky 508ef2c350 Correct typos and whitespace, spotted by Nico Weber!
llvm-svn: 117871
2010-10-31 21:07:24 +00:00
Benjamin Kramer fb5e584151 More class anonymization.
llvm-svn: 117106
2010-10-22 16:48:22 +00:00
Fariborz Jahanian bb40ea42e3 Fixes a potential crash in rewriter when sending message
to 'super'.

llvm-svn: 116928
2010-10-20 16:07:20 +00:00
Duncan Sands 3a02f3eeff GCC 4.4 warns that Receiver may be used uninitialized in this function.
As far as I can see, gcc is right to think this!  The following change
will cause a nice segfault rather than undefined behaviour if this case
occurs.  Someone who understands what this code is supposed to do should
probably take a proper look.

llvm-svn: 116917
2010-10-20 08:21:16 +00:00
Fariborz Jahanian 7c299bc6fa Do not rewrite new accessor if user has defined accessors.
Fixes //rdar: // 8570020.

llvm-svn: 116882
2010-10-19 23:47:54 +00:00
Ted Kremenek c81155eef7 Silence uninitialized value warning.
llvm-svn: 116877
2010-10-19 23:10:22 +00:00
Fariborz Jahanian 1cee0adea3 Fix a rewriting bug of rewriting properties declared in
protocols. // rdar: //8558702

llvm-svn: 116652
2010-10-16 00:29:27 +00:00
Fariborz Jahanian 9c07e1767d Rewrite bug fix rewriting a property assignment when
its RHS is an ivar. Fixes //rdar: //8541517.

llvm-svn: 116539
2010-10-14 23:31:39 +00:00
Fariborz Jahanian 681c0754d9 Eliminate usage of ObjCSuperExpr used for
'super' as receiver of property or a setter/getter
methods. //rdar: //8525788

llvm-svn: 116483
2010-10-14 16:04:05 +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
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
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
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
Fariborz Jahanian 7bf13c49c7 Rewriting array element type of qualified-id.
Fixes rdra://8475819.

llvm-svn: 115201
2010-09-30 20:41:32 +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
Michael J. Spencer 09476212de Revert "CMake: Update to use standard CMake dependency tracking facilities instead"
This reverts commit r113631

Conflicts:

	CMakeLists.txt
	lib/CodeGen/CMakeLists.txt

llvm-svn: 113817
2010-09-13 23:54:41 +00:00
Michael J. Spencer 0881f4a367 CMake: Update to use standard CMake dependency tracking facilities instead
of whatever we were using before...

llvm-svn: 113631
2010-09-10 21:13:16 +00:00
Douglas Gregor c9199f522f Clean up CMake dependencies
llvm-svn: 113489
2010-09-09 15:44:58 +00:00
Douglas Gregor b2f0713ddc Clean up some of the CMake dependencies
llvm-svn: 113416
2010-09-08 21:40:53 +00:00
Chris Lattner a3d232ad27 zap more dead code.
llvm-svn: 113076
2010-09-04 18:19:08 +00:00
Chris Lattner 3dd48bd169 "I see dead code". IdempotentOperationChecker::isTruncationExtensionAssignment
should probably be removed if it has no purpose, but I just #if'd it out
in case it's usefulIdempotentOperationChecker::isTruncationExtensionAssignment
should probably be removed if it has no purpose, but I just #if'd it out
in case it's useful

llvm-svn: 112949
2010-09-03 04:34:38 +00:00
Fariborz Jahanian c6bf0bd51b AST work to support [C++] [IRgen] for ?: with missing LHS
This is also pr7726 and wip. No change in functionality
at this time.

llvm-svn: 112612
2010-08-31 18:02:20 +00:00
Douglas Gregor 5209a0d850 Fix CMake dependencies
llvm-svn: 112475
2010-08-30 14:31:03 +00:00
Argyrios Kyrtzidis 43b205796f Fix the memory leak of FloatingLiteral/IntegerLiteral.
For large floats/integers, APFloat/APInt will allocate memory from the heap to represent these numbers.
Unfortunately, when we use a BumpPtrAllocator to allocate IntegerLiteral/FloatingLiteral nodes the memory associated with
the APFloat/APInt values will never get freed.
I introduce the class 'APNumericStorage' which uses ASTContext's allocator for memory allocation and is used internally by FloatingLiteral/IntegerLiteral.

Fixes rdar://7637185

llvm-svn: 112361
2010-08-28 09:06:06 +00:00
John McCall 8e7d656a4a De-memberify the VarDecl and FunctionDecl StorageClass enums.
This lets us remove Sema.h's dependency on Expr.h and Decl.h.

llvm-svn: 112156
2010-08-26 03:08:43 +00:00
John McCall e302792b61 GCC didn't care for my attempt at API compatibility, so brute-force everything
to the new constants.

llvm-svn: 112047
2010-08-25 11:45:40 +00:00
John McCall 2536c6da0e More incremental progress towards not including Expr.h in Sema.h.
llvm-svn: 112044
2010-08-25 10:28:54 +00:00
Douglas Gregor f0708dee83 Fix crasher with IgnoringDiagClient
llvm-svn: 111447
2010-08-18 23:03:13 +00:00
Douglas Gregor 2dd19f1d5f Simplify the ownership model for DiagnosticClients, which was really
convoluted and a bit leaky. Now, the Diagnostic object owns its
DiagnosticClient.

llvm-svn: 111437
2010-08-18 22:29:43 +00:00
Douglas Gregor b13f5d99af Simplify FixItHint by eliminated the unnecessary InsertionLoc
location. Patch by Eelis van der Weegen!

llvm-svn: 111362
2010-08-18 14:24:02 +00:00
Daniel Dunbar 56df97761d StringRef'ication of lots stuff, patch by Peter Davies!
llvm-svn: 111314
2010-08-17 22:39:59 +00:00
Nick Lewycky 53f1042dc1 Make the FixItOptions object required instead of optional.
llvm-svn: 111105
2010-08-15 16:47:39 +00:00
Argyrios Kyrtzidis 1cec2cc798 Remove dead code, caught by unused function warnings.
llvm-svn: 111091
2010-08-15 01:15:58 +00:00
Nick Lewycky 0db53e433e Remember that FixItOptions* is optional and don't crash when it's not provided.
llvm-svn: 111084
2010-08-14 23:03:19 +00:00
Nick Lewycky 078a5e26fd Add a new cc1 option -fix-what-you-can which when combined with the fix-it mode
will apply all fixes even when there were other errors in the file.

llvm-svn: 111020
2010-08-13 17:31:00 +00:00
John McCall cf14216509 Store inheritance paths after CastExprs instead of inside them.
This takes some trickery since CastExpr has subclasses (and indeed,
is abstract).

Also, smoosh the CastKind into the bitfield from Expr.

Drops two words of storage from Expr in the common case of expressions
which don't need inheritance paths.  Avoids a separate allocation and
another word of overhead in cases needing inheritance paths.  Also has
the advantage of not leaking memory, since destructors for AST nodes are
never run.

llvm-svn: 110507
2010-08-07 06:22:56 +00:00
Fariborz Jahanian e6a4e3933d Initialize block's imported variable(s) in
block's synthesized constructor initalizer list.
Fixes radar 8240371.

llvm-svn: 109698
2010-07-28 23:27:30 +00:00
Fariborz Jahanian 3fd2a555d3 Fix source location of the initializer in
a copy initialization. Back out hack in objc rewriter.
fixes radar 8213998.

llvm-svn: 109024
2010-07-21 18:31:47 +00:00
Fariborz Jahanian 34c85987fe Fix a rewriter bug which originates in SemaInit involving
Constructor Initialization which computes Source Location
differently now. Fixes radar 8213998.

llvm-svn: 109018
2010-07-21 17:36:39 +00:00
Sebastian Redl c57d34bc35 Update ImplicitCastExpr to be able to represent an XValue.
llvm-svn: 108807
2010-07-20 04:20:21 +00:00
Chris Lattner ad4f38b1a9 BUILD_ARCHIVE is the default for libraries, no need to set it.
llvm-svn: 108633
2010-07-18 00:14:47 +00:00
Benjamin Kramer 8d5609b604 Pass StringRefs by value.
llvm-svn: 108375
2010-07-14 23:19:41 +00:00
Douglas Gregor 603d81bf8d When forming a function call or message send expression, be sure to
strip cv-qualifiers from the expression's type when the language calls
for it: in C, that's all the time, while C++ only does it for
non-class types. 

Centralized the computation of the call expression type in
QualType::getCallResultType() and some helper functions in other nodes
(FunctionDecl, ObjCMethodDecl, FunctionType), and updated all relevant
callers of getResultType() to getCallResultType().

Fixes PR7598 and PR7463, along with a bunch of getResultType() call
sites that weren't stripping references off the result type (nothing
stripped cv-qualifiers properly before this change).

llvm-svn: 108234
2010-07-13 08:18:22 +00:00
Argyrios Kyrtzidis 568bc84562 Remove Decl::getCompoundBody().
This has 2 (slight) advantages:
-Make explicit at getBody()'s callsite that we expect/handle only CompoundStmt and not CXXTryStmt.
-Better tracking of Decl::getBody()'s callsites.

llvm-svn: 107771
2010-07-07 11:31:34 +00:00
Daniel Dunbar 8ab6c54ce2 Rewriter: Use the appropriate printing context instead of the default
constructed one -- this is necessary to ensure types get printed correctly.

llvm-svn: 107312
2010-06-30 19:16:53 +00:00
Chris Lattner ed8b6b799d introduce a new CharSourceRange class, and enhance the diagnostics routines
to use them instead of SourceRange.  CharSourceRange is just a SourceRange
plus a bool that indicates whether the range has the end character resolved
or whether the end location is the start of the end token.  While most of
the compiler wants to think of ranges that have ends that are the start of
the end token, the printf diagnostic stuff wants to highlight ranges within
tokens.

This is transparent to the diagnostic stuff.  To start taking advantage of
the new capabilities, you can do something like this:
  Diag(..) << CharSourceRange::getCharRange(Begin,End)

llvm-svn: 106338
2010-06-18 22:45:06 +00:00
Daniel Dunbar c1b1729b66 Break Frontend's dependency on Rewrite, Checker and CodeGen in shared library configuration
Currently, all AST consumers are located in the Frontend library,
meaning that in a shared library configuration, Frontend has a
dependency on Rewrite, Checker and CodeGen.  This is suboptimal for
clients which only wish to make use of the frontend.  CodeGen in
particular introduces a large number of unwanted dependencies.

This patch breaks the dependency by moving all AST consumers with
dependencies on Rewrite, Checker and/or CodeGen to their respective
libraries.  The patch therefore introduces dependencies in the other
direction (i.e. from Rewrite, Checker and CodeGen to Frontend).

After applying this patch, Clang builds correctly using CMake and
shared libraries ("cmake -DBUILD_SHARED_LIBS=ON").

N.B. This patch includes file renames which are indicated in the
patch body.

Changes in this revision of the patch:
 - Fixed some copy-paste mistakes in the header files
 - Modified certain aspects of the coding to comply with the LLVM
   Coding Standards

llvm-svn: 106010
2010-06-15 17:48:49 +00:00
Chris Lattner 48eb14dd79 Fix:
Decl.cpp:716:28: warning: initialization of pointer of type 'clang::VarDecl *' from literal 'false' [-Wbool-conversions]
  VarDecl *LastTentative = false;
                           ^
RewriteRope.cpp:535:12: warning: initialization of pointer of type '<anonymous>::RopePieceBTreeNode *' from literal 'false'
      [-Wbool-conversions]
    return false;
           ^

llvm-svn: 105946
2010-06-14 18:31:46 +00:00
Daniel Dunbar ee6b692551 Makefiles: Set Clang CPP compiler flags in a single location, instead of scattered throughout the project Makefiles.
llvm-svn: 105638
2010-06-08 20:44:43 +00:00
Daniel Dunbar e6c1daa8fd Makefile: Switch Clang Makefiles to always include the top-level Clang Makefile.
- This eliminates most dependencies on how Clang is installed relative to LLVM.

llvm-svn: 105637
2010-06-08 20:34:18 +00:00