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.
Tom Care [Wed, 18 Aug 2010 21:17:24 +0000 (21:17 +0000)]
Added psuedo-constant analysis and integrated it into the false positive reduction stage in IdempotentOperationChecker.
- Renamed IdempotentOperationChecker::isConstant to isConstantOrPseudoConstant to better reflect the function
- Changed IdempotentOperationChecker::PreVisitBinaryOperator to only run 'CanVary' once on undefined assumptions
- Created new PsuedoConstantAnalysis class and added it to AnalysisContext
- Changed IdempotentOperationChecker to exploit the new analysis
- Updated tests with psuedo-constants
- Added check to IdempotentOperationChecker to see if a Decl is const qualified
John McCall [Wed, 18 Aug 2010 19:18:59 +0000 (19:18 +0000)]
Contextual arity is a feature of mangling expressions; kill off
mangleCallExpression. Also, operator names with unknown arity should
be mangled as binary operators; this is actually covered by an oddly-
positioned sentence in the ABI document. Fixes PR7891.
Daniel Dunbar [Wed, 18 Aug 2010 18:43:14 +0000 (18:43 +0000)]
libclang: Implicitly enable crash recovery when using the libclang APIs. We may need to add an explicit API call, but hopefully we can make the crash recovery seamless enough that it doesn't make sense to turn it off.
John McCall [Wed, 18 Aug 2010 09:41:07 +0000 (09:41 +0000)]
Rip out the existing retroactive abstract-class usage checker,
which in a fit of zeal wanted to walk the entire translation unit,
and replace it with a new checker that walks the types of declarations
nested within the class. Also, look into templates when doing this.
Douglas Gregor [Wed, 18 Aug 2010 00:39:00 +0000 (00:39 +0000)]
Emit an error if an array is too large. We're slightly more strict
than GCC 4.2 here when building 32-bit (where GCC will allow
allocation of an array for which we can't get a valid past-the-end
pointer), and emulate its odd behavior in 64-bit where it only allows
63 bits worth of storage in the array. The former is a correctness
issue; the latter is harmless in practice (you wouldn't be able to use
such an array anyway) and helps us pass a GCC DejaGNU test.
Ted Kremenek [Tue, 17 Aug 2010 23:51:30 +0000 (23:51 +0000)]
TypedRegion::isBoundable() should return true by default. Since there is no TypedViewRegion anyore, it is not possible that the subclass (which doesn't override isBoundable) could return a null value type.
Introduce -Wunused-method option for warning on unused class methods in anonymous namespace.
This option is not part of the Unused diagnostic group until the warnings on llvm codebase are fixed
and we are ready to turn it on. Suggestion by Daniel.
Ted Kremenek [Tue, 17 Aug 2010 21:00:06 +0000 (21:00 +0000)]
Fix horrible CFG bug caused by a series of NullStmts appearing at the beginning of a do...while loop. This would cause
the body of the DoStmt to be disconnected from the preceding code.
Sebastian Redl [Tue, 17 Aug 2010 17:55:49 +0000 (17:55 +0000)]
Create a new Serialization module that contains all the PCH code, and will contain all the module code in the future. Update the Makefiles, CMake projects and the Xcode project. I hope I did everything right for Xcode. No functionality change.