aboutsummaryrefslogtreecommitdiff
path: root/CodeGen/CodeGenModule.cpp
AgeCommit message (Collapse)Author
2008-03-15Make a major restructuring of the clang tree: introduce a top-levelChris Lattner
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48402 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-14add initial support for generating an llvm.globalctors list. Patch by David ↵Chris Lattner
Chisnall git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48362 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-09Propagate calling convention information to function declarations and CallInstNate Begeman
instructions. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48077 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-08Fix a fixme by allowing pointers in different address spaces to haveChris Lattner
different widths. Start simplifying TargetInfo accessor methods. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48050 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-05remove the source location arguments to various target query methods.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47954 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-03Add a bunch of attributes, patch by Nuno Lopes.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47837 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-01Add codegen support for ObjC message expressions with the GNU runtime.Chris Lattner
Patch by David Chisnall! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47789 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-19Implement CodeGenModule::getMemSetFn method.Lauro Ramos Venancio
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47346 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-19A global without initializer must be emitted as weak.Lauro Ramos Venancio
Fix Olden/bh test. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47292 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-11Fix PR1992 by computing the right type for string literals, whichChris Lattner
is an array type not a pointer type. This requires updating some diags that change and updating the code generator to handle the proper form of strings. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46941 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-06sink more of the type related code into CodeGenTypes.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46801 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-05rewrite some of the type refinement code to eliminate dangling pointersChris Lattner
simplify the code and generally make it more robust. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46745 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-05Relax an assertion, fixing PR1968Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46742 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-04Add experimental support for address space qualified types. Address spaceChristopher Lamb
qualifiers use the __attribute__((address_space(id))) syntax. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46691 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-02fix codegen on static variables which have multiple decl nodes. These Chris Lattner
should be merged just like normal globals. This fixes this testcase that Anders provided: static struct s a; static struct s *ap1 = &a; static struct s a = { 10 }; git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46661 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-26Factor out the constant generation into its own file.Anders Carlsson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46386 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-25Add more support for Apple's "private extern" extension...Steve Naroff
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46371 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-25Support checking and codegen of constant vector globalsNate Begeman
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46343 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-12Add first pieces of support for parsing and representing Chris Lattner
extern "C" in C++ mode. Patch by Mike Stump! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45904 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-09implement proper support for _Bool in memory, which is usually i8, not i1.Chris Lattner
This fixes a crash reported by Seo Sanghyeon git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45778 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-29implement codegen support for most unary operators when Chris Lattner
initializing a global. This handles important cases like: float foo3 = -0.01f; git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45427 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-29Don't attribute in file headers anymore. See llvmdev for theChris Lattner
discussion of this change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45410 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-18local static vars are globals also. This fixes a testcaseChris Lattner
reported by Seo. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45156 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-18introduce a new CodeGenModule::getIntrinsic method, which wraps Chris Lattner
Intrinsic::getDeclaration, allowing much more terse code. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45136 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-17add a hack so that codegen doesn't abort on missing sema of initializers, nowChris Lattner
we emit stuff like this: abort on missing sema of initializers, now we emit stuff like this: t3.c:1:24: warning: cannot codegen this initializer yet const char x[2][4] = { { 'a', 'b', '\0', '\0' }, { 'c', 'd', 'e', '\0' } }; ^~~~~~~~~~~~~~~~~~~~~~~~ This should be removed when sema is finished. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45086 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-17Update to use new PointerType::getUnqual() api.Christopher Lamb
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45081 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-13builtin id 0 is invalid, don't use a slot for it.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44968 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-12fix off-by-one error.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44963 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-12TargetInfo no longer includes a reference to SourceManager.Ted Kremenek
Moved all clients of Diagnostics to use FullSourceLoc instead of SourceLocation. Added many utility methods to FullSourceLoc to provide shorthand for: FullLoc.getManager().someMethod(FullLoc.getLocation()); instead we have: FullLoc.someMethod(); Modified TextDiagnostics (and related classes) to use this short-hand. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44957 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-11Mega-patch: ripped SourceManager out of Diagnostic/DiagnosticClient. NowTed Kremenek
SourceManager is passed by reference, allowing the SourceManager to be associated with a specific translation unit, and not the entire execution of the driver. Modified all users of Diagnostics to comply with this new interface. Integrated SourceManager as a member variable of TargetInfo. TargetInfo will eventually be associated with a single translation unit (just like SourceManager). Made the SourceManager reference in ASTContext private. Provided accessor getSourceManager() for clients to use instead. Modified clients to comply with new interface. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44878 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-11Reimplement support for strings that initialize global inits now thatChris Lattner
the types are right in sema. Thanks Steve. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44834 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-10add support for implicit cast from array to pointer that is not the elementChris Lattner
type. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44809 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-10abort when we lower an initializer to the wrong type, as we currently do for:Chris Lattner
char text[] = "string"; git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44752 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-10extend or truncate the initializer for a string initializer to match its type.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44751 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-09Implement codegen support for:Chris Lattner
char text[8] = "string"; Big fixme remains. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44750 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-09implement support for functions that initialize globals.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44730 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-02Treat discarding array initializer elements as an extwarn (so ↵Christopher Lamb
-pedantic-errors flags it). Allow CodeGen to truncate the initializer if needed. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44518 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-02globals can't be vla'sChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44512 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-02add codegen support for global inits that require array decay.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44511 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-02warn about unhandled initializers instead of crashing on them.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44510 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-02Handle global variable definitions which change the type of a definition, ↵Chris Lattner
such as: extern int x[]; void foo() { x[0] = 1; } int x[10]; void bar() { x[0] = 1; } git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44509 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-02merge the llvm global variable when there are multiple C decls.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44507 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-02implement codegen for functions whose function body type don't matchChris Lattner
their prototype. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44506 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-02merge functions with multiple function decls if they have the same name.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44505 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-02Warn about unsupported codegen with the diags machinery, giving us:Chris Lattner
t.c:3322:5: warning: cannot codegen this yet __asm__ ("bswap %0" : "+r" (_data)); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ instead of: Unimplemented stmt! (AsmStmt 0x80eaa0 <t.c:3331:5, line:3334:28>) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44501 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-02Support initalisers for more than just int-typed static variables.Oliver Hunt
We now use the CodeGenModule logic for generating the constant initialiser expression, so happily further initialiser fixes should automatically work for statics as well. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44495 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-28Implement support for -fwritable-strings and make the code generatorChris Lattner
merge string literals when it is not provided. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44394 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-23improve codegen for global variable initializers, implementing Chris Lattner
test/CodeGen/global-with-initialiser.c Patch by Oliver Hunt! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44290 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-01Put constant CFStrings in the __DATA,__cfstring section.Anders Carlsson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43593 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-31Take 2.Devang Patel
Make target info available to clang code generator. This is far from complete but this helps clang codegen module make progress. At the moment target triplet and target description strings are hard coded in clang::TargetInfo git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43572 91177308-0d34-0410-b5e6-96231b3b80d8