Ted Kremenek
c23c7e6a51
Change uses of:
...
Type::getAsReferenceType() -> Type::getAs<ReferenceType>()
Type::getAsRecordType() -> Type::getAs<RecordType>()
Type::getAsPointerType() -> Type::getAs<PointerType>()
Type::getAsBlockPointerType() -> Type::getAs<BlockPointerType>()
Type::getAsLValueReferenceType() -> Type::getAs<LValueReferenceType>()
Type::getAsRValueReferenceType() -> Type::getAs<RValueReferenceType>()
Type::getAsMemberPointerType() -> Type::getAs<MemberPointerType>()
Type::getAsReferenceType() -> Type::getAs<ReferenceType>()
Type::getAsTagType() -> Type::getAs<TagType>()
And remove Type::getAsReferenceType(), etc.
This change is similar to one I made a couple weeks ago, but that was partly
reverted pending some additional design discussion. With Doug's pending smart
pointer changes for Types, it seemed natural to take this approach.
llvm-svn: 77510
2009-07-29 21:53:49 +00:00
Ted Kremenek
4301526e8d
Remove 'StoreManager::OldCastRegion()', TypedViewRegion (which only
...
OldCastRegion used), and the associated command line option
'-analyzer-store=old-basic-cast'.
llvm-svn: 77509
2009-07-29 21:43:22 +00:00
Fariborz Jahanian
4b12ed115a
Some refactoring of member access for
...
performace sake. Also added a test case.
llvm-svn: 77502
2009-07-29 20:41:46 +00:00
Eli Friedman
8e1433b370
Refactor base/member initializers, and construct them correctly in cases
...
with dependent types. Fixes PR4621 and PR4627.
llvm-svn: 77498
2009-07-29 19:44:27 +00:00
Fariborz Jahanian
3f15083f73
Check accessibility when converting object to the base
...
class.
llvm-svn: 77497
2009-07-29 19:40:11 +00:00
Owen Anderson
ade90fd1ba
Update for LLVM API change.
...
llvm-svn: 77492
2009-07-29 18:54:39 +00:00
Fariborz Jahanian
7be1ad814b
No longer need to keep base class offsets in the offset
...
table as it has its own place now.
llvm-svn: 77491
2009-07-29 18:50:06 +00:00
Fariborz Jahanian
bb67b827d9
Patch to provide cast of objects in member access
...
excpression, if needed, and remove some ir-gen code
now unnencessary.
llvm-svn: 77490
2009-07-29 18:40:24 +00:00
Douglas Gregor
aa87ebc0c1
[llvm up]
...
A template name can refer to a set of overloaded function
templates. Model this in TemplateName, which can now refer to an
OverloadedFunctionDecl that contains function templates. This removes
an unspeakable hack in Sema::isTemplateName.
llvm-svn: 77488
2009-07-29 18:26:50 +00:00
Ted Kremenek
87a7a451ad
Remove some uses of TypedViewRegion, and use getBaseRegion() in a context where
...
we don't care about ElementRegions layered on top of a base region.
llvm-svn: 77484
2009-07-29 18:17:40 +00:00
Ted Kremenek
bca70671e7
Make StoreManager::InvalidateRegion() virtual, move the current implementation
...
in StoreManager to RegionStoreManager, and create a special, highly reduced
version in BasicStoreManager.
These changes are in preparation for future RegionStore-specific changes to
InvalidateRegion.
llvm-svn: 77483
2009-07-29 18:16:25 +00:00
Ted Kremenek
ccf3335939
Add 'MemRegion::getBaseRegion()', a utility method to strip ElementRegions with
...
index 0. This will be used for refinements to InvalidateRegion and CastRegion.
llvm-svn: 77481
2009-07-29 18:14:27 +00:00
Ted Kremenek
bb902265af
canSymbolicate() should only return true for integer types that are scalars.
...
llvm-svn: 77479
2009-07-29 18:12:48 +00:00
Sebastian Redl
63c4da01c8
Check for identical types in C++ catch expression. Patch by Erik Verbruggen.
...
llvm-svn: 77475
2009-07-29 17:15:45 +00:00
Daniel Dunbar
a5b3351809
Don't use a formatted ostream when writing .ll either.
...
llvm-svn: 77474
2009-07-29 17:12:55 +00:00
Daniel Dunbar
d8c3178cee
Don't use a formatted ostream when writing .bc files. I don't really understand
...
this interface design, Chris please check.
llvm-svn: 77473
2009-07-29 17:10:26 +00:00
Douglas Gregor
b142c2d0a8
When lookup of an identifier preceding a '<' finds a set of overloaded
...
functions, only return those overloaded functions that are actually
function templates. Note that there is still a glaring problem with
treating an OverloadedFunctionDecl as a TemplateName.
llvm-svn: 77472
2009-07-29 16:56:42 +00:00
Douglas Gregor
ab60c7f60b
Remove an obsolete kludge based on the previous, completely broken handling of function templates
...
llvm-svn: 77464
2009-07-29 16:15:53 +00:00
Douglas Gregor
0004417e81
Use the new statement/expression profiling code to unique dependent
...
template arguments, as in template specialization types. This permits
matching out-of-line definitions of members for class templates that
involve non-type template parameters.
llvm-svn: 77462
2009-07-29 16:09:57 +00:00
Fariborz Jahanian
72b1f24bd2
Use the existing API for base offset. Use suitable llvm type
...
for offset ir-gen.
llvm-svn: 77458
2009-07-29 15:54:56 +00:00
Steve Naroff
85d9715c24
Fix <rdar://problem/7100524> regression: "error: incompatible operand types ('void *' and 'NSString *')".
...
Remove XFAIL from 'conditional-expr-4.m' test case (which would have caught this).
Also tweaked several aspects of the test to jive with the current type checking.
llvm-svn: 77453
2009-07-29 15:09:39 +00:00
Steve Naroff
d390fd99d9
Incorporate feedback from Chris (on r76979).
...
llvm-svn: 77452
2009-07-29 14:06:03 +00:00
Sebastian Redl
955a067bdd
Make functional-style casts emit correct messages, and fix a crash-on-invalid.
...
llvm-svn: 77451
2009-07-29 13:50:23 +00:00
Zhongxing Xu
c2394f0ad9
add a fixme
...
llvm-svn: 77447
2009-07-29 08:13:37 +00:00
Daniel Dunbar
b9a68612e2
BlockScopeInfo::hasPrototype was uninitialized.
...
llvm-svn: 77421
2009-07-29 01:59:17 +00:00
Daniel Dunbar
a444cc2fa8
CharLiteralParser::IsMultiChar was sometimes uninitialized.
...
llvm-svn: 77420
2009-07-29 01:46:05 +00:00
Daniel Dunbar
841f14b609
Add missing '"'
...
llvm-svn: 77416
2009-07-29 01:10:25 +00:00
Fariborz Jahanian
82e2874270
Code refactoring to define getCXXRecordDeclForPointerType
...
and use it in several places.
llvm-svn: 77411
2009-07-29 00:44:13 +00:00
Mike Stump
93246cc475
Some minor cleanups, thanks Chris.
...
llvm-svn: 77402
2009-07-28 23:57:15 +00:00
Mike Stump
2adb4dab54
Some style fixes, thanks Chris.
...
llvm-svn: 77400
2009-07-28 23:47:15 +00:00
Mike Stump
bce7a27d22
Add support for -Wmissing-noreturn.
...
llvm-svn: 77391
2009-07-28 23:11:12 +00:00
Douglas Gregor
a8e02e7863
Refactor the code that produces a TemplateSpecializationType, so that
...
canonicalization for dependent TemplateSpecializationTypes occurs
within ASTContext::getTemplateSpecializationType. Also, move template
argument canonicalization into ASTContext::getCanonicalTemplateArgument.
llvm-svn: 77388
2009-07-28 23:00:59 +00:00
Chris Lattner
a58b3af802
remove extraneous braces
...
llvm-svn: 77386
2009-07-28 22:49:34 +00:00
Mike Stump
3bf1ab48d3
Add noreturn support for blocks.
...
llvm-svn: 77377
2009-07-28 22:04:01 +00:00
Fariborz Jahanian
f17071580f
ir-gen derived-to-base conversion in implicit casts.
...
llvm-svn: 77374
2009-07-28 22:00:58 +00:00
Owen Anderson
3cc120a51e
Update for LLVM API change.
...
llvm-svn: 77368
2009-07-28 21:22:35 +00:00
Anders Carlsson
019f414261
Remove the old RecordOrganizer.
...
llvm-svn: 77365
2009-07-28 21:03:34 +00:00
Ted Kremenek
a41d9dd1f1
Fix PR 4631. The compound initializers of unions were not being evaluated, which
...
could cause false positives if any the subexpressions had side-effects. These
initializers weren't evaluated because the StoreManager would need to handle
them, but that's an orthogonal problem of whether or not the StoreManager can
handle the binding.
llvm-svn: 77361
2009-07-28 20:46:55 +00:00
Ted Kremenek
faf0c64d9d
Fix regression in attribute 'nonnull' checking when a transition node
...
was created but not added to the destination NodeSet. This fixes PR 4630.
llvm-svn: 77353
2009-07-28 19:24:31 +00:00
Anders Carlsson
fc8cfa8b9f
Add a field for C++ specific data to ASTRecordLayout. Use it to store the non-virtual size and alignment + base offsets.
...
llvm-svn: 77352
2009-07-28 19:24:15 +00:00
Fariborz Jahanian
a399dfae19
More cleanup of data member access and then some.
...
llvm-svn: 77351
2009-07-28 18:54:57 +00:00
Owen Anderson
47034e1733
Update for LLVM API change.
...
llvm-svn: 77349
2009-07-28 18:33:04 +00:00
Chris Lattner
2706a55071
fix PR4633: cast to void should silence the 'unused expression' warning.
...
llvm-svn: 77344
2009-07-28 18:25:28 +00:00
Chris Lattner
1d0f16f22a
add some fixme's
...
llvm-svn: 77343
2009-07-28 18:25:06 +00:00
Fariborz Jahanian
b77659f4ae
Some code cleanup.
...
llvm-svn: 77339
2009-07-28 18:09:28 +00:00
Anders Carlsson
d5d6413aa5
More CGRecordLayoutBuilder cleanup.
...
llvm-svn: 77335
2009-07-28 17:56:36 +00:00
Fariborz Jahanian
5142fbd02e
More work toward data member access ir-gen.
...
llvm-svn: 77332
2009-07-28 17:38:28 +00:00
Douglas Gregor
32615a13f4
Fix a typo in a comment
...
llvm-svn: 77324
2009-07-28 16:39:25 +00:00
Douglas Gregor
d9aedfaa5a
Profiling the pointer of a canonical type is sufficient to uniquely identify the type
...
llvm-svn: 77321
2009-07-28 15:32:17 +00:00
Douglas Gregor
4488259d40
Finish profile support for statements.
...
llvm-svn: 77320
2009-07-28 15:27:13 +00:00
Douglas Gregor
a709509f96
Complete profile support for C++ and Objective-C expressions
...
llvm-svn: 77318
2009-07-28 14:44:31 +00:00
John McCall
8945266f3d
Bounds checking for address spaces.
...
llvm-svn: 77303
2009-07-28 06:52:18 +00:00
Daniel Dunbar
ec5ae3d75a
CallExpr's SubExprs sometimes were allocated in the wrong place.
...
llvm-svn: 77302
2009-07-28 06:29:46 +00:00
John McCall
7be52a8179
Reimplement QualifierSet using a single word, as requested by dgregor.
...
llvm-svn: 77299
2009-07-28 05:41:20 +00:00
Argyrios Kyrtzidis
f390c43c3c
Implement ObjCMethodDecl::getCanonicalDecl().
...
llvm-svn: 77298
2009-07-28 05:11:17 +00:00
Argyrios Kyrtzidis
a56fa19ac6
-Add ObjCCategoryImplDecl::getCategoryClass() which returns the category interface decl.
...
-Correct ObjCMethodDecl::getNextRedeclaration(); A method in a ObjCCategoryImplDecl should point to
a method in the associated ObjCCategoryDecl, not the ObjCInterfaceDecl.
llvm-svn: 77297
2009-07-28 05:11:05 +00:00
Argyrios Kyrtzidis
2cee40daa7
Use ObjCImplDecl in place of ObjCCategoryImplDecl/ObjCImplementationDecl.
...
llvm-svn: 77296
2009-07-28 05:10:52 +00:00
Mike Stump
a4de80b8b1
Make longjmp a real builtin.
...
llvm-svn: 77291
2009-07-28 02:25:19 +00:00
John McCall
caa1945306
Allow functions to be marked "implicit return zero" and so mark main().
...
Codegen by initializing the return value with its LLVM type's null value.
llvm-svn: 77288
2009-07-28 01:00:58 +00:00
Douglas Gregor
5c193b9e18
Add a Profile function for statements so that we can (eventually) determine
...
when statements and expressions are equivalent.
llvm-svn: 77284
2009-07-28 00:33:38 +00:00
Ted Kremenek
4c9f161fd5
Fix helper function GetNextStmt() to look for the first statement that has a
...
valid SourceLocation.
llvm-svn: 77280
2009-07-28 00:07:15 +00:00
Mike Stump
82a9e445b7
Make sure to move the comment with the code.
...
llvm-svn: 77279
2009-07-28 00:07:08 +00:00
Fariborz Jahanian
e309b48a22
Patch for objc's zero-const exception to not assume
...
that @catch(...) cathces all exceptions (c++ objects
are not cought by that).
llvm-svn: 77270
2009-07-27 23:12:41 +00:00
Owen Anderson
0e0189d64d
Update for LLVM API change.
...
llvm-svn: 77267
2009-07-27 22:29:56 +00:00
Mike Stump
31d9254f7a
Ensure we can work through typedefs.
...
llvm-svn: 77265
2009-07-27 22:25:19 +00:00
Ted Kremenek
04ade6f1cb
(1) Enable PlistDiagnostics to take an option "PathDiagnosticClientFactory"
...
object that it can use to forward PathDiagnostics for further processing. Along
with this feature, the PlistDiagnostics object logs which files are created by
the forwarding of the PathDiagnostics.
(2) Create a new PathDiagnosticClientFactory object for HTMLDiagnostics,
allowing other PathDiagnosticClients to forward PathDiagnostics through an
opaque interface.
(3) Create a "plist-html" diagnostics option in AnalysisConsumer to allow the
logging of HTML files created in a hybrid Plist+HTML diagnostic client.
llvm-svn: 77264
2009-07-27 22:13:39 +00:00
Mike Stump
9e3b01f697
Add knowledge about _longjmp being noreturn.
...
llvm-svn: 77254
2009-07-27 21:45:16 +00:00
Mike Stump
9a9e0c2b17
Add builtin knowledge about longjmp being noreturn. Add printing for
...
the noreturn attribute.
llvm-svn: 77253
2009-07-27 21:33:40 +00:00
Owen Anderson
e05f2ed478
Update for LLVM API change.
...
llvm-svn: 77249
2009-07-27 21:00:51 +00:00
Fariborz Jahanian
7b2b1ec6b1
Some minor changes toward support of data
...
member access in the presense of non-virtual bases.
llvm-svn: 77246
2009-07-27 20:57:45 +00:00
Mike Stump
ca6c875e47
Add noreturn for exit.
...
llvm-svn: 77237
2009-07-27 19:14:18 +00:00
Argyrios Kyrtzidis
067c407c48
Make ObjCImplDecl inherit from ObjCContainerDecl.
...
ObjCContainerDecl now is the root class for objc decls that contain methods.
llvm-svn: 77235
2009-07-27 19:04:32 +00:00
Devang Patel
6a3b3fe98a
Use DICompositeType->replaceAllUsesWith()
...
llvm-svn: 77228
2009-07-27 18:42:03 +00:00
Douglas Gregor
d612997e73
When instantiating a variable without an initializer, call
...
ActOnUninitializedDecl.
llvm-svn: 77211
2009-07-27 17:43:39 +00:00
Anders Carlsson
cabdeb4932
Use the CGRecordLayoutBuilder even if there are no fields, because in C++ an empty class will have a padding byte.
...
llvm-svn: 77205
2009-07-27 17:10:54 +00:00
Anders Carlsson
72fb384a65
Enable the new struct type builder now that the constant struct builder works. (The old code will still be there until we know that everything works well.
...
llvm-svn: 77190
2009-07-27 15:31:55 +00:00
Anders Carlsson
b97a3ec4e7
Fix a tail padding bug in the record layout builder code. The bug was found by an existing test.
...
llvm-svn: 77189
2009-07-27 14:55:54 +00:00
Anders Carlsson
b7130ed888
Enable the new constant struct builder by default. The old code is still in place but will be removed shortly. The new struct builder works on big endian systems.
...
llvm-svn: 77185
2009-07-27 05:54:15 +00:00
Anders Carlsson
bff6b49cd0
More work on the constant struct builder, fix a couple of thinkos and add support for inserting part of a bitfield in the previous byte.
...
llvm-svn: 77180
2009-07-27 02:56:37 +00:00
Anders Carlsson
ba4c6d1c91
More work on bitfield support in the new constant struct builder.
...
llvm-svn: 77177
2009-07-27 01:23:51 +00:00
Mike Stump
21e0f895a1
Fix PR4624.
...
llvm-svn: 77176
2009-07-27 00:44:23 +00:00
Nuno Lopes
bd2cd92907
fix segfault (because of erasing after the vector boundaries) when the cached token position is at the end
...
llvm-svn: 77159
2009-07-26 16:36:45 +00:00
Nuno Lopes
0b797b1c9d
add gentoo 2009.0 g++ header locations
...
llvm-svn: 77158
2009-07-26 16:14:05 +00:00
Daniel Dunbar
e59313a298
Switch to getName()
...
llvm-svn: 77151
2009-07-26 09:28:40 +00:00
Daniel Dunbar
600dfac30a
Switch to using llvm::Value::getName()
...
llvm-svn: 77147
2009-07-26 08:32:30 +00:00
Daniel Dunbar
4f7dfaf650
Update for API change.
...
llvm-svn: 77112
2009-07-26 02:21:04 +00:00
Daniel Dunbar
6a82e424d0
Lookup targets by Triple instead of Module.
...
llvm-svn: 77108
2009-07-26 01:27:26 +00:00
Mike Stump
ea086c7263
Preserve qualifiers.
...
llvm-svn: 77097
2009-07-25 23:24:03 +00:00
Ryan Flynn
e5dc8594ea
PR3575 - warn on declared variable or function attributes after a definition, which are currently ignored.
...
llvm-svn: 77095
2009-07-25 22:29:44 +00:00
Argyrios Kyrtzidis
39c348d915
Refactor ObjCImplDecl::getInstanceMethod/getClassMethod into one
...
ObjCImplDecl::getMethod.
llvm-svn: 77094
2009-07-25 22:16:03 +00:00
Argyrios Kyrtzidis
553376be19
Refactor ObjCInterfaceDecl::lookupInstanceMethod/lookupClassMethod into one
...
ObjCInterfaceDecl::lookupMethod.
llvm-svn: 77093
2009-07-25 22:15:51 +00:00
Argyrios Kyrtzidis
e6ed65bee0
Refactor ObjCProtocolDecl::lookupInstanceMethod/lookupClassMethod into one
...
ObjCProtocolDecl::lookupMethod.
llvm-svn: 77092
2009-07-25 22:15:38 +00:00
Argyrios Kyrtzidis
6de0560b97
Refactor ObjCContainerDecl::getInstanceMethod/getClassMethod into one
...
ObjCContainerDecl::getMethod.
Avoids code duplication.
llvm-svn: 77091
2009-07-25 22:15:22 +00:00
Mike Stump
8c5d7996e8
Add noreturn as a type attribute, handle printing for them and handle
...
calls to noreturn function pointers when CFG building.
llvm-svn: 77089
2009-07-25 21:26:53 +00:00
Fariborz Jahanian
dedf1e4b1a
ir-gen for non-virtual base class initialization
...
in constructors.
llvm-svn: 77087
2009-07-25 21:12:28 +00:00
Sebastian Redl
9f831dbbcd
Implement C++ semantics for C-style and functional-style casts. This regresses Clang extension conversions, like vectors, but allows conversions via constructors and conversion operators.
...
Add custom conversions to static_cast.
llvm-svn: 77076
2009-07-25 15:41:38 +00:00
John McCall
02dee0a46a
Semantic checking for main().
...
Fix some invalid main() methods in the test suite that were nicely
exposed by the new checks.
llvm-svn: 77047
2009-07-25 04:36:53 +00:00
Anders Carlsson
3b484b928d
More work on the constant struct builder. We can now convert the struct to a packed struct when necessary.
...
llvm-svn: 77038
2009-07-25 01:40:29 +00:00
Fariborz Jahanian
f464edf81f
Some code refactoring per Daniel's feedback.
...
llvm-svn: 77030
2009-07-25 01:08:28 +00:00
Anders Carlsson
87a9a34e5b
More work on the constant struct builder. We now try to layout all constant structs but throw away the result.
...
llvm-svn: 77021
2009-07-25 00:24:56 +00:00
Owen Anderson
b7a2fe6f81
Update for LLVM API change.
...
llvm-svn: 77012
2009-07-24 23:12:58 +00:00
Douglas Gregor
a6ef8f0813
Template instantiation for static data members that are defined out-of-line.
...
Note that this also fixes a bug that affects non-template code, where we
were not treating out-of-line static data members are "file-scope" variables,
and therefore not checking their initializers.
llvm-svn: 77002
2009-07-24 20:34:43 +00:00
Fariborz Jahanian
a5c335527d
More Sema check for constructor's member initializer along
...
with type conversion to fix ir-gen crash.
llvm-svn: 77000
2009-07-24 20:28:49 +00:00
Ted Kremenek
b9cb11391d
In the "use of floating point variable as loop counter" check, check
...
if the DeclRefExpr is a float, not just either argument.
llvm-svn: 76998
2009-07-24 20:26:31 +00:00
Ted Kremenek
9c3952c03e
Have 'clang --analyze' run syntactic static analysis security checks.
...
llvm-svn: 76996
2009-07-24 20:03:11 +00:00
Mike Stump
d3bb557559
Fix 80-col violations, reflow a few comments and zap some extra
...
whitespace at ends of lines.
llvm-svn: 76992
2009-07-24 19:02:52 +00:00
Anders Carlsson
5e66fb5d16
Fix a release build warning.
...
llvm-svn: 76985
2009-07-24 18:20:38 +00:00
Fariborz Jahanian
2a1b5af130
More work toward initialization of objects
...
in constructors.
llvm-svn: 76980
2009-07-24 17:57:02 +00:00
Steve Naroff
e87026a08f
Allow front-end 'isa' access on object's of type 'id'.
...
Enhance test case to cover 'isa' access on interface types (clang produces an error, GCC produces a warning).
Still need back-end CodeGen for ObjCIsaExpr.
llvm-svn: 76979
2009-07-24 17:54:45 +00:00
Anders Carlsson
e2c6baf629
Don't use getLLVMFieldNo for bitfields when constructing the ivar layout maps for GC.
...
llvm-svn: 76978
2009-07-24 17:23:54 +00:00
Anders Carlsson
e1d5ca583f
Check in a half finished new constant struct builder (Obviously not used yet).
...
llvm-svn: 76969
2009-07-24 15:20:52 +00:00
Daniel Dunbar
c46a079957
Fix declaration of obc_enumerationMutation function, for GNU runtime.
...
llvm-svn: 76959
2009-07-24 07:40:24 +00:00
Ted Kremenek
963cc31583
Add doxygen comments and simplify expression.
...
llvm-svn: 76955
2009-07-24 06:55:42 +00:00
Ted Kremenek
3075428d16
Introduce a new variant type 'TryResult' to represent the result of
...
TryEvaluateBool instead of using a raw 'int'. This avoids any
confusion of how 'int' converts to bool, and makes the resultant code
easier to read.
Condense a bunch of 'addSuccessor()' calls in 'if ... else' to use the
ternary operator instead.
llvm-svn: 76947
2009-07-24 04:47:11 +00:00
Zhongxing Xu
30ac7607be
Add getDecl() to CallGraph and CallGraphNode.
...
llvm-svn: 76940
2009-07-24 03:41:11 +00:00
Zhongxing Xu
6c82313375
Constify methods.
...
llvm-svn: 76939
2009-07-24 03:38:27 +00:00
John McCall
d9baf6aed8
Test commit: make a little stub routine for semantic checking of main().
...
llvm-svn: 76934
2009-07-24 03:03:21 +00:00
Mike Stump
8e79f99b16
Implement new warning for functions declared 'noreturn' when they fall off the end.
...
llvm-svn: 76932
2009-07-24 02:49:01 +00:00
Anders Carlsson
6e853bf2b7
Get rid of the size parameter to AppendField. No functionality change.
...
llvm-svn: 76931
2009-07-24 02:45:50 +00:00
Ted Kremenek
745088c49e
Mark destructor of Checker virtual.
...
llvm-svn: 76924
2009-07-24 00:40:31 +00:00
Douglas Gregor
79f83eda84
This patch fixes the implementations of the __has_trivial_destructor
...
and __has_trivial_constructor builtin pseudo-functions and
additionally implements __has_trivial_copy and __has_trivial_assign,
from John McCall!
llvm-svn: 76916
2009-07-23 23:49:00 +00:00
Daniel Dunbar
91ade14197
Output UTF-16 string literals independent of host byte order.
...
- Steve, can you take a look at this? It seems like this code should live
elsewhere, and there is a FIXME about having Sema validates the UTF-8 to
UTF-16 conversion.
llvm-svn: 76915
2009-07-23 23:41:22 +00:00
Fariborz Jahanian
ca2f085a4e
Diagnose when base classes and members to be intialized
...
with constructors don't have a matching constructor.
llvm-svn: 76913
2009-07-23 23:32:59 +00:00
Mike Stump
773582dbb8
Refactor and push the evaluation as late as possible.
...
llvm-svn: 76911
2009-07-23 23:25:26 +00:00
Daniel Dunbar
64509b2765
Factor out map lookup for CFString constants.
...
llvm-svn: 76908
2009-07-23 22:52:48 +00:00
Anders Carlsson
085395426c
Don't just store the field/bit field info one field, do it for all fields in the union.
...
llvm-svn: 76907
2009-07-23 22:52:34 +00:00
Mike Stump
9620889f67
Some cleanups suggested by Daniel.
...
llvm-svn: 76906
2009-07-23 22:40:11 +00:00
Ted Kremenek
6610c0326b
Implement: <rdar://problem/6335715> rule request: gets() buffer overflow
...
llvm-svn: 76905
2009-07-23 22:29:41 +00:00
Anders Carlsson
e2accf4404
Fix another thinko.
...
llvm-svn: 76903
2009-07-23 21:52:03 +00:00
Ted Kremenek
70e5526a61
Add comments.
...
llvm-svn: 76901
2009-07-23 21:44:18 +00:00
Ted Kremenek
9c49762776
Refine checking and diagnostics for use of floating point variable as a counter.
...
This implements <rdar://problem/6336718> and checks for CERT secure coding
advisory FLP30-C.
llvm-svn: 76900
2009-07-23 21:34:35 +00:00
Anders Carlsson
516e5e7835
Correct a thinko in bitfield layout code. Fixes PR4611.
...
llvm-svn: 76898
2009-07-23 21:16:33 +00:00
Daniel Dunbar
2a5b83c7e6
Simplify, NFC.
...
llvm-svn: 76897
2009-07-23 20:38:28 +00:00
Daniel Dunbar
07b749230c
Switch the driver back to always using clang-cc by default (for C++, and
...
regardless of the architecture).
- This is a good default for development & testing; for example without this
any tests using 'clang' in the test suite will fail on PowerPC, since the
driver will avoid using clang.
- We don't want to actually ship something built this way, but that should be
handled via some sort of configuration file.
llvm-svn: 76886
2009-07-23 17:48:59 +00:00
Daniel Dunbar
635d481de0
Simplify.
...
llvm-svn: 76885
2009-07-23 17:33:49 +00:00
Anders Carlsson
d78fc89fcb
We don't need to keep track of the packed alignment, just whether the struct is packed or not. Fixes PR4610.
...
llvm-svn: 76884
2009-07-23 17:24:40 +00:00
Anders Carlsson
8af896c10a
Move the LLVM field number for bit fields into the BitFieldInfo structure, since it's meaning is completely different than for non-bit fields.
...
llvm-svn: 76882
2009-07-23 17:01:21 +00:00
Douglas Gregor
27bdf00fd7
Clean up the ActOnTag action, so that there is only a single entry
...
point that covers templates and non-templates. This should eliminate
the flood of warnings I introduced yesterday.
Removed the ActOnClassTemplate action, which is no longer used.
llvm-svn: 76881
2009-07-23 16:36:45 +00:00
Douglas Gregor
2aff97c9e6
Unbreak the CMake build
...
llvm-svn: 76878
2009-07-23 15:15:06 +00:00
Zhongxing Xu
ee5d708e55
Add two nodes to the call graph:
...
- Root is the main function or 0.
- ExternalCallingNode has edges to all external functions.
llvm-svn: 76876
2009-07-23 13:39:38 +00:00
Zhongxing Xu
a598e5c9d5
Add template specializations to view the call graph in dot format.
...
- change the DenseMap used in callgraph to std::map, since DenseMap cannot
be used with mapped_iterator and friends.
llvm-svn: 76874
2009-07-23 09:04:23 +00:00
Zhongxing Xu
fdd52922c2
constify methods.
...
llvm-svn: 76873
2009-07-23 08:32:25 +00:00
Daniel Dunbar
7c02cf609d
Shield clang from LLVM API changes, until the dust settles.
...
llvm-svn: 76862
2009-07-23 05:30:36 +00:00
Daniel Dunbar
a2f7c95dca
Use llvm::BitVector instead of managing memory by hand.
...
- As it happens, this also fixes a use-of-uninitialized memory that was causing
non-deterministic test failures.
llvm-svn: 76857
2009-07-23 05:01:54 +00:00
Anders Carlsson
f55922b8b8
Set field info for unions.
...
llvm-svn: 76856
2009-07-23 04:59:05 +00:00
Anders Carlsson
718a89a501
Use arrays as union padding. Also, since the resulting struct will always contain a single element and either a single i8 element or an array of i8s, there's no reason to use a packed struct.
...
llvm-svn: 76854
2009-07-23 04:50:01 +00:00
Daniel Dunbar
8e31e77fd8
Revert r76831, there are many Analyzer test failures on multiple platforms.
...
--- Reverse-merging r76831 into '.':
U include/clang/Analysis/PathSensitive/GRExprEngine.h
U lib/Analysis/GRExprEngine.cpp
llvm-svn: 76851
2009-07-23 04:41:06 +00:00
Anders Carlsson
f814ee6003
Handle zero width bit fields in unions correctly (by ignoring them).
...
llvm-svn: 76847
2009-07-23 04:00:39 +00:00
Anders Carlsson
697f65943d
Implement union layout support.
...
llvm-svn: 76846
2009-07-23 03:43:54 +00:00
Anders Carlsson
307846fe67
Check in CGRecordLayoutBuilder which is a reimplementation of the record layout code. (Yay, no more packed structs unless absolutely necessary). We currently don't use the layouts being built but that will change when the new code is mature enough :)
...
llvm-svn: 76845
2009-07-23 03:17:50 +00:00