aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenModule.h
AgeCommit message (Collapse)AuthorFilesLines
2013-01-31Make sure that the Attribute object represents one attribute only.Bill Wendling1-4/+4
Several places were still treating the Attribute object as respresenting multiple attributes. Those places now use the AttributeSet to represent multiple attributes. llvm-svn: 174004
2013-01-25The standard ARM C++ ABI dictates that inline functions areJohn McCall1-2/+11
never key functions. We did not implement that rule for the iOS ABI, which was driven by what was implemented in gcc-4.2. However, implement it now for other ARM-based platforms. llvm-svn: 173515
2013-01-18[ubsan] Add support for -fsanitize-blacklistWill Dietz1-2/+13
llvm-svn: 172808
2013-01-14Topologically sort the link options generated for modules based onDouglas Gregor1-0/+3
module-import dependencies, so we'll get the link order correct for those silly linkers that need it. llvm-svn: 172459
2013-01-14Switch autolinking metadata format over to actual linker options, e.g.,Douglas Gregor1-6/+0
!0 = metadata !{metadata !"-lautolink"} !1 = metadata !{metadata !"-framework", metadata !"autolink_framework"} referenced from llvm.module.linkoptions, e.g., !llvm.module.linkoptions = !{!0, !1, !2, !3} This conceptually moves the logic for figuring out the syntax the linker will accept from LLVM into Clang. Moreover, it makes it easier to support MSVC's #pragma comment(linker, "some option") in the future, should anyone care to do so. llvm-svn: 172441
2013-01-14Implement parsing, AST, (de-)serialization, and placeholder globalDouglas Gregor1-0/+12
metadata for linking against the libraries/frameworks for imported modules. The module map language is extended with a new "link" directive that specifies what library or framework to link against when a module is imported, e.g., link "clangAST" or link framework "MyFramework" Importing the corresponding module (or any of its submodules) will eventually link against the named library/framework. For now, I've added some placeholder global metadata that encodes the imported libraries/frameworks, so that we can test that this information gets through to the IR. The format of the data is still under discussion. llvm-svn: 172437
2013-01-12Remove useless 'llvm::' qualifier from names like StringRef and others that areDmitri Gribenko1-1/+1
brought into 'clang' namespace by clang/Basic/LLVM.h llvm-svn: 172323
2013-01-02Rewrite #includes for llvm/Foo.h to llvm/IR/Foo.h as appropriate toChandler Carruth1-1/+1
reflect the migration in r171366. Re-sort the #include lines to reflect the new paths. llvm-svn: 171369
2012-12-20Rename llvm::Attributes to llvm::Attribute.Bill Wendling1-4/+4
llvm-svn: 170722
2012-12-20Revert r170500. It over-zealously converted *ALL* things named Attributes, ↵Bill Wendling1-4/+4
which is wrong here. llvm-svn: 170721
2012-12-19Rename the 'Attributes' class to 'Attribute'. It's going to represent a ↵Bill Wendling1-4/+4
single attribute in the future. llvm-svn: 170500
2012-12-04Sort all of Clang's files under 'lib', and fix up the broken headersChandler Carruth1-6/+6
uncovered. This required manually correcting all of the incorrect main-module headers I could find, and running the new llvm/utils/sort_includes.py script over the files. I also manually added quite a few missing headers that were uncovered by shuffling the order or moving headers up to be main-module-headers. llvm-svn: 169237
2012-11-15Use empty parens for empty function parameter list instead of '(void)'.Dmitri Gribenko1-2/+2
llvm-svn: 168041
2012-11-06Implement codegen for init_priority attribute properly - make sure itAnton Korobeynikov1-3/+10
works between the modules. No functionality change on Darwin/Windows. This fixes PR11480. llvm-svn: 167496
2012-10-11Add codegen support for __uuidof().Nico Weber1-0/+6
llvm-svn: 165710
2012-10-10Remove the final bits of Attributes being declared in the AttributeBill Wendling1-2/+2
namespace. Use the attribute's enum value instead. No functionality change intended. llvm-svn: 165611
2012-10-08Move TargetData to DataLayout.Micah Villmow1-4/+4
llvm-svn: 165395
2012-09-28Add basic support for adding !tbaa.struct metadata on llvm.memcpy calls forDan Gohman1-0/+1
struct assignment. llvm-svn: 164853
2012-09-27Revert 'Fix a typo 'iff' => 'if''. iff is an abreviation of if and only if. ↵Sylvestre Ledru1-4/+4
See: http://en.wikipedia.org/wiki/If_and_only_if Commit 164766 llvm-svn: 164769
2012-09-27Fix a typo 'iff' => 'if'Sylvestre Ledru1-4/+4
llvm-svn: 164766
2012-09-15Use LLVM_DELETED_FUNCTION in place of 'DO NOT IMPLEMENT' comments.Dmitri Gribenko1-2/+2
llvm-svn: 163983
2012-06-28Add -ftls-model command-line flag.Hans Wennborg1-9/+4
This allows for setting the default TLS model. (PR9788) llvm-svn: 159336
2012-06-26block literal irgen: several improvements on naming blockFariborz Jahanian1-1/+3
literal helper functions. All helper functions (global and locals) use block_invoke as their prefix. Local literal helper names are prefixed by their enclosing mangled function names. Blocks in non-local initializers (e.g. a global variable or a C++11 field) are prefixed by their mangled variable name. The descriminator number added to end of the name starts off with blank (for first block) and _<N> (for the N+2-th block). llvm-svn: 159206
2012-06-23Support the tls_model attribute (PR9788)Hans Wennborg1-0/+9
This adds support for the tls_model attribute. This allows the user to choose a TLS model that is better than what LLVM would select by default. For example, a variable might be declared as: __thread int x __attribute__((tls_model("initial-exec"))); if it will not be used in a shared library that is dlopen'ed. This depends on LLVM r159077. llvm-svn: 159078
2012-05-20CUDA: add CodeGen support for global variable address spaces.Peter Collingbourne1-0/+6
Because in CUDA types do not have associated address spaces, globals are declared in their "native" address space, and accessed by bitcasting the pointer to address space 0. This relies on address space 0 being a unified address space. llvm-svn: 157167
2012-05-01Refactor the C++ ABI code a little bit to take advantage ofJohn McCall1-0/+1
what I'm going to treat as basically universal properties of array-cookie code. Implement MS array cookies on top of that. Based on a patch by Timur Iskhodzhanov! llvm-svn: 155886
2012-03-30Make sure we unique static-local decls across multiple emissions ofJohn McCall1-0/+9
the function body, but do so in a way that doesn't make any assumptions about the static local actually having a proper, unique mangling, since apparently we don't do that correctly at all. llvm-svn: 153776
2012-03-30Revert r153723, and its follow-ups r153728 and r153733.Chandler Carruth1-1/+1
These patches cause us to miscompile and/or reject code with static function-local variables in an extern-C context. Previously, we were papering over this as long as the variables are within the same translation unit, and had not seen any failures in the wild. We still need a proper fix, which involves mangling static locals inside of an extern-C block (as GCC already does), but this patch causes pretty widespread regressions. Firefox, and many other applications no longer build. Lots of test cases have been posted to the list in response to this commit, so there should be no problem reproducing the issues. llvm-svn: 153768
2012-03-30Do the static-locals thing properly in the face of unions andJohn McCall1-1/+1
other things which might mess with the variable's type. llvm-svn: 153733
2012-03-26add tbaa metadata to vtable pointer loads/storesKostya Serebryany1-0/+1
llvm-svn: 153447
2012-03-11Unify naming of LangOptions variable/get function across the Clang stack ↵David Blaikie1-3/+3
(Lex to AST). The member variable is always "LangOpts" and the member function is always "getLangOpts". Reviewed by Chris Lattner llvm-svn: 152536
2012-03-09Make sure we update the static local decl address map when we are forced to ↵Eli Friedman1-5/+5
rebuild a global because of the initializer. <rdar://problem/10957867>. llvm-svn: 152372
2012-03-08Replace MarkVarRequired with a more genericRafael Espindola1-4/+3
HandleCXXStaticMemberVarInstantiation. Suggested by Argyrios. llvm-svn: 152320
2012-03-05Fix a small difference in sema and codegen views of what needs to be output.Rafael Espindola1-0/+5
In the included testcase, soma thinks that we already have a definition after we see the out of line decl. Codegen puts it in a deferred list, to be output if a use is seen. This would break when we saw an explicit template instantiation definition, since codegen would not be notified. This patch adds a method to the consumer interface so that soma can notify codegen that this decl is now required. llvm-svn: 152024
2012-03-02Reinstate r151879, r151880, reverted in r151922, along with a bugfix forRichard Smith1-2/+8
scalar emission of DeclRefExprs to const bools: emit scalar bools as i1, not as i8. In addition to the extra unit testing, this has successfully bootstrapped. llvm-svn: 151955
2012-02-25CodeGen support for global variables of type std::initializer_list<X>.Sebastian Redl1-0/+3
This emits a backing array with internal linkage and fills it with data, then has the initializer_list point at the array. Dynamic initialization and global destructors are correctly supported. What doesn't work is nested initializer_lists. I have no idea how to get them to work, either. However, these should be very rare, and so I'll just call it a known bug and declare generalized initializers DONE! llvm-svn: 151457
2012-02-17Bug fix: do not emit static const local variables with mutable membersRichard Smith1-0/+2
as constants. Refactor and simplify all the separate checks for whether a type can be emitted as a constant. llvm-svn: 150793
2012-02-16Teach clang to add metadata tags to calls and invokes in ObjC withDan Gohman1-0/+9
-fno-objc-arc-exceptions. This will allow the optimizer to perform optimizations which are only safe under that flag. This is a part of rdar://10803830. llvm-svn: 150644
2012-02-13Deal with a horrible C++11 special case. If a non-literal type has a constexprRichard Smith1-1/+4
constructor, and that constructor is used to initialize an object of static storage duration such that all members and bases are initialized by constant expressions, constant initialization is performed. In this case, the object can still have a non-trivial destructor, and if it does, we must emit a dynamic initializer which performs no initialization and instead simply registers that destructor. llvm-svn: 150419
2012-02-07simplify a bunch of code to use the well-known LLVM IR types computed by ↵Chris Lattner1-2/+4
CodeGenModule. llvm-svn: 149943
2012-02-06use cheaper llvm APIs for various bits of IR generation.Chris Lattner1-5/+0
llvm-svn: 149916
2012-01-20More dead code removal (using -Wunreachable-code)David Blaikie1-1/+0
llvm-svn: 148577
2012-01-14constexpr irgen: Add irgen support for APValue::Struct, APValue::Union,Richard Smith1-0/+10
APValue::Array and APValue::MemberPointer. All APValue values can now be emitted as constants. Add new CGCXXABI entry point for emitting an APValue MemberPointer. The other entrypoints dealing with constant member pointers are no longer necessary and will be removed in a later change. Switch codegen from using EvaluateAsRValue/EvaluateAsLValue to VarDecl::evaluateValue. This performs caching and deals with the nasty cases in C++11 where a non-const object's initializer can refer indirectly to previously-initialized fields within the same object. Building the intermediate APValue object incurs a measurable performance hit on pathological testcases with huge initializer lists, so we continue to build IR directly from the Expr nodes for array and record types outside of C++11. llvm-svn: 148178
2012-01-08objc++: more atomic property api code forFariborz Jahanian1-5/+14
c++ object properties. wip. llvm-svn: 147750
2012-01-06objc++: more code gen stuff for atomic property api,Fariborz Jahanian1-0/+10
currently turned off. // rdar://6137845 Also, fixes a test case which should be nonatomic under new API. llvm-svn: 147691
2011-12-19Extend the fix for PR9614 to handle inline asm in the outer decl andRafael Espindola1-1/+1
the inner decl being a builtin. This is needed to support the glibc headers in fedora 16 (2.14). llvm-svn: 146867
2011-11-22Use static storage duration for file-scope compound literals, even when theyRichard Smith1-0/+4
appear in non-constant initializers in C++. llvm-svn: 145087
2011-11-09Remove unnecessary include.Devang Patel1-1/+0
llvm-svn: 144210
2011-11-01Fix the representation of wide strings in the AST and IR so that it uses the ↵Eli Friedman1-0/+4
native representation of integers for the elements. This fixes a bunch of nastiness involving treating wide strings as a series of bytes. Patch by Seth Cantrell. llvm-svn: 143417
2011-10-31In x86_64, when calling an Objective-C method that returns a _Complex long ↵Anders Carlsson1-2/+6
double, make sure to use the objc_msgSend_fp2ret function which ensures that the return value will be {0, 0} if the receiver is nil. llvm-svn: 143350