Argyrios Kyrtzidis
081148986a
Parsing of namespaces:
...
-NamespaceDecl for the AST
-Checks for name clashes between namespaces and tag/normal declarations.
This commit doesn't implement proper name lookup for namespaces.
llvm-svn: 50321
2008-04-27 13:50:30 +00:00
Argyrios Kyrtzidis
ed1eec4812
Use PushOnScopeChains to introduce a decl into scope.
...
llvm-svn: 50320
2008-04-27 13:30:35 +00:00
Argyrios Kyrtzidis
fa2d2f2886
Make assertions for all addresses passed to ProgramPoint that they have at least an 8-byte alignment.
...
llvm-svn: 50310
2008-04-26 15:19:51 +00:00
Ted Kremenek
e5aa10cec4
Pass down more -iXXX options that clang supports
...
llvm-svn: 50304
2008-04-25 21:28:20 +00:00
Ted Kremenek
d71ba91a7d
fix broken tag
...
llvm-svn: 50299
2008-04-25 20:31:58 +00:00
Ted Kremenek
c7dde7a25b
Another link fix.
...
llvm-svn: 50298
2008-04-25 20:30:34 +00:00
Ted Kremenek
d6db434162
Fix links.
...
llvm-svn: 50297
2008-04-25 20:29:37 +00:00
Ted Kremenek
dd38e0bd0d
Fix bug in BugReporter where we didn't handle emitting diagnostics for
...
empty CFGBlocks that only contained a terminator.
Added improved diagnostics for break and continue statements and default branches in switch statements.
This fixes <rdar://problem/5889244>.
llvm-svn: 50286
2008-04-25 19:01:27 +00:00
Ted Kremenek
6d2eeddff5
Added some notes about the LLVM "checker". This isn't a public link yet; still refining.
...
llvm-svn: 50283
2008-04-25 18:44:36 +00:00
Chris Lattner
73669defed
remove the 'unused static' diagnostic from codegen. This should be
...
reimplemented in Sema someday. This is tracked in PR2236. Until then
disabling it removes some bogus diagnostics (see 2236).
llvm-svn: 50263
2008-04-25 15:47:13 +00:00
Nuno Lopes
0276933b4b
initial support for recognizing __transparent_union__ attributes
...
comments on the ML will follow
llvm-svn: 50262
2008-04-25 09:32:00 +00:00
Ted Kremenek
99131c9f5a
Handle dereferences of function pointers (which return a handle to the function).
...
llvm-svn: 50246
2008-04-25 01:56:50 +00:00
Ted Kremenek
2e5092320e
Don't abort on GetRVal when the LVal is a StringLiteralVal.
...
llvm-svn: 50245
2008-04-25 01:45:38 +00:00
Ted Kremenek
4dd412e022
Don't emit empty strings for path diagnostics when taking the default branch of a switch statement that has no label.
...
llvm-svn: 50242
2008-04-25 01:29:56 +00:00
Ted Kremenek
ecbdf75049
Do a better job at computing dead symbols.
...
Implemented support for better localized leaks in the CF reference count checker.
Now leaks should be flagged close to where they occur.
This should implement the desired functionality in <rdar://problem/5879592>, although the diagnostics still need to be improved.
llvm-svn: 50241
2008-04-25 01:25:15 +00:00
Ted Kremenek
b0daf2f6f5
Add preliminary support for flagging leaks around when they happen (doesn't work yet).
...
llvm-svn: 50237
2008-04-24 23:57:27 +00:00
Ted Kremenek
64fa3beccc
Better handling for directory names in HTML diagnostics. Work in progress.
...
llvm-svn: 50234
2008-04-24 23:37:03 +00:00
Ted Kremenek
ae8014cb7e
More boilerplate for handling specialized-transfer function logic for dead symbols.
...
llvm-svn: 50233
2008-04-24 23:35:58 +00:00
Fariborz Jahanian
0a070ff570
Patch to diagnose inconsistancies between properties declared in current and
...
its super class. This patch is incomplete.
llvm-svn: 50228
2008-04-24 19:58:34 +00:00
Ted Kremenek
3812b7676c
Added initial boilerplate in GRExprEngine to allow checker-specific transfer
...
function logic to act when symbols become dead.
llvm-svn: 50221
2008-04-24 18:31:42 +00:00
Ted Kremenek
6e06f91085
Added uninitialized-values (path-sensitive) test case as a regression test
...
for the fix in r50178 (http://llvm.org/viewvc/llvm-project?rev=50178&view=rev ).
This fix was for <rdar://problem/5881148>.
llvm-svn: 50220
2008-04-24 18:28:14 +00:00
Ted Kremenek
78120c8b3a
Added test case for functionality fix in rdar://problem/5886141 (handle variadic CF Create functions).
...
llvm-svn: 50219
2008-04-24 18:17:14 +00:00
Ted Kremenek
f7141597e8
CF reference count checker: handle variadic functions that allocate CF objects.
...
This fixes <rdar://problem/5886141>.
Part of this change resulted in creating sparser summaries. I also added
some more comments and did some minor code cleanups.
llvm-svn: 50214
2008-04-24 17:22:33 +00:00
Ted Kremenek
b44485b835
Have ValidateOutputConstraint return false instead of firing an assertion
...
when processing a constraint we don't understand. This allows the frontend
to gracefully fail.
llvm-svn: 50213
2008-04-24 16:36:38 +00:00
Ted Kremenek
21bf6006b0
For case statements involving enums, BugReporter now generates PathDiagnostics
...
that say that we are jumping to "case a" instead of "case 0".
This is a feature implementation for <rdar://problem/5880430>.
llvm-svn: 50197
2008-04-23 23:35:07 +00:00
Ted Kremenek
05e6267466
Fix minor regression in bug report generation.
...
llvm-svn: 50195
2008-04-23 23:04:32 +00:00
Ted Kremenek
f26bc55b9a
When building PathDiagnostics for bug reports, generate a trimmed ExplodedGraph with a single path that BugReport objects can safely walk and introspect.
...
llvm-svn: 50194
2008-04-23 23:02:12 +00:00
Ted Kremenek
dd43aeee54
Fixed: <rdar://problem/5881148>
...
Problem:
In the recently refactored VisitDeref (which processes dereferences), we
were incorrectly skipping the node just generated for the subexpression
of the dereference. This was a horrible regression.
llvm-svn: 50176
2008-04-23 20:12:28 +00:00
Ted Kremenek
467297ab48
TranslationUnit now owns IdentifierTable, TargetInfo, and Selectors objects
...
when it is constructed via deserialization. This is done by recording a flag
indicating that this is the case, and it deletes these objects by getting
the references stored in the ASTContext object. This fixes some memory
leaks that occurs when we deserialize translation units from bitcode files.
The rationale between having TranslationUnit sometimes own these objects and
sometimes not is that a TranslationUnit object can be constructed from
state generated by the parser (Preprocessor; semantic analyzer, etc.), and thus
in these cases won't own the IdentifierTable or Selectors, etc. During
deserialization, there is no Preprocessor, so somebody needs to own these
objects in order for them to be properly reclaimed.
llvm-svn: 50149
2008-04-23 16:25:39 +00:00
Ted Kremenek
d2419a0730
Remove false path where the default branch in a switch statement would
...
always be taken even if it was not feasible.
llvm-svn: 50132
2008-04-23 05:03:18 +00:00
Chris Lattner
68a27fac9d
fix a rewriter crash on zero length files.
...
llvm-svn: 50126
2008-04-23 03:21:50 +00:00
Ted Kremenek
ef9af73887
Added panic function "assfail".
...
llvm-svn: 50119
2008-04-23 00:41:25 +00:00
Fariborz Jahanian
6efdf1ddab
Patch to build AST for property implementation declarations and
...
to print declaration from its AST.
llvm-svn: 50117
2008-04-23 00:06:01 +00:00
Ted Kremenek
0224ac57e0
For default branches in switch statements with no default label, print out
...
the line we are going to.
llvm-svn: 50113
2008-04-22 22:29:46 +00:00
Ted Kremenek
3b42715930
Rewrote VisitDeclStmt to properly handle initializers that can do anything.
...
llvm-svn: 50112
2008-04-22 22:25:27 +00:00
Ted Kremenek
c79c0591d6
Added lval type (and tracking) for StringLiterals.
...
llvm-svn: 50109
2008-04-22 21:39:21 +00:00
Ted Kremenek
eccf3e5821
Added "nonlval::LValAsInteger" to represent abstract LVals casted to integers, allowing us to track lvals when they are casted back to pointers.
...
llvm-svn: 50108
2008-04-22 21:10:18 +00:00
Chris Lattner
bec41348e2
"This patch renames
...
DeclContext *CtxDecl -> DeclContext *DeclCtx
DeclContext *CD -> DeclContext *DC
It makes the code more consistent."
Patch by Zhongxing Xu!
llvm-svn: 50105
2008-04-22 18:39:57 +00:00
Ted Kremenek
9718c9e8ee
PathDiagnosticClients now retain ownership of passed PathDiagnostics, requiring
...
them to not be stack-allocated.
HTMLDiagnostics now batches PathDiagnostics before emitting HTML in its dtor.
This is a workaround for a problem when we trampled the Preprocessor state
when highlighting macros (sometimes resulting in an assertion failure).
llvm-svn: 50102
2008-04-22 16:15:03 +00:00
Argyrios Kyrtzidis
901a4e406b
Use back() instead of end()-1
...
llvm-svn: 50098
2008-04-22 07:37:18 +00:00
Ted Kremenek
80f2c111bd
Added panic function "dtrace_assfail".
...
llvm-svn: 50091
2008-04-22 06:09:33 +00:00
Ted Kremenek
24d4888a85
Add VisitArraySubscriptExpr.
...
llvm-svn: 50090
2008-04-22 05:40:28 +00:00
Ted Kremenek
a2cca7dbdf
Hardcode "Assert" as a no-return function (panic).
...
llvm-svn: 50089
2008-04-22 05:37:33 +00:00
Nate Begeman
2908fa0715
Add some basic ARM asm constraints
...
llvm-svn: 50085
2008-04-22 05:03:19 +00:00
Ted Kremenek
6fdd3b35dc
Added null dereference test involving arrays.
...
llvm-svn: 50084
2008-04-22 04:56:55 +00:00
Ted Kremenek
da5cdda248
Added null-dereference check for ArraySubscriptExpr.
...
llvm-svn: 50083
2008-04-22 04:56:29 +00:00
Nate Begeman
f0168bd208
Don't double-increment counter for -arch and -isysroot
...
llvm-svn: 50082
2008-04-22 04:47:32 +00:00
Fariborz Jahanian
a591a12ea5
Allow property in base class to be implemented in a
...
derived class.
llvm-svn: 50074
2008-04-21 23:57:08 +00:00
Ted Kremenek
efa92f1dfc
Added missing expected-warning.
...
llvm-svn: 50073
2008-04-21 23:45:26 +00:00
Ted Kremenek
503924bb9c
Added null dereference test case looking for null dereferences involving MemberExpr.
...
llvm-svn: 50072
2008-04-21 23:44:17 +00:00
Ted Kremenek
38213f9573
Added support for detected bad dereferences involving MemberExprs, e.g. x->f where "x" is NULL.
...
llvm-svn: 50071
2008-04-21 23:43:38 +00:00
Ted Kremenek
405cf2daf9
Remove unused "verbose" argument to compile(). Also unbreaks ccc-analyzer.
...
llvm-svn: 50066
2008-04-21 21:58:05 +00:00
Fariborz Jahanian
c6bec7b6dc
More semantics checks of properties. Property implementation can implicitly use
...
ivar of same name.
Better diagnostics to bring home this point.
llvm-svn: 50065
2008-04-21 21:57:36 +00:00
Fariborz Jahanian
f2a7d7c949
Support for @dynamic AST build.
...
More property semantics checking.
First test case for ObjC2's property implementation.
llvm-svn: 50057
2008-04-21 21:05:54 +00:00
Ted Kremenek
74a58d780a
Pass "-arch" down to clang.
...
llvm-svn: 50056
2008-04-21 20:28:01 +00:00
Chris Lattner
0dcd9aa8fd
Fix pasto, thanks to Anders for pointing this out.
...
llvm-svn: 50055
2008-04-21 20:19:54 +00:00
Fariborz Jahanian
a054e99fa8
Continuation of work on ObjC2's properties.
...
Added iterators, methods to find property and categories.
Use them in doing semantic analysis on property implementation
declarations. Fixed typos.
llvm-svn: 50050
2008-04-21 19:04:53 +00:00
Chris Lattner
17df24e736
add arm support
...
llvm-svn: 50049
2008-04-21 18:56:49 +00:00
Douglas Gregor
89f238cbe1
Clean up handling of function redeclarations
...
llvm-svn: 50021
2008-04-21 02:02:58 +00:00
Ted Kremenek
5fa90e49a9
Fix improper dereference of end() iterator. Patch by Argiris Kirtzidis!
...
llvm-svn: 50012
2008-04-20 23:54:24 +00:00
Nate Begeman
1c906206b8
Fix PR2236
...
Add test
Implement feedback from Chris re: PR1998
llvm-svn: 50001
2008-04-20 20:38:08 +00:00
Chris Lattner
14cd1ee95f
Two improvements to initializer parsing:
...
1. If we hit a semantic error, try harder to recover to emit
diagnostics for later initializer errors (PR2241).
2. Don't leak parsed initializers on an error.
llvm-svn: 49998
2008-04-20 19:07:56 +00:00
Chris Lattner
4885b97664
for exponent-related errors, emit the diagnostic on the 'e' or 'p'.
...
llvm-svn: 49997
2008-04-20 18:47:55 +00:00
Chris Lattner
48a9b9beeb
when emitting diagnostics about some character in a numeric
...
literal, indicate what character the error is about or where
it would be. For example:
pr2241.c:1:17: error: exponent has no digits
float f[] = { 1e , 1ee0 };
^
llvm-svn: 49996
2008-04-20 18:41:46 +00:00
Nate Begeman
8e8d498d34
Only generate code for static functions and global variables that are actually used.
...
Warn about unused static functions and variables.
This fixes PR1998.
llvm-svn: 49987
2008-04-20 06:29:50 +00:00
Chris Lattner
2cc4e23252
Restructure and simplify Sema::ObjCQualifiedIdTypesAreCompatible,
...
deleting dead code, making other code more obvious, and fixing a
bug. This fixes these (bogus) warnings in release mode:
SemaExprObjC.cpp:383: warning: 'RHSProtoE' may be used uninitialized in this function
SemaExprObjC.cpp:383: warning: 'RHSProtoI' may be used uninitialized in this function
llvm-svn: 49984
2008-04-20 02:09:31 +00:00
Ted Kremenek
076d13387d
html::EscapeText (using the Rewriter) now replaces tabs by default.
...
llvm-svn: 49982
2008-04-20 01:02:33 +00:00
Chris Lattner
ff2367c0c9
implement a fixme, add support for ++/-- on long double.
...
llvm-svn: 49980
2008-04-20 00:50:39 +00:00
Chris Lattner
1886e71e47
use simplified ConstantFP:get method.
...
llvm-svn: 49979
2008-04-20 00:45:53 +00:00
Chris Lattner
1e517a78a8
replace form feeds with an <hr> tag.
...
llvm-svn: 49975
2008-04-19 23:56:30 +00:00
Chris Lattner
1a44f7fce9
simplify the return of InitializePreprocessor to be bool instead of a fileid
...
llvm-svn: 49974
2008-04-19 23:25:44 +00:00
Chris Lattner
ba1f37bfdf
simplify ownership of the predefines buffer.
...
llvm-svn: 49973
2008-04-19 23:09:31 +00:00
Ted Kremenek
575f24ef73
Gracefully handle when the receiver of a message expression is not a pointer type.
...
llvm-svn: 49959
2008-04-19 19:12:50 +00:00
Ted Kremenek
31d2176d1e
Pass "-isysroot" option down to clang.
...
llvm-svn: 49956
2008-04-19 18:42:26 +00:00
Ted Kremenek
6267835f57
Fix spelling/grammar in comment.
...
llvm-svn: 49955
2008-04-19 18:07:44 +00:00
Ted Kremenek
b0fa31cefb
Use Digest::MD5 (a Perl module that should come bundled standard with Perl) to compute file digests instead of using the external program "sha1sum" (which may not be present).
...
llvm-svn: 49954
2008-04-19 18:05:48 +00:00
Nate Begeman
faae081131
Generate code for annotation attributes.
...
llvm-svn: 49951
2008-04-19 04:17:09 +00:00
Nate Begeman
7fab578b0d
Add support to module codegen for adding and emitting annotations
...
llvm-svn: 49944
2008-04-18 23:43:57 +00:00
Nate Begeman
46bd037c07
Ignore qualifiers when attempting to match arguments to parameter types for
...
__builtin_overload
llvm-svn: 49943
2008-04-18 23:35:14 +00:00
Nate Begeman
ce4d7fce6b
OCUVector -> ExtVector, shorthand for extended vector, per feedback from Chris.
...
llvm-svn: 49942
2008-04-18 23:10:10 +00:00
Ted Kremenek
423edc2384
Another bug fix in emitting warnings without a path: construct a unit PathDiagnostic as we did
...
before. This allows the HTMLDiagnostic object to retrieve the bug type, bug description, etc.
llvm-svn: 49939
2008-04-18 22:56:53 +00:00
Nuno Lopes
42dd577238
fix __attribute__(format) for struct function pointer fields
...
llvm-svn: 49938
2008-04-18 22:43:39 +00:00
Steve Naroff
472cf88ef2
Remove bogus cast (<rdar://problem/5874848> clang objc-rewriter: structure with list of protocols has wrong cast).
...
llvm-svn: 49935
2008-04-18 22:15:15 +00:00
Ted Kremenek
bf27dc9659
Reenable using the PathDiagnosticClient for BugReports without paths.
...
llvm-svn: 49934
2008-04-18 22:11:59 +00:00
Ted Kremenek
cf9e9c5554
Use 'clang' binary in the same dir as scan-build; if it isn't there use the one in the path
...
llvm-svn: 49933
2008-04-18 22:00:56 +00:00
Steve Naroff
24840f6748
Implement FIXME discoved by <rdar://problem/5874876> Rewriter: Explicit ivar refs outside a method are being rewritten
...
llvm-svn: 49932
2008-04-18 21:55:08 +00:00
Ted Kremenek
8886b3021e
Turn on CF reference count checker.
...
llvm-svn: 49931
2008-04-18 21:53:01 +00:00
Steve Naroff
dcdcdcdfef
Fix <rdar://problem/5874697> Rewriter: method arguments with complex types not being rewritten properly.
...
llvm-svn: 49925
2008-04-18 21:13:19 +00:00
Ted Kremenek
31484b2477
Generalize caching mechanism for bugs reports. Now individual BugTypes
...
can decide the policy on how to cache related bugs. This allows us to
properly to handle warning about multiple leaks in the same location in the
ref count checker (not yet done).
llvm-svn: 49918
2008-04-18 20:54:29 +00:00
Ted Kremenek
c072b820cf
Fixed more caching bugs related to the one fixed in r49914. Silence
...
compiler warning introduced by a recent patch of mine.
llvm-svn: 49917
2008-04-18 20:35:30 +00:00
Ted Kremenek
acefba896c
Fixed elusive caching bug that led to false positives.
...
llvm-svn: 49914
2008-04-18 19:34:16 +00:00
Ted Kremenek
4d83728a57
Added "GetErrorNodes()" to BugType so that -trim-egraph can recognize errors
...
from registered BugTypes. This helps with debugging.
Add detection of NULL values in ref count checker; this suppresses false positives.
llvm-svn: 49912
2008-04-18 19:23:43 +00:00
Ted Kremenek
3388381993
Added "EvalAssume" virtual method to GRTransferFuncs; this is for evaluating
...
the checker-specific logic of symbolic assumptions.
llvm-svn: 49910
2008-04-18 17:20:23 +00:00
Nate Begeman
65bea23674
Tabs -> spaces
...
llvm-svn: 49909
2008-04-18 17:17:24 +00:00
Ted Kremenek
532ba14fdb
Spelling fix.
...
llvm-svn: 49908
2008-04-18 16:58:34 +00:00
Ted Kremenek
d004c418b6
Fixed bug in GREndPathNodeBuilder: only return a node if it wasn't in the node cache.
...
llvm-svn: 49907
2008-04-18 16:30:14 +00:00
Ted Kremenek
b06817e914
scan-build now fixes permissions of report files and directories, which may
...
be created as "temporary files" that are not world readable.
llvm-svn: 49904
2008-04-18 15:18:20 +00:00
Ted Kremenek
4bf02a0856
Compute a digest of each report file, and nuke reports that have the same
...
digest as a file already added to the index. This a workaround for the
analyzer analyzing the same file more than once, which can happen when building
multiple targets.
llvm-svn: 49903
2008-04-18 15:09:30 +00:00
Nate Begeman
c00bed3871
Initialize default double width and alignment
...
llvm-svn: 49899
2008-04-18 05:49:49 +00:00
Nate Begeman
26ed25253e
Allow targets to override double size, alignment, and semantics, and tie this
...
information into the IR type codegen. This allows a target to codegen the C
'double' type as either double or float.
llvm-svn: 49898
2008-04-18 05:41:31 +00:00
Ted Kremenek
71c41d9561
Restore macro expansion for HTMLPrint by using the original Preprocessor.
...
This is a workaround until we figure out why a freshly create Preprocessor
doesn't expand macros from headers.
llvm-svn: 49897
2008-04-18 05:35:23 +00:00
Ted Kremenek
a960be4bd4
Provide a version of html::HighlightMacros that takes a Preprocessor&.
...
llvm-svn: 49896
2008-04-18 05:34:33 +00:00
Ted Kremenek
f03e07c34d
More grammar fixes.
...
llvm-svn: 49895
2008-04-18 05:32:44 +00:00
Ted Kremenek
ca8892b456
Fix plurality debacle.
...
llvm-svn: 49894
2008-04-18 05:13:26 +00:00
Ted Kremenek
9e48b0c4ed
Fixed range highlighting bug in HTML diagnostics.
...
llvm-svn: 49893
2008-04-18 05:01:33 +00:00
Ted Kremenek
40d601f958
Added path diagnostics for reference counts.
...
llvm-svn: 49892
2008-04-18 04:55:01 +00:00
Chris Lattner
4bbd164a7a
Make tab insertion really right: the number of spaces inserted
...
depends on the column number of the start of the tab.
llvm-svn: 49891
2008-04-18 04:54:20 +00:00
Ted Kremenek
c88fb63da0
Several Expr subclasses did not mark "getSourceRange()" virtual. Fixed.
...
llvm-svn: 49890
2008-04-18 04:18:16 +00:00
Ted Kremenek
396f43620f
BugReport::VisitNode now takes BugReporter& instead of ASTContext&.
...
Shuffled around code in CFRefCount to better pair classes with implementation,
and started adding subclasses of RangedBugReport to handle better diagnostics
for reference count bugs.
llvm-svn: 49889
2008-04-18 03:39:05 +00:00
Ted Kremenek
a3d02636ef
Use HTML5 doctype when generating HTML.
...
llvm-svn: 49888
2008-04-18 03:37:38 +00:00
Ted Kremenek
89e6a9b98c
Added null check.
...
llvm-svn: 49887
2008-04-18 02:24:50 +00:00
Ted Kremenek
a821e087de
Updated CSS colors. Patch by Cedric Venet!
...
llvm-svn: 49886
2008-04-18 02:12:39 +00:00
Ted Kremenek
217e9bff2b
Added test cases to test for reference count leaks.
...
llvm-svn: 49885
2008-04-18 02:00:02 +00:00
Ted Kremenek
cffe635699
Simplified internal logic of BugReporter, consolidating EmitWarning and
...
EmitPathWarning into one method. We now properly handle emitting warnings
without a PathDiagnosticClient when the warning does not involve a particular
statement.
llvm-svn: 49884
2008-04-18 01:56:37 +00:00
Fariborz Jahanian
d83bdd3841
Fixed a bug in categories and properties.
...
llvm-svn: 49883
2008-04-18 00:30:47 +00:00
Fariborz Jahanian
ffe97a3925
Initial work for property implementation declarations.
...
Mostly semantic checking in this patch. This is on going
and incomplete.
llvm-svn: 49882
2008-04-18 00:19:30 +00:00
Steve Naroff
be89ba0c38
Update VC++ project files.
...
llvm-svn: 49881
2008-04-17 23:51:38 +00:00
Ted Kremenek
69049c272f
Modified BugReport::getEndPath() to handle the case where end path is at
...
the exit block of the CFG.
llvm-svn: 49880
2008-04-17 23:44:37 +00:00
Ted Kremenek
cc0951bde1
Hook up reporting reference count memory leaks to the BugReporter mechanism.
...
llvm-svn: 49879
2008-04-17 23:43:50 +00:00
Chris Lattner
54349c5f4d
Fix a problem noticed by Nuno, where we wouldn't escape characters in
...
macro expansions.
llvm-svn: 49877
2008-04-17 23:03:14 +00:00
Ted Kremenek
f42f3fb47d
class Preprocessor: Now owns the "predefines" char*; it deletes [] it in its dstor.
...
clang.cpp: InitializePreprocessor now makes a copy of the contents of PredefinesBuffer and
passes it to the preprocessor object.
clang.cpp: DriverPreprocessorFactory now calls "InitializePreprocessor" instead of this being done in main().
html::HighlightMacros() now takes a PreprocessorFactory, allowing it to conjure up a new
Preprocessor to highlight macros.
class HTMLDiagnostics now takes a PreprocessorFactory* that it can use for html::HighlightMacros().
Updated clients of HTMLDiagnostics to use this new interface.
llvm-svn: 49875
2008-04-17 22:31:54 +00:00
Chris Lattner
7c7e9b3bbe
Handle text escaping (e.g. & -> &) last, to avoid interactions between 'replace' operations and insert operations. This fixes a problem with "&;&" on line 666 of the gcc.c example I sent out.
...
llvm-svn: 49874
2008-04-17 22:24:51 +00:00
Ted Kremenek
306492d8cb
Generate the Preprocessor using a local PreprocessorFactory object.
...
While this adds no extra functionality now, we will soon pass the
PreprocessorFactory object to some ASTConsumers.
llvm-svn: 49873
2008-04-17 21:38:34 +00:00
Chris Lattner
6929bd8047
don't give macros a background
...
llvm-svn: 49871
2008-04-17 21:32:46 +00:00
Chris Lattner
f219126107
Make sure popup is on top over other spans. wrap long line.
...
llvm-svn: 49870
2008-04-17 21:28:41 +00:00
Ted Kremenek
219bab3be9
Added "PreprocessorFactory", an interface for lazily creating Preprocessor objects on-demand.
...
llvm-svn: 49868
2008-04-17 21:23:07 +00:00
Ted Kremenek
c2c08caf9c
Add support in HTML macro expansion for hovering over a macro and automatically
...
expanding its definition. This is a pure CSS solution.
Tested on IE7, Firefox 3b4, and Safari 3.1.
Patch by Cedric Venet!
llvm-svn: 49865
2008-04-17 19:57:27 +00:00
Ted Kremenek
aabc986766
Temporarily disable macro expansion in the HTML output of HTMLDiagnostics to
...
avoid corrupting Preprocessor state. Working on a fix.
llvm-svn: 49864
2008-04-17 18:39:57 +00:00
Ted Kremenek
8bb90b8152
HAve HTMLDiagnostics use html::HighlightRange to highlight message ranges.
...
llvm-svn: 49863
2008-04-17 18:37:23 +00:00
Fariborz Jahanian
8e36cddde0
Added property decl support for protocols.
...
Added assertion if unexpected property decls are found where they don't belong.
Consolidated property decl. printing by using a helper function.
llvm-svn: 49862
2008-04-17 18:25:18 +00:00
Ted Kremenek
a506fec90a
Added transfer function support for ReturnStmt to support detecting leaks
...
involving objects that are returned but have an excessive reference count.
llvm-svn: 49861
2008-04-17 18:12:53 +00:00
Nate Begeman
36c49278b5
Allow redirecting text diagnostic printer output to any llvm::OStream, rather
...
than hard coding llvm::cerr.
llvm-svn: 49860
2008-04-17 18:06:57 +00:00
Argyrios Kyrtzidis
6d05303342
Use TranslationUnitDecl as DeclContext of builtin functions.
...
llvm-svn: 49856
2008-04-17 14:47:13 +00:00
Argyrios Kyrtzidis
c3b69ae815
Addition of TranslationUnitDecl to the AST:
...
-Added TranslationUnitDecl class to serve as top declaration context
-ASTContext gets a TUDecl member and a getTranslationUnitDecl() function
-All ScopedDecls get the TUDecl as DeclContext when declared at global scope
llvm-svn: 49855
2008-04-17 14:40:12 +00:00
Argyrios Kyrtzidis
fc2f058230
Fix MSVC compiler error: "initialization of 'VD' is skipped by 'case' label"
...
llvm-svn: 49853
2008-04-17 13:52:22 +00:00
Chris Lattner
f1c70d79b8
insert macro expansions into floating divs. For now, they are always displayed,
...
but we want some javascript or something toggle their display.
llvm-svn: 49836
2008-04-17 00:40:45 +00:00
Chris Lattner
775fdd3618
correctly hilight multi-line macro definitions and other
...
preprocessor directives.
llvm-svn: 49828
2008-04-16 23:21:17 +00:00
Chris Lattner
10dbbb0c5a
Make HighlightRange correctly handle multi-line ranges. This causes us to
...
correctly handle multi-line comments.
llvm-svn: 49827
2008-04-16 23:06:45 +00:00
Ted Kremenek
9c375158a0
Handle ReturnStmts by dispatching to "EvalReturn" in the transfer function object.
...
llvm-svn: 49826
2008-04-16 23:05:51 +00:00
Chris Lattner
8e3006a4e3
add a new HighlightRange API, it doesn't handle multiline ranges
...
yet, but it will soon...
llvm-svn: 49825
2008-04-16 22:45:51 +00:00
Ted Kremenek
cbf4c6134e
CF ref. count checker: Register memory leaks at the end of a path.
...
llvm-svn: 49824
2008-04-16 22:32:20 +00:00
Ted Kremenek
86051690ea
Bug fix in GREndPathNodeBuilderImpl: Use the specified state to construct
...
a node, not the state of the predecessor.
llvm-svn: 49823
2008-04-16 22:30:40 +00:00
Fariborz Jahanian
549e83caa0
New AST class for property implementation declarations.
...
llvm-svn: 49821
2008-04-16 22:00:24 +00:00
Fariborz Jahanian
d634dfae0f
Fixed a comment.
...
llvm-svn: 49819
2008-04-16 21:11:25 +00:00
Ted Kremenek
c1f9a28e4d
Added CFGBlock::getTerminatorCondition() to get the Expr* of the condition a block's terminator.
...
Refactored LiveVariables to use getTerminatorCondition() in VisitTerminator().
Bug fix: CFG now computes Block-level expression numbers using information
from block terminators. This fixes <rdar://problem/5868189>.
llvm-svn: 49818
2008-04-16 21:10:48 +00:00
Fariborz Jahanian
9d981eb9ae
This patch adds support for declaraing properties in categories,
...
just as they are declared in objc classes.
llvm-svn: 49817
2008-04-16 21:08:45 +00:00
Chris Lattner
e9786c3199
reenable highlighting of (the first line of) comments
...
llvm-svn: 49816
2008-04-16 20:54:51 +00:00
Chris Lattner
0bb0e7ee8a
switch from relexing with the preprocessor to do syntax highlighting to relexing
...
with the Lexer. This is cheaper and gives us some advantages. For now we start
highlighting preprocessor directives (which need improvement), and disable
comments. Comments to be restored later.
llvm-svn: 49815
2008-04-16 20:51:51 +00:00
Ted Kremenek
b47c742002
Add extra test cases to test "escaping" for the reference count checker.
...
llvm-svn: 49812
2008-04-16 20:41:27 +00:00
Ted Kremenek
7145489c37
Small tweaks to EvalStore: pass an "RVal" instead of "LVal" for the TargetLV to
...
represent possible stores to "Unknown."
llvm-svn: 49811
2008-04-16 20:40:59 +00:00
Ted Kremenek
7d28c2c681
Update XCode project (added GRTransferFuncs.cpp).
...
llvm-svn: 49806
2008-04-16 18:39:47 +00:00
Ted Kremenek
673b5c1e42
Add missing file.
...
llvm-svn: 49805
2008-04-16 18:39:25 +00:00
Ted Kremenek
90c7cb6810
Hook up "EvalStore" from GRTransferFuncs to GRExprEngine.
...
llvm-svn: 49804
2008-04-16 18:39:06 +00:00
Ted Kremenek
2044a5183d
Take first step to migrating handling of "stores" to values from GRExprEngine
...
to the plug-in GRTransferFuncs object.
llvm-svn: 49801
2008-04-16 18:21:25 +00:00
Ted Kremenek
ed30e8da56
LiveVariables now updates the liveness state of block-level expressions that
...
are referenced by CFGBlock terminators.
llvm-svn: 49798
2008-04-16 17:07:59 +00:00
Ted Kremenek
2e4d0ecaa3
Added fixme.
...
llvm-svn: 49797
2008-04-16 16:53:18 +00:00
Ted Kremenek
f2e6fcf3bf
Hook up HTMLDiagnostics to use Chris's new syntax highlighting. --html-diags
...
currently doesn't pass in the Preprocessor from the driver, so we don't get
syntax highlighting when we create HTMLDiagnostics in that way.
llvm-svn: 49796
2008-04-16 16:39:56 +00:00
Ted Kremenek
08e562d3c8
In ExplodedGraphImpl::Trim, prioritize for paths that don't span loops by using
...
two worklists: for nodes whose locations are block edges with loop terminators
and another for nodes with all other locations. We only dequeue from the loop
worklist when the other is empty. Exploration of the graph is still in
reverse-BFS.
llvm-svn: 49791
2008-04-16 15:51:26 +00:00
Chris Lattner
03b8fcc247
Take a stab at highlighting #defines and #includes. This doesn't work yet.
...
llvm-svn: 49781
2008-04-16 06:53:09 +00:00
Chris Lattner
5e69a2dd9a
Syntax highlight keywords. I assume someone else will pick less appaling colors.
...
llvm-svn: 49780
2008-04-16 06:35:07 +00:00
Chris Lattner
a5a75e7a10
split syntax highlighting of macros from keywords and comments,
...
allowing us to use a cheaper means to highlight keywords and making
it so that comments won't foul up macro expansions.
Start highlighting macro expansions.
llvm-svn: 49779
2008-04-16 06:32:08 +00:00
Chris Lattner
060d8aa2ed
Add a mode of hackily syntax highlighting comments. This has a number of
...
problems, including the fact that it doesn't work well with multi-line
comments due to Ted's crazy table. However, that could be fixed, and it
does work with single-line ones :).
llvm-svn: 49778
2008-04-16 06:11:58 +00:00
Chris Lattner
dffe0f7db5
Add -o support for -emit-html, make it not produce a file on an error.
...
llvm-svn: 49777
2008-04-16 05:21:09 +00:00
Ted Kremenek
088d12e741
Remove "--html-test" driver option and its corresponding code; all of this
...
functionality has been migrated into "--emit-html" and "--html-diags".
llvm-svn: 49776
2008-04-16 04:38:45 +00:00
Chris Lattner
c326f7e860
Switch AddLineNumbers to hack on a rewritebuffer instead of on a
...
rewriter, getting sourcelocations out of the picture.
llvm-svn: 49775
2008-04-16 04:37:29 +00:00
Chris Lattner
e7d696ec7f
In html::EscapeText, instead of going through the rewriter with
...
a SourceLocation to get a RewriteBuffer, poke the RewriteBuffer
with an offset directly. THis is no faster, but results in
cleaner code.
llvm-svn: 49774
2008-04-16 04:33:23 +00:00
Ted Kremenek
b65a67d7b6
Remove uses of "Selector&" and "const Selector&", since Selector is just an
...
immutable smart pointer (we don't need to pass references, just pass Selector).
llvm-svn: 49773
2008-04-16 04:30:16 +00:00
Ted Kremenek
bba6a4b367
Update CF reference count checker test case to illustrate the use of
...
toll-free bridging.
llvm-svn: 49772
2008-04-16 04:29:21 +00:00
Ted Kremenek
8cb96e92a1
Implemented toll-free bridging support for CF Reference count checker.
...
llvm-svn: 49771
2008-04-16 04:28:53 +00:00
Chris Lattner
a776f953d7
make a method public.
...
llvm-svn: 49770
2008-04-16 04:28:52 +00:00
Chris Lattner
05e5310ad8
switch AddLineNumber to use a SmallString instead of sstream. This
...
speeds up -emit-html on ted's testcase by 29% (.138 -> 0.107s) in a
release build.
llvm-svn: 49767
2008-04-16 04:11:35 +00:00
Chris Lattner
e4dd37ce0a
speed up -emit-html in a release build by 6.5% by avoiding std::string.
...
llvm-svn: 49764
2008-04-16 03:46:57 +00:00
Ted Kremenek
e556f9e39c
Simplify some code.
...
llvm-svn: 49763
2008-04-16 02:59:55 +00:00
Ted Kremenek
748c7ce4ba
Added initial boilerplate to support toll-free bridging in the ref-count checker.
...
llvm-svn: 49756
2008-04-15 23:44:31 +00:00
Ted Kremenek
667cacb2ff
Added some comments to GRExprEngine. Reorder some of the method definitions
...
to start logically organizing them.
Added initial plug-in transfer function support for Objective-C message expressions.
llvm-svn: 49752
2008-04-15 23:06:53 +00:00
Ted Kremenek
32b1537cc2
Revert my previous patch.
...
llvm-svn: 49751
2008-04-15 23:06:05 +00:00
Ted Kremenek
3af355c900
Remove dispatch to "VisitParmVarDecl".
...
llvm-svn: 49750
2008-04-15 23:03:58 +00:00
Ted Kremenek
6204498aad
Change "VisitBlockVarDecl" to "VisitVarDecl". UninitializedValues now works
...
as before r49748 (where BlockVarDecl was removed).
llvm-svn: 49749
2008-04-15 23:02:18 +00:00
Steve Naroff
08899ff85d
Remove FileVarDecl and BlockVarDecl. They are replaced by 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
2008-04-15 22:42:06 +00:00
Ted Kremenek
7d6219f501
For HTML diagnostics, output more information about a bug report.
...
llvm-svn: 49742
2008-04-15 21:25:08 +00:00
Ted Kremenek
43445b3081
Added "summary table" to generated index.html page that allows one to
...
toggle which bug reports are displayed in the report table.
llvm-svn: 49738
2008-04-15 20:47:02 +00:00
Ted Kremenek
15d8f4cc27
Added test case illustrating the use of '&'.
...
llvm-svn: 49735
2008-04-15 18:37:29 +00:00
Ted Kremenek
82ff6d65bc
Fix bug in terminator processing for uninitialized-values: simply ignore the terminator, don't reprocess it.
...
LiveVariables analysis now does a flow-insensitive analysis to determine what variables have their address taken; these variables are now always treated as being live.
The DataflowSolver now uses "SetTopValue()" when getting the initial value for the entry/exit block.
llvm-svn: 49734
2008-04-15 18:35:30 +00:00
Argyrios Kyrtzidis
45887902b6
Fix a compiler error on MSVC (variable name 'E' clash).
...
llvm-svn: 49727
2008-04-15 16:30:10 +00:00
Chris Lattner
3e142b2585
finish commenting RewriteRope
...
llvm-svn: 49712
2008-04-15 06:37:11 +00:00
Ted Kremenek
6d41b82ea4
Improve dead store diagnostic.
...
llvm-svn: 49711
2008-04-15 05:31:00 +00:00
Ted Kremenek
2ecc9d42f7
Bug fix in VisitChildren: Only visit the last statement in a StmtExpr and the RHS of a comma expression, as the other Stmts will be visited elsewhere in a CFGBlock.
...
llvm-svn: 49710
2008-04-15 05:11:28 +00:00
Ted Kremenek
8adeebb274
Added initial support into the flow-sensitive dataflow solver to visit the Block-level expression
...
in a block's terminator. This expression is visited within a block, but it is accessed by the
terminator. This is important to observe because for live-variables analysis the block-level
expression is live between the terminator and where the expression occurs in the block. So far
this hasn't been an issue to not observe this because the block-level expression used in the
terminator is always the last one in the block, and we have never queried the liveness information
about this point (but before the terminator).
llvm-svn: 49709
2008-04-15 04:39:08 +00:00
Ted Kremenek
66279073f7
Bug fix in dead stores: don't always check the liveness of the first decl
...
in a DeclStmt.
llvm-svn: 49708
2008-04-15 04:11:48 +00:00
Ted Kremenek
cd76f95dd0
++/-- makes a variable live since it is used; thus the liveness state is
...
"Alive" as opposed to staying the same.
llvm-svn: 49707
2008-04-15 04:08:54 +00:00
Ted Kremenek
044eb055af
Handle "__private_extern__" storage class when printing FunctionDecls.
...
llvm-svn: 49706
2008-04-15 03:57:09 +00:00
Ted Kremenek
f4212bdbc3
Bug fix in LiveVariables: Operators ++/-- may kill a value, but the variable
...
is still live.
llvm-svn: 49705
2008-04-15 03:47:30 +00:00
Chris Lattner
52bc4ac84f
Fix a corner case that ted hit in -emit-html, rdar://5863212
...
llvm-svn: 49703
2008-04-15 02:26:21 +00:00
Fariborz Jahanian
0152a1a5db
New AST representation for each objc2's property declaration.
...
llvm-svn: 49699
2008-04-14 23:36:35 +00:00
Steve Naroff
c5e5b38a8f
Remove bogus token...
...
llvm-svn: 49695
2008-04-14 22:53:48 +00:00
Chris Lattner
492530d2df
simplify the implementation of the insert/split operation to return
...
the new RHS directly instead of indirecting through the 'InsertResult'
struct. This eliminates InsertResult.
llvm-svn: 49694
2008-04-14 22:10:58 +00:00
Steve Naroff
a8f0d12e81
Rename a file and update the Xcode project.
...
llvm-svn: 49693
2008-04-14 22:05:54 +00:00
Steve Naroff
1dc53ef494
Rename RewriteTest->RewriteObjC.
...
llvm-svn: 49692
2008-04-14 22:03:09 +00:00
Chris Lattner
e58408d8db
Add a bunch of comments, move RewriteRope::MakeRopeString out of line.
...
llvm-svn: 49689
2008-04-14 21:41:00 +00:00
Steve Naroff
4fff2a08aa
Fix comment.
...
llvm-svn: 49688
2008-04-14 21:39:16 +00:00
Ted Kremenek
d61ed3b6cb
Use isFromMainFile instead of comparing FileIDs directly.
...
llvm-svn: 49687
2008-04-14 21:24:13 +00:00
Ted Kremenek
f6aad13242
Fix regression in Diagnostic that caused it to not register the number
...
of errors.
llvm-svn: 49686
2008-04-14 21:21:38 +00:00
Ted Kremenek
9569e57a50
Use SourceManager::isFromMainFile()
...
llvm-svn: 49685
2008-04-14 21:14:41 +00:00
Ted Kremenek
13ad6e1234
Convert over to new SourceManager::isFromMainFile() instead of doing direct
...
FileID comparison (fixes insidious corner case with chunks).
llvm-svn: 49684
2008-04-14 21:14:03 +00:00
Ted Kremenek
bb2b224159
HTMLDiagnostics now uses the new "getCanonicalID()", "isFromMainFileID()" methods from
...
SourceManager when doing HTML pretty-printing. This resolves an insidious bug when
presenting error reports that only occurred in large source files.
llvm-svn: 49683
2008-04-14 21:06:04 +00:00
Ted Kremenek
17acadebb4
Added "getCanonicalID()", "isFromSameFile", and "isFromMainFile" to compare
...
the files of different SourceLocations. These methods correctly handle the
case where a file may have multiple FileIDs due to it being large enough
to be spread across several chunks.
llvm-svn: 49682
2008-04-14 21:04:18 +00:00
Chris Lattner
dc217191d1
fix more uninit ivars, who wrote this junk? :)
...
llvm-svn: 49679
2008-04-14 20:07:03 +00:00
Chris Lattner
ca94e4263b
Fix an assertion ted was hitting, due to an uninitialized variable.
...
llvm-svn: 49678
2008-04-14 20:05:32 +00:00
Ted Kremenek
193f185902
Only increment the number of diagnostics when the DiagnosticClient used
...
is the one attached to the Diagnostic object.
llvm-svn: 49677
2008-04-14 19:56:12 +00:00
Ted Kremenek
751d4d2d60
Added driver option "-checker-opt-analyze-headers" to force the static
...
analyzer to analyze functions declared in header files.
llvm-svn: 49675
2008-04-14 18:40:58 +00:00
Ted Kremenek
87bfc03f4a
Don't flag dead stores that occur in macros.
...
llvm-svn: 49672
2008-04-14 18:28:25 +00:00
Ted Kremenek
bae225d57a
Have BugReporter::EmitWarning use the PathDiagnosticClient if it is available.
...
llvm-svn: 49668
2008-04-14 18:06:42 +00:00
Chris Lattner
d80edddccd
move a ton of code out of line, from RewriteRope.h -> RewriteRope.cpp
...
llvm-svn: 49664
2008-04-14 17:54:23 +00:00
Ted Kremenek
75ff623e2e
Bug fix in dead-store checker when walking the Decls in a DeclStmt: don't
...
assume that DeclStmts only have VarDecls; they can have TypedefDecls.
llvm-svn: 49662
2008-04-14 17:52:13 +00:00
Ted Kremenek
12e721a728
Treat calls to unresolved functions in the CF-ref count checker as calls
...
to functions with NULL summaries.
llvm-svn: 49660
2008-04-14 17:45:13 +00:00
Ted Kremenek
69a4df4cb7
Updated test cases so that they do not emit warnings for dead stores.
...
llvm-svn: 49659
2008-04-14 17:40:10 +00:00
Ted Kremenek
7e15130dc9
Hooked up the dead-store checker to the BugReporter interface. Now dead-store
...
warnings are emitted as part of the warnings registered by GRSimpleVals.
llvm-svn: 49658
2008-04-14 17:39:48 +00:00
Ted Kremenek
cad92f2447
Added version of "getClient()" for class Diagnostic that returns a non-const
...
reference to the DiagnosticClient. This is useful for DiagnosticClients
that have internal state when processing diagnostics.
llvm-svn: 49656
2008-04-14 17:37:31 +00:00
Chris Lattner
04df1bb8b5
remove ifdefs
...
llvm-svn: 49651
2008-04-14 17:12:49 +00:00
Ted Kremenek
16a8a3be41
Added test case to dead stores checker.
...
llvm-svn: 49647
2008-04-14 15:56:17 +00:00
Sam Bishop
cb1a37b145
Handle -D and -U options in order, so that they can cancel each other out when
...
intermixed.
llvm-svn: 49645
2008-04-14 14:41:57 +00:00
Chris Lattner
3374b039d9
Change the RewriteRope::Chunks data structure from an std::list into
...
a nice shiny B+ Tree variant. This fixes the last of the known algorithmic
issues with the rewriter, allowing a significant speedup. For example,
-emit-html on Ted's 500K .i file speeds up from 26.8s -> 0.64s in a
debug build (41x!) and 5.475s -> 0.132s (41x!) in an optimized build.
This code is functional but needs to be cleaned up, ifdefs removed, better
commented, and moved to a .cpp file. I plan to do this tomorrow.
llvm-svn: 49635
2008-04-14 07:17:29 +00:00
Nate Begeman
91f40e3680
Enable clang to codegen emmintrin.h until we have our own emmintrin.h
...
llvm-svn: 49633
2008-04-14 04:49:57 +00:00
Nate Begeman
5eee93328e
Fix typo
...
llvm-svn: 49632
2008-04-14 02:26:39 +00:00
Douglas Gregor
2daae31e9a
Argiris Kirtzidis's fix for handling empty IdDeclInfo's in IdentifierResolver::AddDecl
...
llvm-svn: 49631
2008-04-14 00:26:07 +00:00
Douglas Gregor
423984d33b
Make Parser::getAccessSpecifierIfPresent const, since it does not modify the state
...
llvm-svn: 49629
2008-04-14 00:13:42 +00:00
Argyrios Kyrtzidis
25f54c72ac
Move IdDeclInfoMap class in an anonymous namespace. Suggestion by Chris Lattner.
...
llvm-svn: 49628
2008-04-14 00:09:21 +00:00
Douglas Gregor
556877c1e6
This patch adds very basic support for parsing and type-checking class
...
inheritance in C++. It'll parse the base-specifier list, e.g.,
class D : public B1, virtual public B2 { };
and do some of the simpler semantic checks (B1 and B2 are classes;
they aren't unions or incomplete types, etc).
llvm-svn: 49623
2008-04-13 21:30:24 +00:00
Douglas Gregor
83a586ec19
Introduce support for finding class and enum names via ordinary name lookup in C++
...
llvm-svn: 49621
2008-04-13 21:07:44 +00:00
Chris Lattner
f8f945499c
Fix PR2220, making diagnostics for unexpected tokens in pp expressions
...
more nice.
llvm-svn: 49619
2008-04-13 20:38:43 +00:00
Chris Lattner
d71f83a8cb
this started failing because a GEP was constant folded,
...
improve the robustness of the test.
llvm-svn: 49618
2008-04-13 19:54:28 +00:00
Douglas Gregor
b77653430f
Test commit: fix a typo
...
llvm-svn: 49615
2008-04-13 19:35:01 +00:00
Chris Lattner
861a226586
This patch is just the easy part of the class names patch, which
...
allows the parsing of "class" in addition to "struct" and "union" to
declare a record. So this patch allows:
class C { };
class C c1;
But it does not contain the lookup bits, so this won't work yet:
C c2;
Patch by Doug Gregor!
llvm-svn: 49613
2008-04-13 18:59:07 +00:00
Chris Lattner
cc0ef63a13
Change the btree algorithm to split nodes bottom-up instead of top-down.
...
This results in an (IMO) simpler algorithm, results in fewer splits, and
is more amenable to delta handling (there is no reason to mutate the tree
at all when adding a delta to a position that already exists in the tree).
llvm-svn: 49609
2008-04-13 08:52:45 +00:00
Chris Lattner
cdefa7a6fc
split node splitting from interior node restructuring.
...
llvm-svn: 49608
2008-04-13 08:22:30 +00:00
Chris Lattner
61705c1a6e
update to follow mainline llvm API change.
...
llvm-svn: 49607
2008-04-13 07:32:11 +00:00
Sam Bishop
fcd78b02c2
Use static_cast<> instead of cast<> in Decl::Destroy(). Suggestion by Argiris
...
Kirtzidis!
llvm-svn: 49603
2008-04-13 04:32:18 +00:00
Chris Lattner
b0d3844fb8
Default argument cleanups and minor improvements, patch by
...
Doug Gregor!
llvm-svn: 49598
2008-04-12 23:52:44 +00:00
Chris Lattner
8fc77b7945
final cleanup, the code is now in a reviewable state.
...
llvm-svn: 49592
2008-04-12 22:04:18 +00:00
Chris Lattner
cbb6bad435
move the DeltaTree implementation out of line, remove debugging printfs etc.
...
llvm-svn: 49591
2008-04-12 22:00:40 +00:00
Chris Lattner
0c8d17fc43
remove ifdefs
...
llvm-svn: 49587
2008-04-12 20:34:05 +00:00
Chris Lattner
d154731131
Do an initial hack at replacing one of the incredibly inefficient
...
(but simple!) datastructures in the rewriter with a more complex but
more efficient one.
This replaces the Deltas vector with a specialized BTree that makes
delta lookups much more efficient. This speeds up -emit-html on a 500K
.i file from 157.154 to 27.127 seconds on my machine (5.8x).
While this code is functional, it isn't very pretty, I have much
refactoring planned for it, and will remove the USE_VECTOR ifdef.
Stay tuned.
llvm-svn: 49586
2008-04-12 20:28:24 +00:00
Argyrios Kyrtzidis
740525a6b7
Use std::list's push_back instead of resize to add an element.
...
llvm-svn: 49582
2008-04-12 12:38:58 +00:00
Chris Lattner
8f96d04ceb
don't diagnose empty source files, thanks Neil!
...
llvm-svn: 49575
2008-04-12 05:54:25 +00:00
Argyrios Kyrtzidis
dfd52220d7
Fixed comments.
...
Moved IdDeclInfo class to anonymous namespace.
Replaced array with a std::vector.
llvm-svn: 49570
2008-04-12 01:50:47 +00:00
Argyrios Kyrtzidis
b8a4920d62
Added PushOnScopeChains method to Sema, that adds a decl to both the IdResolver and the Scope.
...
llvm-svn: 49567
2008-04-12 00:47:19 +00:00
Fariborz Jahanian
4572b45574
AST generation for objc2's property declarations.
...
llvm-svn: 49565
2008-04-11 23:40:25 +00:00
Ted Kremenek
8784a7c006
Add some boilerplate to report memory leaks at the end of an analyzed function.
...
Still need some boilerplate in BugReporter to report bugs at the end
of a function (not associated with a particular statement).
llvm-svn: 49564
2008-04-11 22:25:11 +00:00
Ted Kremenek
bc888b47b9
Added "EvalEndPath" to GRTransferFuncs: the default implementation does not
...
change the state (and thus the GREndPathNodeBuilder automatically contructs a
node).
llvm-svn: 49563
2008-04-11 22:07:59 +00:00
Ted Kremenek
811c2b4edb
Added "GREndPathNodeBuilder", a new node builder that will be used for
...
evaluating transfer functions at the end-of-path.
llvm-svn: 49561
2008-04-11 22:03:04 +00:00