Commit Graph

19 Commits

Author SHA1 Message Date
Chris Lattner 4591fd0aac Fix rdar://6103124, the only dummy blocks are ones without names. Named blocks
are important part of control flow structures.

llvm-svn: 54078
2008-07-25 23:40:10 +00:00
Sanjiv Gupta 1e8b608751 Fixed bugzilla bug# 2489.
This was broken when the GenerateCode function was splitted to use GenerateFunction.

llvm-svn: 53136
2008-07-04 11:04:26 +00:00
Chris Lattner 5696e7badf Change self/_cmd to be instances of ImplicitParamDecl instead of ParmVarDecl.
Patch by David Chisnall!

llvm-svn: 52422
2008-06-17 18:05:57 +00:00
Eli Friedman 327944b343 Basic support for volatile loads and stores. Stores the volatile
qualifier in the lvalue, and changes lvalue loads/stores to honor 
the volatile flag.  Places which need some further attention are marked 
with FIXMEs.

Patch by Cédric Venet.

llvm-svn: 52264
2008-06-13 23:01:12 +00:00
Eli Friedman f6b091f73a First cut at setting attributes for functions and calls; this puts us
much closer to passing the gcc struct layout tests.

It might be possible to refactor this a bit, but I'm not sure there's 
actually enough common code for that to be useful.

To get the calling convention completely correct, a bit of 
platform-specific code is necessary even for x86-Linux. On x86-Linux, the
alignment of function parameters is extremely strange; as far as I can tell,
it's always 4 except for SSE vectors or structs containing SSE vectors.  I'm 
continuing to investigate this.

llvm-svn: 51839
2008-06-01 15:54:49 +00:00
Anton Korobeynikov 1200aca763 Support for code generation of Objective-C top-level language constructs.
Implemented by David Chisnall!

llvm-svn: 51835
2008-06-01 14:13:53 +00:00
Sanjiv Gupta 98070578bf Generate subprogram debug info with -g.
Also take care of freeing memory at the right places.

llvm-svn: 51553
2008-05-25 05:15:42 +00:00
Eli Friedman 1763075b9c Make debugging information usable. This is barebones, but it makes -g
actually work (instead of crashing llc), and there's enough info emitted 
to get line number information in gdb. This should hopefully be helpful 
for debugging non-working programs.

I got rid of the begin/endregion calls because the implementation wasn't 
working; someone who knows the debugging info a bit better might try to 
add it. I really have no clue how a compiler is supposed to emit them.

This commit shouldn't have any effect without -g.

llvm-svn: 51404
2008-05-22 01:40:10 +00:00
Dan Gohman 75d69da5ab Move getAccessedFieldNo out of lib/AST/Expr.cpp into
lib/CodeGen/CGExpr.cpp and to change include/clang/AST/Attr.h to
use its own enum for visibility types instead of using
llvm::GlobalValue::VisibilityTypes. These changes eliminate
dependencies in the AST library on LLVM's VMCore library.

llvm-svn: 51398
2008-05-22 00:50:06 +00:00
Chris Lattner 222c6123df remove a stray printout
llvm-svn: 50691
2008-05-06 00:44:00 +00:00
Chris Lattner 7b9293ba20 Simplify FunctionDecl::AddRedeclaration a bit by using std::swap.
Fix 'swapping' of attributes to not insert null values into the 
DeclAttrs map.

llvm-svn: 50612
2008-05-04 02:29:49 +00:00
Chris Lattner bc22b5b327 if a decl is both 'static' and weak or static and inline, its linkage
type should be internal, not weak/linkonce.

llvm-svn: 50611
2008-05-04 01:44:26 +00:00
Steve Naroff 08899ff85d Remove FileVarDecl and BlockVarDecl. They are replaced by VarDecl::isBlockVarDecl() and VarDecl::isFileVarDecl().
This is a fairly mechanical/large change. As a result, I avoided making any changes/simplifications that weren't directly related. I did break two Analysis tests. I also have a couple FIXME's in UninitializedValues.cpp. Ted, can you take a look? If the bug isn't obvious, I am happy to dig in and fix it (since I broke it).

llvm-svn: 49748
2008-04-15 22:42:06 +00:00
Gabor Greif d36afd7d65 tracking API changes arising from r49277
llvm-svn: 49279
2008-04-06 20:42:52 +00:00
Chris Lattner 5506f8cf4c Codegen assignment to self correctly, patch by David Chisnall!
llvm-svn: 49201
2008-04-04 04:07:35 +00:00
Chris Lattner 182f660d8d simplify some code by using PointerLikeType.
llvm-svn: 49101
2008-04-02 17:45:06 +00:00
Chris Lattner c00c35a857 some cleanups on top of David's patch. There are still two
remaining open issues I've communicated to him:

1) self can be assigned to, and his patch didn't handle it correctly.
2) CollectObjCIvarTypes is N^2 (because each subclass reprocesses
   all parent class ivars) and flattens classes.  If A derives from B, 
   and both have an int, I'd expect to get { {i32}, i32}, not { i32, i32}.

David, please review.

llvm-svn: 48970
2008-03-30 23:25:33 +00:00
Chris Lattner 4bd5596d08 Add initial support for objc codegen for methods, ivars, and the
etoile runtime, patch by David Chisnall!

llvm-svn: 48969
2008-03-30 23:03:07 +00:00
Chris Lattner 7a51313d8a Make a major restructuring of the clang tree: introduce a top-level
lib dir and move all the libraries into it.  This follows the main
llvm tree, and allows the libraries to be built in parallel.  The
top level now enforces that all the libs are built before Driver,
but we don't care what order the libs are built in.  This speeds
up parallel builds, particularly incremental ones.

llvm-svn: 48402
2008-03-15 23:59:48 +00:00