that are not related to error nodes.
Fixed bug where we did not detect some NULL dereferences.
Added "ExplodedGraph::Trim" to trim all nodes that cannot transitively reach
a set of provided nodes.
Fixed subtle bug in ExplodedNodeImpl where we could create predecessor
iterators that included the mangled "sink" bit. The better fix is to integrate
this bit into the void* for the wrapped State, not the NodeGroups representing
a node's predecessors and successors.
llvm-svn: 48036
theoretically useful, but not useful in practice. It adds a bunch of
complexity, and not much value. It's best to nuke it. One big advantage
is that it means the target interfaces will soon lose their SLoc arguments
and target queries can never emit diagnostics anymore (yay). Removing this
also simplifies some of the core preprocessor which should make it slightly
faster.
Ted, I didn't simplify TripleProcessor, which can now have at most one
triple, and can probably just be removed. Please poke at it when you have
time.
llvm-svn: 47930
the system headers dir. This produces an annoying warning:
clang.cpp:883: warning: ISO C++ forbids casting between pointer-to-function and pointer-to-object
I'm not sure how to remove it. :(
llvm-svn: 47836
probably make this a separate command line option later.
Added "--analyze-function" option to the driver to (gradually) allow different
analyses to only be run on specific functions. Currently only --grsimple uses
this option.
llvm-svn: 47285
--grsimple except that it visualizes the ExplodedGraph using dot and
outputs the current function being analyzed. --grsimple is now silent
except when it emits diagnostics.
llvm-svn: 47146
level code in clang. This is a cleanup, but does implement "-o" for
-emit-llvm. One effect of this is that "clang foo.c -emit-llvm" will now
emit into foo.ll instead of stdout. Use "clang foo.c -emit-llvm -o -" or
"clang < foo.c -emit-llvm" to get the old behavior.
llvm-svn: 46791
both Preprocessor and ASTContext, we no longer need to explicitly pass
MainFileID around in function calls that also pass either Preprocessor or
ASTContext. This resulted in some nice cleanups in the ASTConsumers and the
driver.
llvm-svn: 45228
Added "SourceFile" string to TranslationUnit to record corresponding
source file.
Updated serialization of TranslationUnits and logic in the driver to
correctly pass the source file information to the serializer.
llvm-svn: 45211
warnings. This flag is the inverse of to GCC's -Wformat-nonliteral option (in
the clang driver, these warnings are on by default).
Patch provided by Shantonu Sen.
llvm-svn: 45103
the internal representation. This also fixes a bug where -I foo -F foo would
not search foo as both a normal and framework include dir.
llvm-svn: 45092
create a .ast file in the current working directory. This mirrors the behavior
of the -c option for gcc. Later we should add the ability to write the
serialized file anywhere.
llvm-svn: 45004
Moved all clients of Diagnostics to use FullSourceLoc instead of SourceLocation.
Added many utility methods to FullSourceLoc to provide shorthand for:
FullLoc.getManager().someMethod(FullLoc.getLocation());
instead we have:
FullLoc.someMethod();
Modified TextDiagnostics (and related classes) to use this short-hand.
llvm-svn: 44957
and into the "Basic" library. TargetInfo objects are now
constructed from triples by calling the static method
TargetInfo::CreateTargetInfo.
llvm-svn: 44940
SourceManager*'s instead of SourceManager&'s. This allows the client specify a
NULL SourceManager when using a default constructed SourceLocation. Thus the
SourceManager can be NULL when the SourceLocation's isValid() == false.
The interface to most clients of Diagnostic remains the same.
Diagnostic::Report() is overload to either accept a SourceLocation and a
SourceManager&, or neither. Thus clients that do not have a SourceManager
cannot specify a SourceLocation.
Modified TextDiagnostics* to use this new interface.
Modified the driver to not passed in SourceManager when warning about "-I-".
llvm-svn: 44887
SourceManager is passed by reference, allowing the SourceManager to be
associated with a specific translation unit, and not the entire execution
of the driver.
Modified all users of Diagnostics to comply with this new interface.
Integrated SourceManager as a member variable of TargetInfo. TargetInfo will
eventually be associated with a single translation unit (just like
SourceManager).
Made the SourceManager reference in ASTContext private. Provided accessor
getSourceManager() for clients to use instead. Modified clients to comply with
new interface.
llvm-svn: 44878
GetLanguage, and InitializeLangOptions. The goal is to break up this logic
into atomic units of functionality that can later be refactored into better
driver logic that is capable of handling a mixture of source files of
different languages.
llvm-svn: 44642
deserialized ASTs into the function CreateASTConsumer(). This function
is called by ProcessInputFile, and soon the logic that processes deserialized
ASTs.
llvm-svn: 44618
we default to "i386-apple-darwin". This is an interim solution.
Removed processing of "linux" triples from Targets.cpp, since we don't have
any sensical Linux target support (yet).
Cleaned up error processing of targets; added better diagnostics.
llvm-svn: 44560
replaces the functionality previously provided by just "-arch" (which is still
supported but has different semantics).
The new behavior is as follows:
(1) If the user does not specify -triple:
(a) If no -arch options are specified, the target triple used is the host
triple (in llvm/Config/config.h).
(b) If one or more -arch's are specified (and no -triple), then there is
one triple for each -arch, where the specified arch is substituted
for the arch in the host triple. Example:
host triple = i686-apple-darwin9
command: clang -arch ppc -arch ppc64 ...
triples used: ppc-apple-darwin9 ppc64-apple-darwin9
(2) The user does specify a -triple (only one allowed):
(a) If no -arch options are specified, the triple specified by -triple
is used. E.g clang -triple i686-apple-darwin9
(b) If one or more -arch options are specified, then the triple specified
by -triple is used as the primary target, and the arch's specified
by -arch are used to create secondary targets. For example:
clang -triple i686-apple-darwin9 -arch ppc -arch ppc64
has the following targets:
i686-apple-darwin9 (primary target)
ppc-apple-darwin9
ppc64-apple-darwin9
Other changes related to the changes to the driver:
- TargetInfoImpl now includes the triple string.
- TargetInfo::getTargetTriple returns the triple for its primary target.
- test case test/Parser/portability.c has been updated because "-arch linux" is
no longer valid ("linux" is an OS, not an arch); instead we use a bogus
architecture "bogusW16W16" where WCharWidth=16 and WCharAlign=16.
llvm-svn: 44551
serialization logic as well as driver code is now in
Driver/SerializationTest.cpp. The status of this code is that it
should be used by no clients.
Added --test-pickling option to driver to run the serialization code.
Modified IdentifierInfo and IdentifierTable to have friend classes
that permit object serialization. Such friendship may not be needed
in the final design.
llvm-svn: 43052
predefined macros. Previously, these were handled by the driver,
now they are handled by the preprocessor.
Some fallout of this:
1. Instead of preprocessing two buffers (the predefines, then the
main source file) we now start preprocessing the main source
file and inject the predefines as a "psuedo #include" from the
main source file.
2. #1 allows us to nuke the Lexer::IsMainFile flag and simplify
Preprocessor::isInPrimaryFile.
3. The driver doesn't have to know about standard #defines, the
preprocessor knows, which is nice for people wanting to define
their own drivers.
4. This allows us to put normal tokens in the predefine buffer,
for example a definition for __builtin_va_list that is
target-specific, and a typedef for id in objc.
llvm-svn: 42818