Daniel Dunbar [Sat, 21 Aug 2010 02:24:36 +0000 (02:24 +0000)]
IRgen: Change Emit{Load,Store}OfScalar to take a required Alignment argument and
update callers as best I can.
- This is a work in progress, our alignment handling is very horrible / sketchy -- I am just aiming for monotonic improvement.
- Serious review appreciated.
Fix an issue with writing to PCH another included PCH, introduced by the "using an AST on-disk hash table for name lookup" commit.
When including a PCH and later re-emitting to another PCH, the name lookup tables of DeclContexts
may be incomplete, since we now lazily deserialize the visible decls of a particular name.
Fix the issue by iterating over the un-deserialized visible decls and completing the lookup tables
of DeclContexts before writing them out.
Dan Gohman [Fri, 20 Aug 2010 22:02:57 +0000 (22:02 +0000)]
Introduce a new temporary MDNode concept. Temporary MDNodes are
not part of the IR, are not uniqued, and may be safely RAUW'd.
This replaces a variety of alternate mechanisms for achieving
the same effect.
objective-c ivar refactoring patch. Iterations
over ivars for a varienty of puposes is now
consolidated into two small routines; DeepCollectObjCIvars
and ShallowCollectObjCIvars.
John McCall [Fri, 20 Aug 2010 18:27:03 +0000 (18:27 +0000)]
Another step in the process of making the parser depend on Sema:
- move DeclSpec &c into the Sema library
- move ParseAST into the Parse library
Reflect this change in a thousand different includes.
Reflect this change in the link orders.
Douglas Gregor [Fri, 20 Aug 2010 16:57:37 +0000 (16:57 +0000)]
Fix a major regression with value-initialization of class types with
trivial default constructors. We're weren't zero-initializing them,
which manifested as <rdar://problem/8320532> (a regression in the GCC
test suite) and is likely to have caused significant other breakage.
Chris Lattner [Fri, 20 Aug 2010 16:08:33 +0000 (16:08 +0000)]
fix some vector extractions to return properly zero extended values
(instead of sign extending) to match ICC. GCC is changing this in
a series of their own PRs (e.g. 41323).
Use the AST on-disk hash table for name lookup inside a DeclContext.
*Huge* improvement over the amount of deserializing that we do for C++ lookup.
e.g, if he have the Carbon header precompiled and include it on a file containing this:
Refactoring; move the functionality of ASTWriter::GetOrCreateTypeID to the more generic
MakeTypeID template function which accepts a type and a function object that returns a TypeIdx.
MakeTypeID is in PCHCommon.h so that it can be used by ASTReader too.
serialization::TypeID is used with or without qualifiers, both as index and as index + qualifiers.
Disambiguate and provide some type safety by using a new class TypeIdx for the "TypeID as index" semantics.
Douglas Gregor [Fri, 20 Aug 2010 00:59:43 +0000 (00:59 +0000)]
When performing code-completion in the presence of a preamble, make
sure to (1) actually use the remapped files we were given rather
than old data, and (2) keep the remapped files alive until the
code-completion results are destroyed. Big thanks to Daniel for the
test case.
Daniel Dunbar [Thu, 19 Aug 2010 23:44:10 +0000 (23:44 +0000)]
libclang: Execute clang_codeCompleteAt() inside a crash recovery context.
- Test case is disabled for now, because something isn't write with file
remapping.
Daniel Dunbar [Thu, 19 Aug 2010 23:44:04 +0000 (23:44 +0000)]
c-index-test: As with reparse, only honor remapped false during the code
completion step with -code-completion-at=, to allow testing simulated source
changes.
Daniel Dunbar [Thu, 19 Aug 2010 19:40:40 +0000 (19:40 +0000)]
Fix a loop overrun in ComputePreamble when the last remapped file was erased,
and reenable crash recovery test.
- Reparsing is still very crashy / weird, so I had to sprinkle random code into
the remapped input to get it to do what I want (i.e., crash!).
Douglas Gregor [Thu, 19 Aug 2010 17:02:01 +0000 (17:02 +0000)]
We don't actually need to check the implicit object argument's
conversion a second time for a conversion candidate (with the real
acting context), because the only problems we would find are access or
ambiguity issues that won't be diagnosed until we pick this
candidate. Add a test case to prove it to myself.
Douglas Gregor [Thu, 19 Aug 2010 15:57:50 +0000 (15:57 +0000)]
Properly implement the part of C++ [over.match.funcs]p4 that treats
conversion functions as if their acting context were the class that
we're converting from (the implicit object argument's
type). Retroactively tweaking the implicit conversion sequence, as we
were trying to do before, breaks the invariants of that implicit
conversion sequence (e.g., the types and conversions don't match
up). Fixes <rdar://problem/8018274>.
Eli Friedman [Thu, 19 Aug 2010 06:13:01 +0000 (06:13 +0000)]
Remove default argument from operator delete; per report on cfe-dev, fixes
compilation with MSVC. Note that on other platforms, the operator delete in
question is never used because we compile with -fno-exceptions.
Eli Friedman [Thu, 19 Aug 2010 04:39:37 +0000 (04:39 +0000)]
Fix for PR7911 and PR7921: make isIntegralOrEnumerationType return false
for incomplete enum types. An incomplete enum can't really be treated as
an "integral or enumeration" type, and the incorrect treatment leads to
bad behavior for many callers.
This makes isIntegralOrEnumerationType equivalent to isIntegerType; I think
we should globally replace the latter with the former; thoughts?
Charles Davis [Thu, 19 Aug 2010 02:18:14 +0000 (02:18 +0000)]
Add some enum goodness as requested by Chris. Now instead of storing the
active C++ ABI as a raw string, we store it as an enum. This should improve
performance somewhat.
And yes, this time, I started from a clean build directory, and
all the tests passed. :)
Charles Davis [Thu, 19 Aug 2010 00:55:19 +0000 (00:55 +0000)]
Add a special RecordLayoutBuilder for the Microsoft C++ ABI.
All it does right now is add space for two vtable pointers instead of one
when a class has both virtual methods and virtual bases. This is a requirement
of the Microsoft ABI, since it has separate vtables for methods and bases. Other
stuff will come up over time, but we'll cross those bridges when we get to
them.
Douglas Gregor [Wed, 18 Aug 2010 23:38:21 +0000 (23:38 +0000)]
When creating an ASTUnit by parsing source code, set DisableFree to
false (not true), so that the CompilerInstance will actually free data
structures when it's done. This fixes a major leak with libclang's
in-process code completion.
Sean Hunt [Wed, 18 Aug 2010 23:23:40 +0000 (23:23 +0000)]
Generate Attr subclasses with TableGen.
Now all classes derived from Attr are generated from TableGen.
Additionally, Attr* is no longer its own linked list; SmallVectors or
Attr* are used. The accompanying LLVM commit contains the updates to
TableGen necessary for this.
Some other notes about newly-generated attribute classes:
- The constructor arguments are a SourceLocation and a Context&,
followed by the attributes arguments in the order that they were
defined in Attr.td
- Every argument in Attr.td has an appropriate accessor named getFoo,
and there are sometimes a few extra ones (such as to get the length
of a variadic argument).
Additionally, specific_attr_iterator has been introduced, which will
iterate over an AttrVec, but only over attributes of a certain type. It
can be accessed through either Decl::specific_attr_begin/end or
the global functions of the same name.
Daniel Dunbar [Wed, 18 Aug 2010 23:09:23 +0000 (23:09 +0000)]
CrashRecovery: Add #pragma clang __debug handle_crash, useful when debugging
CrashRecovery since it avoids sending a signal which may be intercepted by the
debugger.