summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGDecl.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Address Chris's comments regarding C++ name mangling.Douglas Gregor2009-02-181-2/+2
| | | | llvm-svn: 64984
* Change EmitConstantExpr to allow failure.Daniel Dunbar2009-02-171-6/+11
| | | | | | | | | | | | | | IRgen no longer relies on isConstantInitializer, instead we just try to emit the constant. If that fails then in C we emit an error unsupported (this occurs when Sema accepted something that it doesn't know how to fold, and IRgen doesn't know how to emit) and in C++ we emit a guarded initializer. This ends up handling a few more cases, because IRgen was actually able to emit some of the constants Sema accepts but can't Evaluate(). For example, PR3398. llvm-svn: 64780
* Set constant bit on static block vars as well. Patch by Anders Johnson!qDaniel Dunbar2009-02-131-1/+1
| | | | llvm-svn: 64502
* IRgen support for attribute used.Daniel Dunbar2009-02-131-1/+3
| | | | | | - PR3566 llvm-svn: 64492
* Add CodeGen support for the nodebug attribute.Anders Carlsson2009-02-131-3/+3
| | | | llvm-svn: 64445
* Add basic support for C++ name mangling according to the Itanium C++Douglas Gregor2009-02-131-2/+2
| | | | | | | | | | | | | | | | ABI to the CodeGen library. Since C++ code-generation is so incomplete, we can't exercise much of this mangling code. However, a few smoke tests show that it's doing the same thing as GCC. When C++ codegen matures, we'll extend the ABI tester to verify name-mangling as well, and complete the implementation here. At this point, the major client of name mangling is in the uses of the new "overloadable" attribute in C, which allows overloading. Any "overloadable" function in C (or in an extern "C" block in C++) will be mangled the same way that the corresponding C++ function would be mangled. llvm-svn: 64413
* Honor attribute section on static block var decls.Daniel Dunbar2009-02-121-0/+4
| | | | llvm-svn: 64411
* Function parameters for PIC16 are like local variables. So use the keyword ↵Sanjiv Gupta2009-02-101-1/+1
| | | | | | ".auto." to mangle their names. The working of PIC16AsmPrinter relies on that keyword currently. llvm-svn: 64198
* Use the new cleanup infrastructure for VLAs. The next iteration of patches ↵Anders Carlsson2009-02-091-2/+12
| | | | | | will remove the old Obj-C EH cleanup code. llvm-svn: 64161
* Emit a cleanup block for the cleanup attributeAnders Carlsson2009-02-071-0/+16
| | | | llvm-svn: 64052
* Fixup goto codegen in and around VLAs.Mike Stump2009-02-071-1/+1
| | | | llvm-svn: 64014
* Follow Eli's advice and store the VLA size with the native size_t type. ↵Anders Carlsson2009-02-051-0/+3
| | | | | | Fixes PR3491. llvm-svn: 63879
* Targets that don't have stack use global address space for parameters.Sanjiv Gupta2009-02-031-5/+15
| | | | | | | Specify external linkage for such globals so that llvm optimizer do not assume there values initialized as zero. llvm-svn: 63636
* Rename Expr::isConstantExpr to Expr::isConstantInitializer; this more Eli Friedman2009-01-251-1/+1
| | | | | | | | accurately states what the function is trying to do and how it is different from Expr::isEvaluatable. Also get rid of a parameter that is both unused and inaccurate. llvm-svn: 62951
* more SourceLocation lexicon change: instead of referring to theChris Lattner2009-01-161-1/+2
| | | | | | "logical" location, refer to the "instantiation" location. llvm-svn: 62316
* Make VLAs usable, and make basic usage work correctly. Also, add a Eli Friedman2008-12-201-10/+2
| | | | | | | | | | simple test that actually does VLA codegen. Note that despite the fact that the alloca isn't in the entry block, it should dominate all uses; this is guaranteed by the restrictions on goto into VLA scope in C99. llvm-svn: 61291
* Handle typedefs to VLAs (Emit the size expr when we encounter the typedefAnders Carlsson2008-12-201-1/+8
| | | | llvm-svn: 61290
* Change EmitVLASize to take a QualType that must be a variably modified type.Anders Carlsson2008-12-201-3/+4
| | | | | | | | | | | | Emit the size even if the declared type is a variably modified type. This lets us handle void f(int n) { int (*a)[n]; printf("size: %d\n", sizeof(*a)); } llvm-svn: 61285
* Split up emitting of VLA sizes and getting the size of a VLA.Anders Carlsson2008-12-201-1/+1
| | | | llvm-svn: 61284
* Add some ErrorUnsupported calls and turn on VLA codegen again.Anders Carlsson2008-12-201-9/+0
| | | | llvm-svn: 61283
* disable Anders' recent VLA patch, this fixes PR3209.Chris Lattner2008-12-131-0/+9
| | | | llvm-svn: 60989
* Implement allocation and sizeof VLAs. This is very basic for now.Anders Carlsson2008-12-121-5/+30
| | | | llvm-svn: 60943
* Migrate some stuff from NamedDecl::getName() to Chris Lattner2008-11-241-4/+4
| | | | | | NamedDecl::getNameAsString() to make it more explicit. llvm-svn: 59937
* Rename NamedDecl::getIdentifierName() to ::getNameAsCString() and make itChris Lattner2008-11-241-2/+4
| | | | | | | | | assert if the name is not an identifier. Update callers to do the right thing and avoid this method in unsafe cases. This also fixes an objc warning that was missing a space, and migrates a couple more to taking IdentifierInfo and QualTypes instead of std::strings. llvm-svn: 59936
* Introduction the DeclarationName class, as a single, general method ofDouglas Gregor2008-11-171-2/+2
| | | | | | | | representing the names of declarations in the C family of languages. DeclarationName is used in NamedDecl to store the name of the declaration (naturally), and ObjCMethodDecl is now a NamedDecl. llvm-svn: 59441
* reimplement debug info generation in terms of DebugInfo.h instead ofChris Lattner2008-11-101-10/+4
| | | | | | | using MachineModuleInfo. This runs at about the same speed as the old code, but fixes a bunch of bugs and is simpler and shorter. llvm-svn: 58971
* Made the mechanism of defining preprocessor defs for maxint, ptrdiff_t, wcharSanjiv Gupta2008-10-311-1/+1
| | | | | | | | | | etc more generic. For some targets, long may not be equal to pointer size. For example: PIC16 has int as i16, ptr as i16 but long as i32. Also fixed a few build warnings in assert() functions in CFRefCount.cpp, CGDecl.cpp, SemaDeclCXX.cpp and ParseDeclCXX.cpp. llvm-svn: 58501
* Change CGDebugInfo::setLocation to just ignore invalid locations. ThisDaniel Dunbar2008-10-171-6/+3
| | | | | | | | | simplifies clients. Also, add assert that RegionStack is empty when the CGDebugInfo is destroyed. llvm-svn: 57684
* Simplify handling of struct/union/class tags.Argyrios Kyrtzidis2008-10-151-6/+2
| | | | | | | Instead of using two sets of Decl kinds (Struct/Union/Class and CXXStruct/CXXUnion/CXXClass), use one 'Record' and one 'CXXRecord' Decl kind and make tag kind a property of TagDecl. Cleans up the code a bit and better reflects that Decl class structure. llvm-svn: 57541
* Add support for ABIArgInfo::ExpandDaniel Dunbar2008-09-171-2/+3
| | | | | | - No functionality change. llvm-svn: 56269
* Downgrade a number of FIXME asserts to ErrorUnsupported.Daniel Dunbar2008-08-291-13/+14
| | | | | | - Notably VLAs llvm-svn: 55544
* Handle static variables inside obj-c methods.Anders Carlsson2008-08-251-2/+6
| | | | llvm-svn: 55297
* Add preliminary (and probably broken) codegen support for C++ static ↵Anders Carlsson2008-08-221-1/+7
| | | | | | initializers. llvm-svn: 55180
* Add NeXT runtime support for generating methods.Daniel Dunbar2008-08-161-1/+4
| | | | | | | | | | | | | Change CodeGenFunction::EmitParmDecl to take either a ParmVarDecl or an ImplicitParamDecl. Drop hasAggregateLLVMType from CodeGenModule.cpp (use version in CodeGenFunction). Change the Objective-C method generation to use EmitParmDecl for implicit parameters. llvm-svn: 54838
* More #include cleaningDaniel Dunbar2008-08-111-0/+1
| | | | | | | | - Drop {Decl.h,DeclObjC.h,IdentifierTable.h} from Expr.h - Moved Sema::getCurMethodDecl() out of line (dependent on ObjCMethodDecl via dyn_cast). llvm-svn: 54629
* More #include cleaningDaniel Dunbar2008-08-111-1/+1
| | | | | | - Remove internal uses of AST.h llvm-svn: 54628
* Basic support for volatile loads and stores. Stores the volatile Eli Friedman2008-06-131-1/+1
| | | | | | | | | | 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
* Make CodeGenFunction::EmitDecl() recognise CXXClass/CXXStruct/CXXUnion.Argyrios Kyrtzidis2008-06-091-0/+3
| | | | llvm-svn: 52162
* Don't crash emitting an initializer for a static local with union type. Eli Friedman2008-06-081-3/+7
| | | | | | | This fix just makes sure to construct the global with the appropriate type, and fixes up the one user this affects to compensate. llvm-svn: 52084
* Emit debug information for global and static variables when -g is specified.Sanjiv Gupta2008-06-051-0/+9
| | | | llvm-svn: 51993
* Calculate alignment for local variables.Eli Friedman2008-05-311-2/+6
| | | | llvm-svn: 51826
* Emit parameter and local variable debug information with -g.Sanjiv Gupta2008-05-301-1/+22
| | | | llvm-svn: 51765
* Change uses of llvm::Type::isFirstClassType to use the newDan Gohman2008-05-221-2/+2
| | | | | | | | | | | | llvm::Type::isSingleValueType. Currently these two functions have the same behavior, but soon isFirstClassType will return true for struct and array types. Clang may some day want to use of isFirstClassType for some of these some day as an optimization, but it'll require some consideration. llvm-svn: 51446
* Add basic support for the pic-* target triples and add support forChris Lattner2008-05-081-12/+33
| | | | | | | | | targets that do not support recursion (and thus codegen stack variables as globals). Patch contributed by Alireza Moshtaghi! llvm-svn: 50844
* Generate code for annotation attributes.Nate Begeman2008-04-191-7/+15
| | | | llvm-svn: 49951
* Remove FileVarDecl and BlockVarDecl. They are replaced by ↵Steve Naroff2008-04-151-7/+8
| | | | | | | | 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
* remove the Decl::getCanonicalType() method.Chris Lattner2008-04-061-4/+3
| | | | llvm-svn: 49295
* Since isComplexType() no longer returns true for _Complex integers, the codeChris Lattner2008-04-041-1/+1
| | | | | | generator needs to call isAnyComplexType(). This fixes PR1960. llvm-svn: 49220
* Codegen assignment to self correctly, patch by David Chisnall!Chris Lattner2008-04-041-2/+2
| | | | llvm-svn: 49201
* Make a major restructuring of the clang tree: introduce a top-levelChris Lattner2008-03-151-0/+163
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
OpenPOWER on IntegriCloud