|  | Commit message (Collapse) | Author | Age | Files | Lines | 
|---|
| | 
| 
| 
| 
| 
| 
| | attribute, we also care about those with the "constructor"
attribute. Fixes PR6521.
llvm-svn: 126055 | 
| | 
| 
| 
| 
| 
| | "used". Fixes <rdar://problem/8684363>.
llvm-svn: 125579 | 
| | 
| 
| 
| 
| 
| | dependency edge was reversed such that CodeGen depends on Frontend.
llvm-svn: 106065 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | "used" (e.g., we will refer to the vtable in the generated code) and
when they are defined (i.e., because we've seen the key function
definition). Previously, we were effectively tracking "potential
definitions" rather than uses, so we were a bit too eager about emitting
vtables for classes without key functions. 
The new scheme:
  - For every use of a vtable, Sema calls MarkVTableUsed() to indicate
  the use. For example, this occurs when calling a virtual member
  function of the class, defining a constructor of that class type,
  dynamic_cast'ing from that type to a derived class, casting
  to/through a virtual base class, etc.
  - For every definition of a vtable, Sema calls MarkVTableUsed() to
  indicate the definition. This happens at the end of the translation
  unit for classes whose key function has been defined (so we can
  delay computation of the key function; see PR6564), and will also
  occur with explicit template instantiation definitions.
 - For every vtable defined/used, we mark all of the virtual member
 functions of that vtable as defined/used, unless we know that the key
 function is in another translation unit. This instantiates virtual
 member functions when needed.
  - At the end of the translation unit, Sema tells CodeGen (via the
  ASTConsumer) which vtables must be defined (CodeGen will define
  them) and which may be used (for which CodeGen will define the
  vtables lazily). 
From a language perspective, both the old and the new schemes are
permissible: we're allowed to instantiate virtual member functions
whenever we want per the standard. However, all other C++ compilers
were more lazy than we were, and our eagerness was both a performance
issue (we instantiated too much) and a portability problem (we broke
Boost test cases, which now pass).
Notes:
  (1) There's a ton of churn in the tests, because the order in which
  vtables get emitted to IR has changed. I've tried to isolate some of
  the larger tests from these issues.
  (2) Some diagnostics related to
  implicitly-instantiated/implicitly-defined virtual member functions
  have moved to the point of first use/definition. It's better this
  way.
  (3) I could use a review of the places where we MarkVTableUsed, to
  see if I missed any place where the language effectively requires a
  vtable.
Fixes PR7114 and PR6564.
llvm-svn: 103718 | 
| | 
| 
| 
| 
| 
| | Our testing framework can't deal with disabled targets yet.
llvm-svn: 97719 | 
| | 
| 
| 
| 
| 
| | some builtins will rely on target knowledge.
llvm-svn: 97693 | 
| | 
| 
| 
| 
| 
| 
| | would have a higher respect for its own code. This is getting old, is this
warning really adding value?
llvm-svn: 91779 | 
| | 
| 
| 
| | llvm-svn: 90044 | 
| | 
| 
| 
| 
| 
| | This resolves the layering violation where CodeGen depended on Frontend.
llvm-svn: 86998 | 
| | 
| 
| 
| | llvm-svn: 81346 | 
| | 
| 
| 
| 
| 
| | - Primarily to discourage clients form making decisions based on the string.
llvm-svn: 79901 | 
| | 
| 
| 
| | llvm-svn: 74657 | 
| | 
| 
| 
| | llvm-svn: 74642 | 
| | 
| 
| 
| | llvm-svn: 74615 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | tentative definitions off to the ASTConsumer at the end of the
translation unit. 
Eliminate CodeGen's internal tracking of tentative definitions, and
instead hook into ASTConsumer::CompleteTentativeDefinition. Also,
tweak the definition-deferal logic for C++, where there are no
tentative definitions.
Fixes <rdar://problem/6808352>, and will make it much easier for
precompiled headers to cope with tentative definitions in the future.
llvm-svn: 69681 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | productions (except the already broken ObjC cases like @class X,Y;) in 
the parser that can produce more than one Decl return a DeclGroup instead
of a Decl, etc.
This allows elimination of the Decl::NextDeclarator field, and exposes
various clients that should look at all decls in a group, but which were
only looking at one (such as the dumper, printer, etc).  These have been
fixed.
Still TODO:
1) there are some FIXME's in the code about potentially using
DeclGroup for better location info.
2) ParseObjCAtDirectives should return a DeclGroup due to @class etc.
3) I'm not sure what is going on with StmtIterator.cpp, or if it can
   be radically simplified now.
4) I put a truly horrible hack in ParseTemplate.cpp.
I plan to bring up #3/4 on the mailing list, but don't plan to tackle
#1/2 in the short term.
llvm-svn: 68002 | 
| | 
| 
| 
| | llvm-svn: 67910 | 
| | 
| 
| 
| 
| 
| 
| | CodeGenModule.  Once there, add a new NoCommon option to
it and implement -fno-common.
llvm-svn: 67735 | 
| | 
| 
| 
| | llvm-svn: 64804 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | that every declaration lives inside a DeclContext.
Moved several things that don't have names but were ScopedDecls (and,
therefore, NamedDecls) to inherit from Decl rather than NamedDecl,
including ObjCImplementationDecl and LinkageSpecDecl. Now, we don't
store empty DeclarationNames for these things, nor do we try to insert
them into DeclContext's lookup structure.
The serialization tests are temporarily disabled. We'll re-enable them
once we've sorted out the remaining ownership/serialiazation issues
between DeclContexts and TranslationUnion, DeclGroups, etc.
llvm-svn: 62562 | 
| | 
| 
| 
| | llvm-svn: 57924 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | - Add CodeGenModule::EmitTopLevelDecl which uses switch on kind
   instead of ugly & slow dyn_cast chains.
 - Drop some simple forwarding methods into the ObjC runtime.
 - Privatize appropriate methods.
llvm-svn: 54827 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | ObjCProtocolDecl directly.
Implement CodeGen support for forward protocol decls (no-ops are so
    nice to implement).
Also moved CGObjCRuntime.h out of CodeGenModule.h
llvm-svn: 54709 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| | - Wired to -fnext-runtime and -fgnu-runtime options.
 - Defaults to GNU, no autoselection for NeXT.
Emit NeXT OBJC_IMAGE_INFO marker.
llvm-svn: 54651 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | - Kill unnecessary #includes in .cpp files. This is an automatic
   sweep so some things removed are actually used, but happen to be
   included by a previous header. I tried to get rid of the obvious
   examples and this was the easiest way to trim the #includes in one
   fell swoop.
 - We now return to regularly scheduled development.
llvm-svn: 54632 | 
| | 
| 
| 
| 
| 
| 
| 
| | - Drop Expr.h,RecordLayout.h from ASTContext.h (for DeclBase.h and
   SourceLocation.h)
 - Move ASTContext constructor into implementation
llvm-svn: 54627 | 
| | 
| 
| 
| 
| 
| | - Not currently accessible and completely non-functional.
llvm-svn: 54624 | 
| | 
| 
| 
| | llvm-svn: 54599 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| | ModuleBuilder now performs llvmgen in HandleTranslationUnit.
This patch follows from the discussion on the following thread on cfe-commits:
http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20080804/006849.html
llvm-svn: 54486 | 
| | 
| 
| 
| 
| 
| | ASTConsumer layers on top of LLVMCodeGen (another existing ASTConsumer) to emit bitcode files to disk.  This layering takes this logic out of clang.cpp and puts it directly into the ASTConsumer interface.  The benefit is that now --emit-llvm works with both serialized ASTs and regular source files.
llvm-svn: 54364 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | - No (intended) functionality change.
 - Primary purpose is to clearly separate (lazy) construction of
   globals that are a forward declaration or tentative definition from
   those that are the final definition.
 - Lazy construction is now encapsulated in
   GetAddrOf{Function,GlobalVar} while final definitions are
   constructed in EmitGlobal{Function,Var}Definition.
 
 - External interface for dealing with globals is now limited to
   EmitGlobal and GetAddrOf{Function,GlobalVar}.
 - Also updated helper functions dealing with statics, annotations,
   and ctors to be private.
llvm-svn: 54179 | 
| | 
| 
| 
| 
| 
| 
| 
| | - Killed useless CodeGenModule::EmitGlobalVarDeclarator, instead just
   recurse on any ScopedDecl.
 - Fix for <rdar://problem/6093838>
llvm-svn: 54162 | 
| | 
| 
| 
| 
| 
| | Implemented by David Chisnall!
llvm-svn: 51835 | 
| | 
| 
| 
| | llvm-svn: 51579 | 
| | 
| 
| 
| 
| 
| | information. This patch currently enables generation of line number debug information (stoppoints) and region begin/end debug information. The new files CGDebugInfo.h and CGDebugInfo.cpp implements the debug info manager class CGDebugInfo.
llvm-svn: 50848 | 
| | 
| 
| 
| 
| 
| 
| 
| | 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 | 
| | 
| 
| 
| 
| 
| | etoile runtime, patch by David Chisnall!
llvm-svn: 48969 | 
|  | 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 |