Ted Kremenek [Thu, 18 Jun 2009 22:57:13 +0000 (22:57 +0000)]
libAnalysis:
- Remove the 'isFeasible' flag from all uses of 'Assume'.
- Remove the 'Assume' methods from GRStateManager. Now the only way to
create a new GRState with an assumption is to use the new 'assume' methods
in GRState.
Chris Lattner [Thu, 18 Jun 2009 05:55:53 +0000 (05:55 +0000)]
Fix a crash that can occur when a #pragma handler eats to the end of the
line, and when the pragma is at the end of a file. In this case, the last
token consumed could pop the lexer, invalidating CurPPLexer. Thanks to
Peter Thoman for pointing it out.
Ted Kremenek [Thu, 18 Jun 2009 01:23:53 +0000 (01:23 +0000)]
Remove more dependencies on GRStateRef. As a consequence, we can now
pretty-print a GRState object anywhere it is referenced (instead of
needing a GRStateRef of a GRStateManager handy).
Douglas Gregor [Wed, 17 Jun 2009 23:37:01 +0000 (23:37 +0000)]
Diagnose class members that shadow a template parameter. Fixes
<rdar://problem/6952203>.
To do this, we actually remove a not-quite-correct optimization in the
C++ name lookup routines. We'll revisit this optimization for the
general case once more C++ is working.
Steve Naroff [Wed, 17 Jun 2009 22:40:22 +0000 (22:40 +0000)]
First step toward fixing <rdar://problem/6613046> refactor clang objc type representation.
Add a type (ObjCObjectPointerType) and remove a type (ObjCQualifiedIdType).
This large/tedious patch is just a first step. Next step is to remove ObjCQualifiedInterfaceType. After that, I will remove the magic TypedefType for 'id' (installed by Sema). This work will enable various simplifications throughout clang (when dealing with ObjC types).
Ted Kremenek [Wed, 17 Jun 2009 22:06:03 +0000 (22:06 +0000)]
Class 'Environment' no longer should subclass llvm::FoldingSetNode.
Environment hasn't been uniqued in a FoldingSet for some time, so this
was just wasting a pointer in GRState.
Ted Kremenek [Wed, 17 Jun 2009 22:02:04 +0000 (22:02 +0000)]
Start moving in the direction of removing GRStateRef. Now each
GRState object has a direct reference to its GRStateManager, making
the functionality of GRStateRef redunandant. This will lead to some
nice API cleanup and code shrinking across libAnalysis.
Ted Kremenek [Tue, 16 Jun 2009 22:36:44 +0000 (22:36 +0000)]
RegionStoreManager:
- Add "sections" to RegionStoreManager.cpp to delineate functionality.
- Add new function "CreateFieldsOnlyRegionStoreManager" that uses the new
RegionStoreFeatures class to use a reduced set of features from
RegionStoreManager (in this case, only field-sensitivity). This isn't
completely hooked up yet.
Douglas Gregor [Tue, 16 Jun 2009 22:06:52 +0000 (22:06 +0000)]
Don't warn about -Winvalid-pch or -Wno-invalid-pch. Since we don't
search for PCH files that correspond to header inclusions, this option
does not make sense. Fixes <rdar://problem/6970322>.
Douglas Gregor [Tue, 16 Jun 2009 20:13:51 +0000 (20:13 +0000)]
Update Clang to include the InitializeAllTargets and
InitializeAllAsmPrinters LLVM headers. Also includes some minor fixes
for the CMake-based build with Xcode.
Devang Patel [Tue, 16 Jun 2009 18:02:02 +0000 (18:02 +0000)]
It is possible that main input file does not have any symbol with debug info. To handle this edge case, always create main compile unit first.
This fixes PR 4228.
Chris Lattner [Tue, 16 Jun 2009 16:18:48 +0000 (16:18 +0000)]
my refactoring of builtins changed target-specific builtins to only be
registered when PCH wasn't being used. We should always install (in BuiltinInfo)
information about target-specific builtins, but we shouldn't register any builtin
identifier infos. This fixes the build of apps that use PCH and target specific
builtins together.
Eli Friedman [Mon, 15 Jun 2009 09:57:52 +0000 (09:57 +0000)]
PR4388: get rid of an extra # line directive; in addition to being
unnecessary, this was causing issues for assembler-with-cpp mode, which
doesn't process the directive.
Chris Lattner [Mon, 15 Jun 2009 05:18:27 +0000 (05:18 +0000)]
Minor tweak to -fdiagnostics-print-source-range-info to make it print
ranges more similar to the console output. Consider:
#define FOO(X, Y) X/ Y
void foo(int *P, int *Q) {
FOO(P, Q);
}
Before we emitted:
t.c:4:3:{4:3-4:6}{4:3-4:6}: error: invalid operands to binary expression ('int *' and 'int *')
FOO(P, Q);
^~~~~~~~~
...
Note that while we underline the macro args that the range info just includes FOO
without its macros. This change teaches the printed ranges to include macro args
also so that we get:
t.c:4:3:{4:3-4:12}{4:3-4:12}: error: invalid operands to binary expression ('int *' and 'int *')
FOO(P, Q);
^~~~~~~~~
...
Chris Lattner [Mon, 15 Jun 2009 05:02:34 +0000 (05:02 +0000)]
Fix #pragma GCC system_header by making it insert a virtual linemarker into
the file at the point of the pragma. This allows clang to know that all
sourcelocations after the pragma are in a system header.
Chris Lattner [Mon, 15 Jun 2009 04:35:16 +0000 (04:35 +0000)]
If PCH refers to a file that doesn't exist anymore, emit a nice error
like:
fatal error: could not find file '1.h' referenced by PCH file
instead of aborting with an assertion failure, PR4219
Chris Lattner [Mon, 15 Jun 2009 01:09:11 +0000 (01:09 +0000)]
"GCC emits an __objc_class_name_{classname} symbol for every class, and a corresponding reference to this symbol for every compilation unit that references the class. This causes linker errors when you try linking a program which references some classes but doesn't define them. The attached patch implements this support in clang, so you can compile a class with clang, reference it in a file compiled with GCC, and have it all work correctly."
Douglas Gregor [Sun, 14 Jun 2009 08:02:22 +0000 (08:02 +0000)]
Introduce a SFINAE "trap" that keeps track of the number of errors
that were suppressed due to SFINAE. By checking whether any errors
occur at the end of template argument deduction, we avoid the
possibility of suppressing an error (due to SFINAE) and then
recovering so well that template argument deduction never detects that
there was a problem. Thanks to Eli for the push in this direction.
Douglas Gregor [Sun, 14 Jun 2009 07:33:30 +0000 (07:33 +0000)]
Update LLVM.
Implement support for C++ Substitution Failure Is Not An Error
(SFINAE), which says that errors that occur during template argument
deduction do *not* produce diagnostics and do not necessarily make a
program ill-formed. Instead, template argument deduction silently
fails. This is currently implemented for template argument deduction
during matching of class template partial specializations, although
the mechanism will also apply to template argument deduction for
function templates. The scheme is simple:
- If we are in a template argument deduction context, any diagnostic
that is considered a SFINAE error (or warning) will be
suppressed. The error will be propagated up the call stack via the
normal means.
- By default, all warnings and errors are SFINAE errors. Add the
NoSFINAE class to a diagnostic in the .td file to make it a hard
error (e.g., for access-control violations).
Note that, to make this fully work, every place in Sema that emits an
error *and then immediately recovers* will need to check
Sema::isSFINAEContext() to determine whether it must immediately
return an error rather than recovering.
Chris Lattner [Sun, 14 Jun 2009 01:54:56 +0000 (01:54 +0000)]
Sink the BuiltinInfo object from ASTContext into the
preprocessor and initialize it early in clang-cc. This
ensures that __has_builtin works in all modes, not just
when ASTContext is around.