Chris Lattner
8100d74951
move the DeltaTree implementation out of line, remove debugging printfs etc.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49591 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-12 22:00:40 +00:00
Chris Lattner
77257889f5
remove ifdefs
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49587 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-12 20:34:05 +00:00
Chris Lattner
5c9dc5ac75
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49586 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-12 20:28:24 +00:00
Argyrios Kyrtzidis
72e62b0c60
Use std::list's push_back instead of resize to add an element.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49582 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-12 12:38:58 +00:00
Chris Lattner
b25e5d79d9
don't diagnose empty source files, thanks Neil!
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49575 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-12 05:54:25 +00:00
Argyrios Kyrtzidis
321f278db3
Fixed comments.
...
Moved IdDeclInfo class to anonymous namespace.
Replaced array with a std::vector.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49570 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-12 01:50:47 +00:00
Argyrios Kyrtzidis
87f3ff0c27
Added PushOnScopeChains method to Sema, that adds a decl to both the IdResolver and the Scope.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49567 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-12 00:47:19 +00:00
Fariborz Jahanian
dae1a1a2aa
AST generation for objc2's property declarations.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49565 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-11 23:40:25 +00:00
Ted Kremenek
e7bd9c20a9
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).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49564 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-11 22:25:11 +00:00
Ted Kremenek
11062b1184
Added "GREndPathNodeBuilder", a new node builder that will be used for
...
evaluating transfer functions at the end-of-path.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49561 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-11 22:03:04 +00:00
Ted Kremenek
b8873558cf
Added FIXME
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49558 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-11 20:51:02 +00:00
Ted Kremenek
f9561e51e8
Fix regression introduced by my last commit.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49556 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-11 20:23:24 +00:00
Ted Kremenek
a0df99ff6f
Changed behavior of how we handle "NULL" summaries: just call
...
GRSimpleVals::EvalCal(), and don't change reference counts.
Remove "getDoNothingSummary()", as a NULL summary does the same thing.
Added temporary hack for the "Get" rule for objects that return a pointer type:
treat them as non-owned CF objects.
Added test case to detect the release of a non-owned object.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49555 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-11 20:11:19 +00:00
Steve Naroff
d6a07aaf62
Add class and super class location info to ObjCInterfaceDecl...
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49553 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-11 19:35:35 +00:00
Ted Kremenek
bcf50ad8c7
Use RangedBugReport to report better ranges for reference count errors.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49552 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-11 18:40:51 +00:00
Ted Kremenek
5e55cda64f
Added "RangedBugReport".
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49551 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-11 18:40:29 +00:00
Sam Bishop
1bb19638f2
Invoke destructors in Decl::Destroy().
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49547 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-11 18:04:39 +00:00
Fariborz Jahanian
45bc03f920
Minor changes per Chris L's review.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49539 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-11 16:55:42 +00:00
Chris Lattner
8fa3078cfe
don't read off the front of the buffer. Thanks to Sam for pointing this out.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49535 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-11 16:20:41 +00:00
Sam Bishop
bb45c512e0
Stub out and start using a Decl::Destroy() method.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49532 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-11 15:01:25 +00:00
Sam Bishop
f3c63ae44e
Use the ASTContext allocator when creating deserialized Decl objects.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49530 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-11 14:49:10 +00:00
Chris Lattner
a2f42b1d18
two new files for previous patch, by Argiris Kirtzidis
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49521 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-11 07:06:57 +00:00
Chris Lattner
7f925cc107
Switch sema to maintaining its own scope chain information for variable
...
shadowing, instead of threading it through the AST. This patch contributed
by Argiris Kirtzidis!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49520 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-11 07:00:53 +00:00
Ted Kremenek
940b1d85d3
Fixed some logic errors in the CF ref count checker; we now can detect simple
...
use-after-release errors. Added test case.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49509 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-10 23:44:06 +00:00
Fariborz Jahanian
1d78cc4430
Patch for:
...
1) objc ivar processing is split out of ActOnField into its own ActOnIvar method.
2) the new objc ivar action takes visibility info directly, eliminating
AllVisibilities in ParseObjCClassInstanceVariables.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49506 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-10 23:32:45 +00:00
Ted Kremenek
61b9f870cc
Simplify CF ref. count checker state machine.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49505 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-10 23:09:18 +00:00
Ted Kremenek
3ea0b6a087
Fix some bonehead bugs in summary generation in CFRefCount.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49503 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-10 22:58:08 +00:00
Ted Kremenek
d71ed26dd8
Refactored all logic to run the GRSimpleVals and CFRef checker into a common
...
code path in the clang driver.
Renamed options --grsimple to -checker-simple and -check-cfref to -checker-cfref.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49500 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-10 22:16:52 +00:00
Chris Lattner
ebe457c344
reduce the amount of 'C++ magic' this code depends on :)
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49489 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-10 16:37:40 +00:00
Ted Kremenek
f84afb77a0
CFRefCount analysis now properly calls "EmitWarnings" after analyzing a function.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49488 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-10 16:21:09 +00:00
Ted Kremenek
4bb6ac2bb6
When not emitting path diagnostics in BugReporter::EmitWarning(), use the
...
BugReport-specific SourceRanges (when available).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49486 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-10 16:12:38 +00:00
Ted Kremenek
4d35dacf85
Fixed regressions in error reporting due to copy-paste errors (using the "begin"
...
iterator instead of "end") and not implementing "getDescription()" for Nil
argument checks.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49485 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-10 16:05:13 +00:00
Chris Lattner
e13594279a
refactor Parser::ParseStructDeclaration to return a vector of uninterpreted
...
declarators. This allows the clients (C structs, objc classes, objc
properties, [future] C++ classes) etc, to do custom processing before invoking
an action.
This has two benefits in the short term:
1) objc ivar processing should be split out of ActOnField into its own ActOn method.
2) the new objc ivar action can take visibility info directly, eliminating
AllVisibilities in ParseObjCClassInstanceVariables.
3) objc properties can pass their own special sauce down to sema as well.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49468 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-10 06:46:29 +00:00
Chris Lattner
60b1e3ebe4
Simplify lifetime of location object.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49467 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-10 06:15:14 +00:00
Chris Lattner
def026a193
typedef void T;
...
void f(T);
is only invalid in C++ mode, not C89 mode.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49460 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-10 02:26:16 +00:00
Chris Lattner
8123a95c33
Several improvements from Doug Gregor related to default
...
argument handling. I'll fix up the c89 (void) thing next.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49459 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-10 02:22:51 +00:00
Ted Kremenek
05cbe1a44e
Hooked up initial reference-count checks to the BugReporter interface.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49455 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-09 23:49:11 +00:00
Ted Kremenek
50a6d0ce34
Major refactoring/cleanup of GRExprEngine, ExplodedGraph, and BugReporter.
...
Bugs are now reported using a combination of "BugType" (previously
BugDescription) and Bug "BugReport" objects, which are fed to BugReporter (which
generates PathDiagnostics). This provides a far more modular way of registering
bug types and plugging in diagnostics.
GRExprEngine now owns its copy of GRCoreEngine, and is not owned by the
ExplodedGraph.
ExplodedGraph is no longer templated on the "checker", but instead on the state
contained in the nodes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49453 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-09 21:41:14 +00:00
Ted Kremenek
2979ec73b4
The dtor CGObjCRuntime::~CGObjCRuntime() was implemented twice, once
...
in CGObjCGNU.cpp and once in CGObjCEtoile.cpp. Moved its definition to
CGObjC.cpp. This resolves a build error in Xcode, and also cleans things up.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49429 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-09 15:51:31 +00:00
Ted Kremenek
70bcba6030
Micro-optimization: Don't use ostringstream when using a C-string literal
...
will work just fine.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49427 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-09 15:40:40 +00:00
Ted Kremenek
fa34b33e43
Added some boilerplate for emitting warnings from the CF-reference count checker.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49414 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-09 01:10:13 +00:00
Ted Kremenek
6837faa083
Added new "BugReporterHelper" class which is used by BugReporter to emit
...
checker-specific diagnostics.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49412 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-09 00:20:43 +00:00
Ted Kremenek
fa5be36172
Don't expand tabs in EscapeText, but rather expand them when writing out
...
the HTML file. This should reduce the amount of memory pressure on the
rewriter for files that have a lot of tabs.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49406 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-08 22:37:58 +00:00
Ted Kremenek
4ce32cb52b
When substituting tabs during HTMLification, only add " " when we are
...
"escaping" spaces.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49404 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-08 22:28:15 +00:00
Sam Bishop
670aa9d763
Changed the Decl::Kind enum of the ObjCPropertyDecl class, so that it follows
...
the pattern of the other Decl classes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49399 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-08 20:49:25 +00:00
Chris Lattner
3d1cee3698
Add support for C++ default arguments, and rework Parse-Sema
...
interaction for function parameters, fixing PR2046.
Patch by Doug Gregor!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49370 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-08 05:04:30 +00:00
Chris Lattner
0442108783
Add support for C++ default arguments, and rework Parse-Sema
...
interaction for function parameters, fixing PR2046.
Patch by Doug Gregor!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49369 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-08 04:40:51 +00:00
Ted Kremenek
356708cb33
Add ids for line numbers, allowing us to jump to arbitrary line numbers within
...
an HTMLified source file.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49359 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-07 23:53:30 +00:00
Ted Kremenek
7e54eede40
Tweak message bubble color (gold)
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49357 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-07 23:43:44 +00:00
Ted Kremenek
706e3cf2fa
Improve BugReport diagnostics for loops and ? operator.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49356 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-07 23:35:17 +00:00
Sam Bishop
e2563ca02a
Pass the ASTContext object around when deserializing Decl and Stmt objects, so
...
they can be created using the same allocator as in the "from source code" case.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49353 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-07 21:55:54 +00:00
Steve Naroff
d77bc28342
Have Parser::FuzzyParseMicrosoftAsmStatement() return the null statement (';').
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49349 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-07 21:06:54 +00:00
Chris Lattner
5426bf6456
random whitespace fixes.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49328 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-07 07:01:58 +00:00
Chris Lattner
8c7bbb5347
fix a bug I introduced in my previous checkin.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49327 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-07 06:58:21 +00:00
Chris Lattner
acc9972da2
simplify array compatibility testing.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49326 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-07 06:56:55 +00:00
Chris Lattner
8f8fc7bdb6
simplify reference handling.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49325 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-07 06:52:53 +00:00
Chris Lattner
6ac46a4a52
move some code around, no other change.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49324 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-07 06:51:04 +00:00
Chris Lattner
78eca286b0
simplify compatibility testing for tag types.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49323 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-07 06:49:41 +00:00
Chris Lattner
b0489814dc
merge compatibility testing of qualified/unqualified interfaces together
...
and fix a bug.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49322 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-07 06:38:24 +00:00
Chris Lattner
1ee0700c7d
Fix a really bad bug where type uniquing would merge a<x> with b<x> as the same
...
type, because it did not include a/b in the hash.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49321 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-07 06:37:47 +00:00
Chris Lattner
42a997c93b
MyOtherClass<MyProtocol>* is compatible with MyClass*
...
if MyClass is a superclass of MyOtherClass, there is no need for
an exact interface match.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49320 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-07 06:06:56 +00:00
Chris Lattner
3cc4c0c305
Remove a dead check for compatible builtin types
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49319 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-07 05:55:38 +00:00
Chris Lattner
6e26f5db80
futher simplify compatibility testing of objc interface types.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49318 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-07 05:53:18 +00:00
Chris Lattner
a36a61f218
ocuvector and vector should be compatible. Fix ASQual compatibility.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49316 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-07 05:43:21 +00:00
Chris Lattner
f3692dc4a4
Fix comment typo, do reference eval at the correct type.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49315 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-07 05:37:56 +00:00
Chris Lattner
f62f9cd5a7
simplify vector type compatibility testing.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49314 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-07 05:36:14 +00:00
Chris Lattner
eca7be6b7e
move ObjCQualifiedIdTypesAreCompatible out of ASTContext into Sema.
...
While it is similar to the other compatibility predicates in ASTContext,
it is not used by them and is different.
In addition, greatly simplify ObjCQualifiedIdTypesAreCompatible and
fix some canonical type bugs. Also, simplify my Type::getAsObjC* methods.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49313 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-07 05:30:13 +00:00
Chris Lattner
821a01baa2
Replace an O(n^2) algorithm in areCompatObjCQualInterfaces with
...
an O(n) algorithm by taking advantage of the fact that the
protocol qualifier list is already guaranteed sorted.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49312 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-07 05:05:41 +00:00
Chris Lattner
88cb27a160
move sorting of qualifying protocols from the parser into
...
sema. This allows clients of the parser to have the unmolested
list if desired, and guarantees that noone can create an
ObjCQualifiedInterfaceType with an unsorted list.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49310 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-07 04:56:42 +00:00
Chris Lattner
065f0d7b00
eliminate getReferencedProtocols from
...
ObjCQualifiedIdType/ObjCQualifiedInterfaceType, adding an interator
interface instead.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49308 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-07 04:44:08 +00:00
Chris Lattner
3b27546b42
make QualifiedInterfaceTypesAreCompatible a static function
...
and start simplifying it.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49307 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-07 04:17:40 +00:00
Chris Lattner
53efc25179
This predicate is just a generic "issuperclass" predicate, move it to the
...
ObjCInterfaceType as a method.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49306 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-07 04:13:03 +00:00
Chris Lattner
c4e4059962
Simplify some objc compatibility testing, make interfaceTypesAreCompatible
...
a static function named isCompatibleInterfaceAssign.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49305 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-07 04:07:56 +00:00
Chris Lattner
439dbadead
simplify the logic in ASTContext::objcTypesAreCompatible
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49302 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-07 01:30:37 +00:00
Chris Lattner
368eefa081
clean up some logic in objc type handling. Specifically, make it so that
...
there are QualType::getAsObjc* type methods, and make isa<ObjCInterfaceType>
return true for ObjCQualifiedInterfaceType's.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49300 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-07 00:27:04 +00:00
Chris Lattner
1361b11066
trivial changes to getFloatingTypeOfSizeWithinDomain, nothing significant.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49298 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-06 23:58:54 +00:00
Chris Lattner
7cfeb08f24
simplify max type computation by making it return an integer (like
...
getFloatingTypeOrder) instead of a type. Fix a fixme.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49297 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-06 23:55:33 +00:00
Chris Lattner
a75cea3f6b
minor simplifications/cleanups to type comparisons.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49296 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-06 23:38:49 +00:00
Chris Lattner
8bcfc5bef4
remove the Decl::getCanonicalType() method.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49295 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-06 23:10:54 +00:00
Chris Lattner
d8bdba5d35
remove a use of getCanonicalType.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49294 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-06 23:09:52 +00:00
Chris Lattner
f52ab250ff
Start switching clients over from CT.getCanonicalType() to Context.getCanonicalType(CT) for PR2189.
...
While I'm at it, clean up a bit of maxIntegerType.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49292 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-06 22:59:24 +00:00
Chris Lattner
77c9647cae
introduce a new ASTContext::getCanonicalType method. This is the first
...
step towards fixing PR2189.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49291 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-06 22:41:35 +00:00
Chris Lattner
37c1b78a20
Use EnumType to simplify some code.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49289 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-06 22:29:16 +00:00
Chris Lattner
7176331b0f
make use of EnumType to simplify some code, eliminate warnings
...
when assertions are disabled.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49288 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-06 22:05:18 +00:00
Chris Lattner
2daa5df1b5
Make EnumType/RecordType classof predicates simpler and more efficient in
...
some cases.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49287 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-06 22:04:54 +00:00
Chris Lattner
5edb8bfe84
add a helper EnumType object for asking about tagtypes for enums.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49286 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-06 21:58:47 +00:00
Gabor Greif
984d0b414b
tracking API changes arising from r49277
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49279 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-06 20:42:52 +00:00
Chris Lattner
3420766281
move a semantic check out of the parser into sema.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49273 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-06 07:49:57 +00:00
Chris Lattner
f97409f352
now that identifier list parsing is split out, simplify handling of
...
normal typed argument lists.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49272 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-06 06:57:35 +00:00
Chris Lattner
3825c2eb00
reject 'int test(x, x) int x; {}'
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49271 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-06 06:50:56 +00:00
Chris Lattner
aaf9ddbeab
reject 'typedef int y; int test(x, y)'.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49270 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-06 06:47:48 +00:00
Chris Lattner
50c6477a06
simplify Parser::ParseFunctionDeclaratorIdentifierList
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49269 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-06 06:39:19 +00:00
Chris Lattner
66d2865075
split parsing of identifier lists in function declarators out into
...
their own method.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49268 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-06 06:34:08 +00:00
Chris Lattner
3e3d310a8c
minor simplification
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49267 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-06 06:03:03 +00:00
Chris Lattner
2a2819a0a8
finish up throw parsing.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49266 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-06 06:02:23 +00:00
Chris Lattner
ef4715c3fe
split code for handling grouping parens in declarators from code that
...
handles function argument parens in declarators.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49265 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-06 05:45:57 +00:00
Chris Lattner
a711dd0131
another minor simplification
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49264 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-06 05:27:21 +00:00
Chris Lattner
5dcc6ce4a6
Use token lookahead to simplify some code that is rarely executed.
...
Since it is rare, the cost is not significant and we enjoy the
simplification.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49263 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-06 05:26:30 +00:00
Chris Lattner
5619688510
Fix a bug I introduced in my const'ification patch.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49262 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-06 05:25:03 +00:00
Chris Lattner
b048c98359
This patch contains these changes:
...
-Renamed ContextDecl -> DeclContext
-Removed DeclContext pointer from FieldDecl
-EnumDecl inherits from DeclContext, instead of TagDecl
Patch by Argiris Kirtzidis!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49261 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-06 04:47:34 +00:00
Chris Lattner
6ccb91abc3
fix css font name, patch by Cédric Venet
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49260 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-06 04:37:21 +00:00
Chris Lattner
3ae30f8781
templates can't be static.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49258 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-06 04:22:39 +00:00
Chris Lattner
e0def7589a
fix a number of const qualification bugs.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49257 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-06 04:11:27 +00:00
Chris Lattner
5483bdf386
add a missing #include
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49256 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-06 04:02:29 +00:00
Chris Lattner
d658b562e8
Fix handling of implicit int, resolving PR2012 and reverting (and
...
subsuming) my patch for PR1999.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49251 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-05 06:32:51 +00:00
Chris Lattner
a798ebc826
Step #1 to fixing PR2012: c89 allows declspecs to be completely
...
missing from function definitions only. If we see a function
definiton with missing declspecs, just fudge in an int.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49250 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-05 05:52:15 +00:00
Steve Naroff
0c29b22f43
Support MS-specific integer suffixes (i8, i16, i32, i64, i128).
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49229 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-04 21:02:54 +00:00
Chris Lattner
f81557cb71
Fix PR2049, updating Eli's patch that fixes to mainline. This produces incorrect
...
code, but the codegen doesn't crash. I'll file a bugzilla for the AST being wrong.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49226 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-04 18:42:16 +00:00
Steve Naroff
b6e64c57e4
Rename ScopedDecl::getContext() -> getContextDecl(). Two motivations:
...
#1 : To be consistent with FieldDecl::getContextDecl(), which serves the same purpose.
#2 : From my perspective, getContext() is too general (and used by several other classes for different purposes).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49224 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-04 18:15:49 +00:00
Chris Lattner
9b2dc28717
Since isComplexType() no longer returns true for _Complex integers, the code
...
generator needs to call isAnyComplexType(). This fixes PR1960.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49220 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-04 16:54:41 +00:00
Chris Lattner
72858c94f1
updates from David.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49217 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-04 15:59:59 +00:00
Chris Lattner
be09ededdb
various bug fixes, add to xcode project.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49216 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-04 15:47:22 +00:00
Chris Lattner
7ba9c60ddf
initial checkin of Étoilé runtime support, patch by David Chisnall
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49215 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-04 15:45:52 +00:00
Steve Naroff
e2ef815de1
Add explicit support for diagnosing implicit function decls.
...
Without this, the diagnostic is very confusing. The diag is now consistent with gcc as well.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49214 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-04 14:32:09 +00:00
Seo Sanghyeon
63f067f5a7
PR1963: Address of function is a constant expression
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49212 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-04 09:45:30 +00:00
Torok Edwin
730f2c13e8
fix build error: add missing braces.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49209 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-04 06:16:25 +00:00
Chris Lattner
0ed844b04e
Introduce ContextDecl, patch by Argiris Kirtzidis!
...
-Added ContextDecl (no TranslationUnitDecl)
-ScopedDecl class has a ContextDecl member
-FieldDecl class has a ContextDecl member, so that a Field or a ObjCIvar can be traced back to their RecordDecl/ObjCInterfaceDecl easily
-FunctionDecl, ObjCMethodDecl, TagDecl, ObjCInterfaceDecl inherit from ContextDecl. With TagDecl as ContextDecl, enum constants have a EnumDecl as their context.
-Moved Decl class to a "DeclBase.h" along with ContextDecl class
-CurContext is handled by Sema
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49208 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-04 06:12:32 +00:00
Chris Lattner
c8aa5f1f26
Codegen assignment to self correctly, patch by David Chisnall!
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49201 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-04 04:07:35 +00:00
Nate Begeman
1330b0e6e4
Ignore qualifiers when checking vector operands, just like scalar operands.
...
This prevents things like
a += b[0]; where a is a float4 and b is a float4 * (address_space 1)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49199 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-04 01:30:25 +00:00
Ted Kremenek
7956f754f8
Added investigate patch for an occasionally failing assertion (heisenbug?)
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49193 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-03 21:44:24 +00:00
Nate Begeman
dbebb73b86
Teach clang how to codegen punpcklbw and punpcklwd
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49186 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-03 19:58:06 +00:00
Ted Kremenek
a2fdbf5245
Better range highlight for undefined-argument checks.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49184 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-03 18:52:25 +00:00
Ted Kremenek
a7bf7e79cc
When reporting "bad receiver" warnings, highlight the receiver.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49183 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-03 18:46:16 +00:00
Ted Kremenek
de7161fa68
Use "getRanges" in default implementation of "getEndPath" to determine
...
the ranges of highlighted elements in the source code.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49181 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-03 18:00:37 +00:00
Ted Kremenek
f1ae705460
Hooked up GRSimpleAPICheck and the simple Objective-C Foundation checks to use
...
the new BugReporter interface.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49180 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-03 17:57:38 +00:00
Ted Kremenek
1758b07ef7
Added "getLogicalLineNumber" and "getLogicalColumnNumber" to FullSourceLoc.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49177 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-03 17:55:15 +00:00
Sam Bishop
0f9c72f505
trivial whitespace fix
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49160 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-03 14:20:28 +00:00
Ted Kremenek
70d1722c90
Handle the case when getEndPath() returns NULL.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49155 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-03 07:33:55 +00:00
Ted Kremenek
49cd6354d5
Some cleanups in EscapeText and AddLineNumbers. Still investigating performance
...
issues.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49150 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-03 07:12:29 +00:00
Chris Lattner
fce71b8ea5
Fix PR2081 (problems codegen'ing some recursive structures) patch
...
by Lauro Venancio!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49144 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-03 05:50:42 +00:00
Sam Bishop
71de20ef8b
Created a destructor so that the top-level decls can be deleted.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49142 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-03 05:35:20 +00:00
Ted Kremenek
1c1924525d
Add back bug name to PathDiagnostic.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49139 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-03 05:23:19 +00:00
Chris Lattner
bc896f58c7
Fix a bug where we didn't check the RHS for null, we checked
...
the LHS for null twice.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49138 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-03 05:07:25 +00:00
Chris Lattner
988ee6ef54
qualifier comparisons should be done on canonical types.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49137 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-03 05:07:04 +00:00
Sam Bishop
8266d7f620
Call "delete" on the body of FunctionDecls.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49135 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-03 05:01:04 +00:00
Ted Kremenek
94826a7910
When creating PathDiagnostics, created a trimmed graph first and report the
...
BFS path to the root. This also avoids problems with loops in the ExplodedGraph.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49133 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-03 04:59:14 +00:00
Ted Kremenek
61f3e05805
Created new path-sensitive bug-reporting scheme based on the classes
...
"BugReporter" and "BugDescription". BugDescription is used to describe
a bug and provide pieces of the PathDiagnostic, and BugReporter creates
the actual PathDiagnostic by crawling through the ExplodedGraph.
Migrated checks done by GRSimpleVals to be reported using the new BugReporter
mechanism.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49127 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-03 04:42:52 +00:00
Ted Kremenek
9e628a02f4
CSS tweaking on blue boxes.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49121 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-02 22:50:50 +00:00
Ted Kremenek
07b39fc389
80 col violation
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49120 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-02 22:08:09 +00:00
Ted Kremenek
87abc03d3d
Added more PathDiagnostic rendering for terminators: switch, goto, loops.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49119 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-02 22:03:53 +00:00
Ted Kremenek
f23621f1fc
Blue diagnostic boxes.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49117 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-02 21:14:04 +00:00
Ted Kremenek
718ceb13e0
Added path sequence numbers in HTML output of PathDiagnostics.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49116 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-02 21:04:20 +00:00
Steve Naroff
3110251f13
Change ObjCInterfaceDecl to inherit from NamedDecl (not TypeDecl). While ObjCInterfaceDecl is arguably a TypeDecl, it isn't a ScopedDecl. Since TypeDecl's are scoped, it makes sense to simply treat them as NamedDecl's. I could have fiddled a bit more with the hierarchy (in terms of creating a non-scoped TypeDecl), however this probably isn't worth the effort.
...
I also finished unifying access to scope decl change by converting Sema::getObjCInterfaceDecl() to use Sema::LookupDecl(). This is much cleaner now:-)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49107 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-02 18:30:49 +00:00
Ted Kremenek
3cc9fdc8c9
Shorted bug-description.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49102 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-02 18:02:54 +00:00
Chris Lattner
423a3c9c27
simplify some code by using PointerLikeType.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49101 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-02 17:45:06 +00:00
Chris Lattner
bdcd637c29
add a common base class "PointerLikeType" for PointerType and ReferenceType,
...
allowing them to be treated the same in some contexts. A suggestion for a
better name is welcome :)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49100 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-02 17:35:06 +00:00
Chris Lattner
987798ad1d
properly handle array decay in objc message exprs.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49098 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-02 17:17:33 +00:00
Steve Naroff
b327ce0295
Two changes to Sema::LookupDecl() interface.
...
(1) Remove IdLoc (it's never used).
(2) Add a bool to enable/disable lazy builtin creaation (defaults to true).
This enables us to use LookupDecl() in Sema::isTypeName(), which is also part of this commit.
To make this work, I changed isTypeName() to be a non-const member function. I'm not happy with this, however I fiddled with making LookupDecl() and friends const and it got ugly pretty quickly. We can certainly add it back if/when someone has time to fiddle with it. For now, I thought this simplification was more important than retaining the const-ness.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49087 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-02 14:35:35 +00:00
Ted Kremenek
dd5981177b
Beginning of some cleanups; start generating path diagnostics using objects
...
that describe a bug.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49086 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-02 07:05:46 +00:00
Chris Lattner
d805bec0fb
Various parts of the standard require something to be an "incomplete or
...
object type". Add a predicate that checks exactly this, as it is equivalent
to checking ot see if the type is *not* a function type, which is faster
to check.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49082 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-02 06:59:01 +00:00
Chris Lattner
96b77fc05e
1) Enforce C99 6.7.3p2: "Types other than pointer types derived from
...
object or incomplete types shall not be restrict-qualified."
2) Warn about qualifiers on function types: C99 6.7.3p8: "If the
specification of a function type includes any type qualifiers, the
behavior is undefined."
3) Implement restrict on C++ references.
4) fix some locations for various C++ reference diagnostics.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49081 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-02 06:50:17 +00:00
Chris Lattner
d965455756
Add a citation.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49080 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-02 06:06:35 +00:00
Chris Lattner
e6327747b7
Fix several bugs in array -> pointer decomposition.
...
First, we got several CVR propagation cases wrong, which Eli pointed
out in PR2039.
Second, we didn't propagate address space qualifiers correctly, leading
to incorrect lowering of code in CodeGen/address-space.c.
Third, we didn't uniformly propagate the specifier in the array to the
pointer ("int[restrict 4]" -> "int *restrict").
This adds an ASTContext::getArrayDecayedType member that handles the
non-trivial logic for this seemingly simple operation.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49078 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-02 05:18:44 +00:00
Ted Kremenek
503d613235
Added initial hacked support for display path diagnostics with
...
GRSimpleVals warnings. Cleaning up, but now we get multiple bubbles (branches are annotated).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49077 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-02 05:15:22 +00:00
Chris Lattner
8527f82594
remove blank line.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49075 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-02 05:09:38 +00:00
Chris Lattner
bad37858ae
print cvr qualifiers on simplified typedefs
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49074 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-02 05:06:23 +00:00
Chris Lattner
f0467b39b5
rename some variables, fix 80 col violation. No
...
functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49072 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-02 04:24:33 +00:00
Chris Lattner
fd89bc8250
Fix PR2017 and silence some bogus errors.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49068 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-02 01:05:10 +00:00
Steve Naroff
c822ff47d2
Fix a comment typo and add a couple suggestions from Chris.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49066 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-02 00:39:51 +00:00
Steve Naroff
e8043c3917
Fairly large "cleaup" related to changing ObjCCompatibleAliasDecl superclass (to inherit from NamedDecl, instead of ScopedDecl).
...
- Added a DenseMap to associate an IdentifierInfo with the ObjCCompatibleAliasDecl.
- Renamed LookupScopedDecl->LookupDecl and changed it's return type to Decl. Also added lookup for ObjCCompatibleAliasDecl's.
- Removed Sema::LookupInterfaceDecl(). Converted clients to used LookupDecl().
- Some minor indentation changes.
Will deal with ObjCInterfaceDecl and getObjCInterfaceDecl() in a separate commit...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49058 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-01 23:04:06 +00:00
Ted Kremenek
a6fb4e07ed
Patch by Argiris Kirtzidis: Fix a dangling pointer error!
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49057 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-01 22:35:58 +00:00
Chris Lattner
35de512b9c
Update to match simplified llvm MemoryBuffer interfaces for files.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49042 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-01 18:04:30 +00:00
Chris Lattner
be2ab45def
prune dead #includes
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49033 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-01 06:08:11 +00:00
Chris Lattner
3c1f7b615c
MemoryBuffer::getFile got smarter, obviating the need for readfilefast.
...
The new MemoryBuffer doesn't "leak" file descriptors and handles the
small file case efficiently.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49032 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-01 06:06:37 +00:00
Ted Kremenek
8fb001684f
Better handling for tabs with message bubbles.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49001 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-31 23:14:05 +00:00
Ted Kremenek
6bb205c469
Do not prepend the keyword "[CHECKER]" to checker messages when using
...
a PathDiagnosticClient.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48996 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-31 20:42:43 +00:00
Steve Naroff
ff721524ec
Hack ReadFileFast() to raise the threshold of memory mapped files (from 4->12 pages).
...
This is a temporary solution to avoid running out of file descriptors (which defaults to 256).
Need to benchmark to understand the speed benefit. If the benefit is small, the simple solution is to avoid memory mapping files. If the benefit is significant, more thought is necessary.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48991 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-31 18:44:59 +00:00
Ted Kremenek
5297e5ffc5
Include ranges in GRSimpleVals diagnostics.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48990 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-31 18:44:32 +00:00
Ted Kremenek
4dc41cc8de
Inlined clang/Analysis/Analyses/GRSimpleVals.h into LocalCheckers.h and removed
...
GRSimpleVals.h
Added a PathDiagnosticClient option to the driver functions for the
CFRefCountChecker and the GRSimpleVals analysis. Both analyses now accept a "-o"
argument from the driver that specifies where HTML reports should be dumped.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48989 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-31 18:26:32 +00:00
Ted Kremenek
615f517709
Added variation of the "Report" method in the class Diagnostic that takes
...
an optional DiagnosticClient argument that differs from the client stored
internally in the Diagnostic object.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48986 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-31 18:23:15 +00:00
Ted Kremenek
02737ed29d
Added path-sensitive check for return statements that return the address
...
of a stack variable. This is the path-sensitive version of a check that
is already done during semantic analysis.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48980 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-31 15:02:58 +00:00
Chris Lattner
8a934233d1
rename Decl::CompatibleAlias -> ObjCCompatibleAlias.
...
Fix objc ivar lookup. Ivar lookup should occur between lookup
of method-local values and lookup of globals. Emulate this with
some logic in the handling of Sema::ActOnIdentifierExpr.
Two todo's left:
1) sema shouldn't turn a bare reference to an ivar into "self->ivar"
in the AST. This is a hack.
2) The new ScopedDecl::isDefinedOutsideFunctionOrMethod method does
not correctly handle typedefs and enum constants yet.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48972 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-31 00:36:02 +00:00
Chris Lattner
ce5605ecf7
some cleanups on top of David's patch. There are still two
...
remaining open issues I've communicated to him:
1) self can be assigned to, and his patch didn't handle it correctly.
2) CollectObjCIvarTypes is N^2 (because each subclass reprocesses
all parent class ivars) and flattens classes. If A derives from B,
and both have an int, I'd expect to get { {i32}, i32}, not { i32, i32}.
David, please review.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48970 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-30 23:25:33 +00:00
Chris Lattner
391d77a263
Add initial support for objc codegen for methods, ivars, and the
...
etoile runtime, patch by David Chisnall!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48969 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-30 23:03:07 +00:00
Steve Naroff
95110968dc
Make sure Sema::ActOnClassMessage() correctly diagnoses "super".
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48924 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-28 21:37:05 +00:00
Ted Kremenek
8730e130ab
Added skeleton checking for NSString's method initWithFormat: (do not pass nil). This won't be useful in most cases right now
...
because the analyzer isn't tracking expected types for an object, and [NSString alloc] just runs "id".
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48917 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-28 16:09:38 +00:00
Ted Kremenek
4ba6283f9c
Expanded NSString checking to check for nil for a few more methods.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48898 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-27 22:05:32 +00:00
Ted Kremenek
9b3fdeaca3
Add line SourceLocation to NSString checks.
...
Added test case to test warning about passing 'nil' to NSString's compare: method.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48896 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-27 21:23:57 +00:00
Ted Kremenek
e5d5c204c7
Hooked up initial NSString interface checking to GRSimpleVals.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48895 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-27 21:15:17 +00:00
Ted Kremenek
487f827a7f
Minor CSS tweaking (smaller h1 tags).
...
Bug fix in EscapeText (for std::string) where spaces were not properly emitted.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48889 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-27 17:28:58 +00:00
Ted Kremenek
527556184b
Add creation of BasicObjCFoundationChecks when running GRSimpleVals from the driver.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48886 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-27 17:17:22 +00:00
Ted Kremenek
053ef593fa
Add html::EscapeText for std::string; use this function to escape text in message bubbles.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48884 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-27 17:15:29 +00:00
Ted Kremenek
2e93981a62
Added <h3> tag in HTML file output that contains the name of the source file.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48869 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-27 07:35:49 +00:00
Ted Kremenek
99c6ad3f22
Added "GRAuditor" and "GRSimpleAPICheck" interface to allow simple stateless checkers to be injected into the analyzer.
...
Added "AnnotatedPath" class to record an annotated path that will be useful for inspecting paths.
Added some boilerplate code for simple checks of Apple's Foundation API.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48867 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-27 07:25:52 +00:00
Ted Kremenek
120187de4b
PathDiagnosticPiece no longer contains a vector of strings; just one string.
...
PathDiagnostic no longer contains a diagnostic ID or diagnostic level.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48864 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-27 06:16:40 +00:00
Ted Kremenek
d3abcdfa30
Added classes "PathDiagnosticPiece", "PathDiagnostic", and "PathDiagnosticClient", which encapsulate diagnostic reporting for paths.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48861 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-27 03:49:32 +00:00
Ted Kremenek
a056b4f7f0
Bug fix: use GetRVal instead of GetLVal (were getting the value of a DeclRefExpr, not it's address).
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48846 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-26 22:21:58 +00:00
Ted Kremenek
5af373a0c2
Bug fix in transfer function for ObjCMessageExpr: Visit the receiver expression as an ordinary expression, not using VisitLVal.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48842 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-26 21:36:08 +00:00
Steve Naroff
c5e2f34df1
Alloc redeclaration of typedefs within ExternCSystemHeaderDir's AND SystemHeaderDir's.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48841 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-26 21:27:00 +00:00
Nuno Lopes
8c1a9a80ba
allow the format attribute to be specified in function pointer prototypes
...
# this is my first commit here, so please be gentle :)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48807 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-25 23:01:48 +00:00
Nate Begeman
8e7dafec4b
Extend QualType::getAddressSpace to do the right thing for array types, and in
...
the future, RecordTypes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48784 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-25 18:36:32 +00:00
Ted Kremenek
dbfe41acda
GRSimple analysis now outputs additional diagnostic warnings about
...
passing an uninitialized value to a message expresion.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48776 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-25 16:40:05 +00:00
Ted Kremenek
b9308372e0
Tweak to transfer function for ObjCMessageExpr: handle both instance methods
...
and message expressions with a specified receiver.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48773 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-25 16:07:41 +00:00
Ted Kremenek
23a4f917cd
Added logic to check for uninitialized values as the receivers for message expressions
...
and uninitialized values passed-by-value as arguments to message expressions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48760 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-25 02:10:28 +00:00
Ted Kremenek
55deb97341
Added initial transfer function support for ObjCMessageExpr.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48757 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-25 00:34:37 +00:00
Ted Kremenek
9d4e659fce
Minor CSS tweaking: use webkit style CSS properties for shadows/rounded edges
...
for message bubbles.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48754 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-24 23:38:32 +00:00
Chris Lattner
ea301e15a6
Avoid overflowing buffer, patch by Algeris Kirtzidis!
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48741 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-24 21:14:55 +00:00
Ted Kremenek
5fb5c6afbb
Changed merge operation for uninitialized values analysis to "intersect" (previous union).
...
The effect is that if a variable is uninitialized along a branch (but initialized along another), at merge points it is considered uninitialized. Previously we had the opposite behavior. The new behavior is more conservative, and more in line with gcc's behavior.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48689 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-22 20:11:00 +00:00
Ted Kremenek
0e561a3e67
Rename "Nodify" to "MakeNode"
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48659 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-21 21:30:14 +00:00
Sam Bishop
9a4939f7ed
Plug a memory leak in the "this macro expands into a single trivially-
...
expanded token" case.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48637 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-21 07:13:02 +00:00
Ted Kremenek
fa59f1f053
LiveVariables analysis now uses intersect for the merge of block-level expression liveness information.
...
The rationale is that a block-level expression cannot be live in a parent block unless it is live in all of the successor blocks.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48618 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-20 21:46:49 +00:00
Ted Kremenek
0f1b67bc25
Added HTML highlighting for ranges.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48572 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-19 23:55:53 +00:00
Steve Naroff
0d755ad7d8
Fix typo.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48571 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-19 23:46:26 +00:00
Steve Naroff
657aefe011
Fix http://llvm.org/bugs/show_bug.cgi?id=2161 .
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48568 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-19 23:07:49 +00:00
Ted Kremenek
eeacc5203a
Change colors of HTML message bubble.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48563 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-19 22:44:21 +00:00
Ted Kremenek
db87ca09df
More CSS enhancements to HTML code printing.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48557 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-19 22:06:25 +00:00
Ted Kremenek
e8e019ede1
Misc. cleanups to HTML printing: make code rendered using tables; add
...
better div positioning for messages.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48555 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-19 21:59:05 +00:00
Ted Kremenek
13e479b2b7
Initial experimentation with adding boxed "annotations" to HTMLized source.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48540 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-19 07:53:42 +00:00
Ted Kremenek
ad0a203130
Moved generation of html header/footer with builtin CSS to the rewriter library.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48537 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-19 06:14:37 +00:00
Chris Lattner
572cf09ae8
simplify code by using the variadic StructType::get method.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48535 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-19 05:24:56 +00:00
Chris Lattner
36b6a0a63e
simplify the clang codegen by using the new Builder.CreateStructGEP method.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48534 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-19 05:19:41 +00:00
Ted Kremenek
d6c1360c2b
More cleanups to the HTML rewriter (with line formatting), with better
...
pretty-printing of line numbers.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48533 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-19 05:07:26 +00:00
Ted Kremenek
f7768bc7a3
Change "style" to "class" in HTML output.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48525 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-19 01:44:27 +00:00
Ted Kremenek
f830997de6
More cleanups to HTML rewriter API: remove the InsertTag method; was too complicated
...
and clients can achieve a cleaner design just by inserting tags directly. Reserve
the "html" namespace for meta-level operations (e.g., escaping text, etc.)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48524 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-19 01:30:02 +00:00
Ted Kremenek
1b3188cfc2
More HTML rewriter cleanups. Preliminary CSS support in code pretty-printing.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48518 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-18 23:55:46 +00:00
Ted Kremenek
b485cd1e0a
Some cleanups to the HTMLRewrite API. Added support for printing out line
...
numbers (more work to be done on aesthetics).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48512 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-18 23:08:51 +00:00
Ted Kremenek
c22efea6f9
Modified "InsertTag" (HTML rewriter) to have an optional "OutermostTag" flag to
...
indicate whether or not the new tag should be the outermost tag at the specified
location (in the case that other tags have been inserted at the same spot).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48506 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-18 21:26:34 +00:00
Ted Kremenek
6a34083e9f
Added the beginning of a set of rewriter functions for pretty-printing source
...
code as HTML. Added a new driver option "--emit-html" to dump the source
of the main input file as HTML.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48505 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-18 21:19:49 +00:00
Ted Kremenek
886c8db545
Added variant of "InsertText" in the Rewriter to support inserting text both
...
*before* and after a specific location.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48504 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-18 21:17:59 +00:00
Ted Kremenek
88ad97f177
Bug fix in RewriteBuffer::getMappedOffset: potentially multiple deltas
...
need to be skipped over when AfterInserts == true, as multiple deltas
may share the same FileLoc.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48503 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-18 21:00:57 +00:00
Chris Lattner
f90a248578
move #include to the file that needs it.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48485 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-18 05:59:11 +00:00
Ted Kremenek
58cda6ff1c
Fix assertion.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48470 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-17 22:18:22 +00:00
Ted Kremenek
14a1140c9f
Fix integer overflow bug when processing switch statements.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48469 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-17 22:17:56 +00:00
Ted Kremenek
7ffa0aad4c
Properly hook up inline asm transfer function logic to the main GRExprEngine logic.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48468 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-17 21:31:48 +00:00
Ted Kremenek
ef44bfb9d0
Added initial transfer function support for inline asm.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48466 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-17 21:11:24 +00:00
Nate Begeman
9c167115e9
Check in a couple fixes for vector extensions.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48461 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-17 17:22:18 +00:00
Ted Kremenek
a716d7a575
Bug fix in CFG construction: VisitCompoundStmt should return the last created block.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48460 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-17 17:19:44 +00:00
Chris Lattner
f4af515457
clean up property memory allocation to move it into the ast classes
...
like the rest of the classes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48434 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-17 01:19:02 +00:00
Chris Lattner
55d13b4d55
make property addition work list all other "add" methods. Do
...
the allocation in the class, not in sema.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48433 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-16 21:23:50 +00:00
Chris Lattner
f8d17a5916
add the last two Create methods for decls, woo!
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48432 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-16 21:17:37 +00:00
Chris Lattner
75c9cae5f8
add two more Create methods.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48428 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-16 20:53:07 +00:00
Chris Lattner
68c82cf612
simplify the way ObjCCategoryDecl's get their referenced protocols list
...
specified. Previously, the ctor would allocate memory for the list and then
it would get filled in later. Move the allocation+filling in to be more
consistent with other stuff, e.g. the addMethods method.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48427 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-16 20:47:45 +00:00
Chris Lattner
61f9d41036
Add create methods for ObjCCategoryDecl, ObjCForwardProtocolDecl, ObjCClassDecl.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48426 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-16 20:34:23 +00:00
Chris Lattner
c858105d41
minor cleanups, make getNumInstanceMethods always return unsigned.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48423 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-16 20:19:15 +00:00
Chris Lattner
439e71f4be
fix a crasher where an invalid program that multiply defined
...
a protocol could smash more references in than are allocated.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48411 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-16 01:25:17 +00:00
Chris Lattner
cca59d77c4
Give ObjCProtocolDecl a Create method.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48410 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-16 01:23:04 +00:00
Chris Lattner
f962808120
hoist a bunch of casting.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48409 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-16 01:16:52 +00:00
Chris Lattner
0e77ba0bf7
Add create methods for ObjCIvarDecl and ObjCInterfaceDecl
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48408 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-16 01:15:50 +00:00
Chris Lattner
58cce3b0dc
Make the parameter count of ObjCMethodDecl unsigned, you
...
can't have negative arguments.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48407 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-16 01:07:14 +00:00
Chris Lattner
b06fa3b869
remove some dead arguments to ObjCMethodDecl.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48406 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-16 00:58:16 +00:00
Chris Lattner
6c4ae5de0c
Give ObjCMethodDecl a Create method.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48405 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-16 00:49:28 +00:00
Chris Lattner
1e03a561f4
Split objc decl implementation out into DeclObjC.cpp
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48404 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-16 00:19:01 +00:00
Chris Lattner
8e25d86818
switch the rest of the C decl classes to do their
...
allocation through ASTContext.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48403 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-16 00:16:02 +00:00
Chris Lattner
bda0b626e7
Make a major restructuring of the clang tree: introduce a top-level
...
lib dir and move all the libraries into it. This follows the main
llvm tree, and allows the libraries to be built in parallel. The
top level now enforces that all the libs are built before Driver,
but we don't care what order the libs are built in. This speeds
up parallel builds, particularly incremental ones.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48402 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-15 23:59:48 +00:00