]> granicus.if.org Git - clang/log
clang
14 years agoType Type::isRealFloatingType() that vectors are not floating-point
Douglas Gregor [Tue, 22 Jun 2010 23:07:26 +0000 (23:07 +0000)]
Type Type::isRealFloatingType() that vectors are not floating-point
types, updating callers of both isFloatingType() and
isRealFloatingType() accordingly. Caught at least one issue where we
allowed one to declare a vector of vectors (!), along with cleaning up
the standard-conversion logic for C++.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106595 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoSupport -mios-version-min= as an alias for -miphoneos-version-min=.
Daniel Dunbar [Tue, 22 Jun 2010 22:27:12 +0000 (22:27 +0000)]
Support -mios-version-min= as an alias for -miphoneos-version-min=.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106587 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoChange Type::isFloatingType() to reflect the actual definition of a
Douglas Gregor [Tue, 22 Jun 2010 22:12:46 +0000 (22:12 +0000)]
Change Type::isFloatingType() to reflect the actual definition of a
"floating type" in C, which does not include vector types. Introduce
Type::hasFloatingRepresentation() for the places where we want to know
whether the underlying representation is one or more floating-point
values. Remove some hacks we had where the former behavior of
Type::isFloatingType() was at odds with the language definition of the
term.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106584 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoDriver: Remove some dead code left around after a refactoring. Found by the
Daniel Dunbar [Tue, 22 Jun 2010 20:18:18 +0000 (20:18 +0000)]
Driver: Remove some dead code left around after a refactoring. Found by the
Clang static analyzer!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106568 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoDon't assert on C++ casts that are currently not handled by the static analyzer.
Ted Kremenek [Tue, 22 Jun 2010 19:05:10 +0000 (19:05 +0000)]
Don't assert on C++ casts that are currently not handled by the static analyzer.
Instead, halt the analysis of the current path, which is what we do in GRExprEngine::ProcessStmt
for all other C++ constructs not currently handled by the analyzer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106561 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoTrying to make BuildBot happy again (related to PR7431).
Fariborz Jahanian [Tue, 22 Jun 2010 17:08:32 +0000 (17:08 +0000)]
Trying to make BuildBot happy again (related to PR7431).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106553 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRead/write CXXDeleteExpr from/to PCH.
Argyrios Kyrtzidis [Tue, 22 Jun 2010 17:07:59 +0000 (17:07 +0000)]
Read/write CXXDeleteExpr from/to PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106552 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoDon't allow vector conversions to sneak in under the guise of
Douglas Gregor [Tue, 22 Jun 2010 16:52:27 +0000 (16:52 +0000)]
Don't allow vector conversions to sneak in under the guise of
floating-point conversions or floating-integral conversions. We
really, really, really need to make isFloatingType() and friends not
apply to vector types.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106551 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFixes a problem in generation of meta-data for
Fariborz Jahanian [Tue, 22 Jun 2010 16:33:55 +0000 (16:33 +0000)]
Fixes a problem in generation of meta-data for
category implementation whereby property list was missing.
NeXt ObjC runtime (radar 8093297).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106550 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoSwitch over to the new caching version of getMangledName.
Anders Carlsson [Tue, 22 Jun 2010 16:16:50 +0000 (16:16 +0000)]
Switch over to the new caching version of getMangledName.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106549 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd a new variant of getMangledName that caches the mangling for decls.
Anders Carlsson [Tue, 22 Jun 2010 16:05:32 +0000 (16:05 +0000)]
Add a new variant of getMangledName that caches the mangling for decls.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106547 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd GlobalDecl::getCanonicalDecl.
Anders Carlsson [Tue, 22 Jun 2010 16:00:14 +0000 (16:00 +0000)]
Add GlobalDecl::getCanonicalDecl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106546 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoWhen we ask for the enumerators of an EnumDecl, make sure we get them even if we...
Douglas Gregor [Tue, 22 Jun 2010 14:45:56 +0000 (14:45 +0000)]
When we ask for the enumerators of an EnumDecl, make sure we get them even if we have a EnumDecl that is not the definition of the enumeration

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106541 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoIn C++, allow a declaration of an enum to follow a definition of that
Douglas Gregor [Tue, 22 Jun 2010 14:26:35 +0000 (14:26 +0000)]
In C++, allow a declaration of an enum to follow a definition of that
enum as a GNU extension.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106540 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix PR7180.
Argyrios Kyrtzidis [Tue, 22 Jun 2010 11:30:04 +0000 (11:30 +0000)]
Fix PR7180.

For

void f( a::b::c );

we would cache the tokens "a::b::" but then we would try to annotate them using the range "a::".
Before annotating them with the (invalid) C++ scope spec, set it to the range of "a::b::".

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106536 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoSupport emitting/reading function templates to/from PCH.
Argyrios Kyrtzidis [Tue, 22 Jun 2010 09:55:07 +0000 (09:55 +0000)]
Support emitting/reading function templates to/from PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106534 91177308-0d34-0410-b5e6-96231b3b80d8

14 years ago-Introduce PCHReader::ReadTemplateArgumentLoc()
Argyrios Kyrtzidis [Tue, 22 Jun 2010 09:54:59 +0000 (09:54 +0000)]
-Introduce PCHReader::ReadTemplateArgumentLoc()
-Introduce PCHWriter::AddTemplateArgumentLocInfo()
-Modify PCHWriter::AddTemplateArgumentLoc() to also write TemplateArgumentLoc's TemplateArgument
  and move the existing calls of AddTemplateArgumentLoc() to AddTemplateArgumentLocInfo().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106533 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMake it easier to read/write the template part of FunctionDecl.
Argyrios Kyrtzidis [Tue, 22 Jun 2010 09:54:51 +0000 (09:54 +0000)]
Make it easier to read/write the template part of FunctionDecl.

Introduce:
-FunctionDecl::getTemplatedKind() which returns an enum signifying what kind of templated
  FunctionDecl it is.
-An overload of FunctionDecl::setFunctionTemplateSpecialization() which accepts arrays of
  TemplateArguments and TemplateArgumentLocs
-A constructor to TemplateArgumentList which accepts an array of TemplateArguments.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106532 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoSilence warning about C++-style comments.
Benjamin Kramer [Tue, 22 Jun 2010 09:29:44 +0000 (09:29 +0000)]
Silence warning about C++-style comments.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106531 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd a bunch of stream APIs to SteamChecker.
Zhongxing Xu [Tue, 22 Jun 2010 07:50:21 +0000 (07:50 +0000)]
Add a bunch of stream APIs to SteamChecker.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106530 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoApply array-to-pointer decay when instantiating a MemberExpr. Fixes
Douglas Gregor [Tue, 22 Jun 2010 02:41:05 +0000 (02:41 +0000)]
Apply array-to-pointer decay when instantiating a MemberExpr. Fixes
PR7405, patch by Kyle Lippincott!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106523 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAttempt to fix test
Douglas Gregor [Tue, 22 Jun 2010 02:17:07 +0000 (02:17 +0000)]
Attempt to fix test

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106522 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoPer Chris's comment, remove another static (this one
Fariborz Jahanian [Tue, 22 Jun 2010 00:23:08 +0000 (00:23 +0000)]
Per Chris's comment, remove another static (this one
is a static comparator operator).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106511 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoimplement support for -finstrument-functions, patch by Nelson
Chris Lattner [Tue, 22 Jun 2010 00:03:40 +0000 (00:03 +0000)]
implement support for -finstrument-functions, patch by Nelson
Elhage!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106507 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAlter the internal representation of the condition variable in
Douglas Gregor [Mon, 21 Jun 2010 23:44:13 +0000 (23:44 +0000)]
Alter the internal representation of the condition variable in
if/while/switch/for statements to ensure that walking the children of
these statements actually works. Previously, we stored the condition
variable as a VarDecl. However, StmtIterator isn't able to walk from a
VarDecl to a set of statements, and would (in some circumstances) walk
beyond the end of the list of statements, cause Bad Behavior.

In this change, we've gone back to representing the condition
variables as DeclStmts. While not as memory-efficient as VarDecls, it
greatly simplifies iteration over the children.

Fixes the remainder of <rdar://problem/8104754>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106504 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAvoid using a local static for providing lexical
Fariborz Jahanian [Mon, 21 Jun 2010 23:31:29 +0000 (23:31 +0000)]
Avoid using a local static for providing lexical
order of priorotized global object initializations.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106503 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoZero out a stale pointer
Douglas Gregor [Mon, 21 Jun 2010 22:46:46 +0000 (22:46 +0000)]
Zero out a stale pointer

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106497 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoWhen semantic analysis fail to introduce a class or class template,
Douglas Gregor [Mon, 21 Jun 2010 22:31:09 +0000 (22:31 +0000)]
When semantic analysis fail to introduce a class or class template,
just skip over the body of the class or class template: it's a
semantic disaster that's likely to cause invariants to break. Fixes
part of <rdar://problem/8104754>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106496 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoUpdate checker build.
Ted Kremenek [Mon, 21 Jun 2010 22:25:24 +0000 (22:25 +0000)]
Update checker build.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106495 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoTest case for PR7431 by Nico Weber.
Fariborz Jahanian [Mon, 21 Jun 2010 22:21:57 +0000 (22:21 +0000)]
Test case for PR7431 by Nico Weber.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106494 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoIn fragile-abi (32bit mode abi) generate global symbol
Fariborz Jahanian [Mon, 21 Jun 2010 22:05:18 +0000 (22:05 +0000)]
In fragile-abi (32bit mode abi) generate global symbol
objc_category_name_xxx for each category implementation.
(fixes PR7431) patch by Nico Weber.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106492 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoIn supporting init-priority, globals with the same init_priority must be
Fariborz Jahanian [Mon, 21 Jun 2010 21:27:42 +0000 (21:27 +0000)]
In supporting init-priority, globals with the same init_priority must be
emitted in the order in which they are seen (still radar 8076356).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106485 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoBug 7377: printf checking fails to flag some undefined behavior
Tom Care [Mon, 21 Jun 2010 21:21:01 +0000 (21:21 +0000)]
Bug 7377: printf checking fails to flag some undefined behavior
http://llvm.org/bugs/show_bug.cgi?id=7377

Updated format string highlighting and fixits to take advantage of the new CharSourceRange class.
- Change HighlightRange to allow highlighting whitespace only in a CharSourceRange (for warnings about the ' ' (space) flag)
- Change format specifier range helper function to allow for half-open ranges (+1 to end)
- Enabled previously failing tests (FIXMEs/XFAILs removed)
- Small fixes and additions to format string test cases

M       test/Sema/format-strings.c
M       test/Sema/format-strings-fixit.c
M       lib/Frontend/TextDiagnosticPrinter.cpp
M       lib/Sema/SemaChecking.cpp

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106480 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix an Obj-C++ miscompile when calling an Obj-C method that returns a C++ reference.
Anders Carlsson [Mon, 21 Jun 2010 20:59:55 +0000 (20:59 +0000)]
Fix an Obj-C++ miscompile when calling an Obj-C method that returns a C++ reference.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106477 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd CXType support for querying the return type of Objective-C methods. This is...
Ted Kremenek [Mon, 21 Jun 2010 20:48:56 +0000 (20:48 +0000)]
Add CXType support for querying the return type of Objective-C methods.  This is done by
adding a clang_getCursorResultType() function (which complements clang_getResultType()).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106473 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoaccept and ignore two more gcc warning flags.
Chris Lattner [Mon, 21 Jun 2010 20:40:48 +0000 (20:40 +0000)]
accept and ignore two more gcc warning flags.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106472 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd CXType support for FunctionNoProto and FunctionProto types. This includes adding...
Ted Kremenek [Mon, 21 Jun 2010 20:15:39 +0000 (20:15 +0000)]
Add CXType support for FunctionNoProto and FunctionProto types.  This includes adding a new
function, clang_getResultType(), which returns the result type of the function type.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106459 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoWhen folding additive operations, convert the values to the same type. When assuming...
Jordy Rose [Mon, 21 Jun 2010 20:15:15 +0000 (20:15 +0000)]
When folding additive operations, convert the values to the same type. When assuming relationships, convert the integers to the same type as the symbol, at least for now.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106458 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoIf a nonnull argument evaluates to UnknownVal, don't warn (and don't crash).
Jordy Rose [Mon, 21 Jun 2010 20:08:28 +0000 (20:08 +0000)]
If a nonnull argument evaluates to UnknownVal, don't warn (and don't crash).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106456 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoUse more efficient API of SmallVector/array_pod_sort
Fariborz Jahanian [Mon, 21 Jun 2010 19:49:38 +0000 (19:49 +0000)]
Use more efficient API of SmallVector/array_pod_sort
for sorting (radar 8076356).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106453 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd clang_getCursorType() support for @property declarations.
Ted Kremenek [Mon, 21 Jun 2010 19:41:40 +0000 (19:41 +0000)]
Add clang_getCursorType() support for @property declarations.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106451 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoIRGen for implementation of init-priority attribute.
Fariborz Jahanian [Mon, 21 Jun 2010 18:45:05 +0000 (18:45 +0000)]
IRGen for implementation of init-priority attribute.
Test case will be checked in llvm test suite.
(finishes off radar 8076356).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106441 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoInstantiations subject to an explicit template instantiation
Douglas Gregor [Mon, 21 Jun 2010 18:41:26 +0000 (18:41 +0000)]
Instantiations subject to an explicit template instantiation
declaration have default visibility even under
-fvisibility=hidden. Fixes <rdar://problem/8109763>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106440 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFixes a corner case bug whereby declaring and defining an extern variable in a
Fariborz Jahanian [Mon, 21 Jun 2010 16:08:37 +0000 (16:08 +0000)]
Fixes a corner case bug whereby declaring and defining an extern variable in a
particular sequence causes its definition to not be generated in the object file.
(fixes radar 8071804).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106424 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoCombine ClassTemplateDecl's PreviousDeclaration with CommonPtr, as in FunctionTemplat...
Argyrios Kyrtzidis [Mon, 21 Jun 2010 10:57:41 +0000 (10:57 +0000)]
Combine ClassTemplateDecl's PreviousDeclaration with CommonPtr, as in FunctionTemplateDecl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106412 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoImplement remaining codegen for NEON, all operations should now work.
Nate Begeman [Sun, 20 Jun 2010 23:05:28 +0000 (23:05 +0000)]
Implement remaining codegen for NEON, all operations should now work.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106407 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoSupport PCH emitting/reading of using declarations.
Argyrios Kyrtzidis [Sun, 20 Jun 2010 14:40:59 +0000 (14:40 +0000)]
Support PCH emitting/reading of using declarations.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106404 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd braces to avoid an ambiguous else, fixing a GCC warning.
Benjamin Kramer [Sun, 20 Jun 2010 10:20:36 +0000 (10:20 +0000)]
Add braces to avoid an ambiguous else, fixing a GCC warning.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106403 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdds analyzer support for idempotent and tautological binary operations such as ...
Jordy Rose [Sun, 20 Jun 2010 04:56:29 +0000 (04:56 +0000)]
Adds analyzer support for idempotent and tautological binary operations such as "a*0" and "a+0". This is not very powerful, but does make the analyzer look a little smarter than it actually is.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106402 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoCasting to void* or any other pointer-to-sizeless type (e.g. function pointers) cause...
Jordy Rose [Sun, 20 Jun 2010 04:30:57 +0000 (04:30 +0000)]
Casting to void* or any other pointer-to-sizeless type (e.g. function pointers) causes a divide-by-zero error. Simple fix: check if the pointee type size is 0 and bail out early if it is.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106401 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoCure for Doug's insomnia.
Argyrios Kyrtzidis [Sat, 19 Jun 2010 19:58:34 +0000 (19:58 +0000)]
Cure for Doug's insomnia.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106394 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoInclude a hack to allow loading of templated CXXRecordDecls and test template reading...
Argyrios Kyrtzidis [Sat, 19 Jun 2010 19:29:21 +0000 (19:29 +0000)]
Include a hack to allow loading of templated CXXRecordDecls and test template reading from PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106393 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoInitial support for reading templates from PCH.
Argyrios Kyrtzidis [Sat, 19 Jun 2010 19:29:09 +0000 (19:29 +0000)]
Initial support for reading templates from PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106392 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoInitial support for writing templates to PCH.
Argyrios Kyrtzidis [Sat, 19 Jun 2010 19:28:53 +0000 (19:28 +0000)]
Initial support for writing templates to PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106391 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMore AltiVec support.
Anton Korobeynikov [Sat, 19 Jun 2010 09:47:18 +0000 (09:47 +0000)]
More AltiVec support.
Patch by Anton Yartsev!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106387 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoadd a libs-only target to the clang makefile, patch by Sunay Ismail
Chris Lattner [Sat, 19 Jun 2010 06:35:25 +0000 (06:35 +0000)]
add a libs-only target to the clang makefile, patch by Sunay Ismail
in PR7397

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106386 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix for PR7415: refactor CodeGenModule::MayDeferGeneration and make it less
Eli Friedman [Sat, 19 Jun 2010 06:24:06 +0000 (06:24 +0000)]
Fix for PR7415: refactor CodeGenModule::MayDeferGeneration and make it less
conservative for static variables in templated classes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106385 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix PR7097, a bad interaction between -fno-use-cxa-atexit and
Chris Lattner [Sat, 19 Jun 2010 05:52:45 +0000 (05:52 +0000)]
Fix PR7097, a bad interaction between -fno-use-cxa-atexit and
-mconstructor-aliases by using a WeakVH instead of a raw pointer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106384 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMore Sema Check and a test case for init_priority attr.
Fariborz Jahanian [Fri, 18 Jun 2010 23:14:53 +0000 (23:14 +0000)]
More Sema Check and a test case for init_priority attr.
(radar 8076356).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106350 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFold additive constants, and support comparsions of the form $sym+const1 <> const2
Jordy Rose [Fri, 18 Jun 2010 22:49:11 +0000 (22:49 +0000)]
Fold additive constants, and support comparsions of the form $sym+const1 <> const2

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106339 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agointroduce a new CharSourceRange class, and enhance the diagnostics routines
Chris Lattner [Fri, 18 Jun 2010 22:45:06 +0000 (22:45 +0000)]
introduce a new CharSourceRange class, and enhance the diagnostics routines
to use them instead of SourceRange.  CharSourceRange is just a SourceRange
plus a bool that indicates whether the range has the end character resolved
or whether the end location is the start of the end token.  While most of
the compiler wants to think of ranges that have ends that are the start of
the end token, the printf diagnostic stuff wants to highlight ranges within
tokens.

This is transparent to the diagnostic stuff.  To start taking advantage of
the new capabilities, you can do something like this:
  Diag(..) << CharSourceRange::getCharRange(Begin,End)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106338 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoA trivial fix for a test case that's too horrible to commit. Fixes
Douglas Gregor [Fri, 18 Jun 2010 22:12:56 +0000 (22:12 +0000)]
A trivial fix for a test case that's too horrible to commit. Fixes
<rdar://problem/8108088>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106328 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoImplements Sema part of init_priority(priority) attribute
Fariborz Jahanian [Fri, 18 Jun 2010 21:44:06 +0000 (21:44 +0000)]
Implements Sema part of init_priority(priority) attribute
(radar 8076356) - wip.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106322 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoDon't complain about missing field initializers when the initializer
Douglas Gregor [Fri, 18 Jun 2010 21:43:10 +0000 (21:43 +0000)]
Don't complain about missing field initializers when the initializer
list is completely empty, from Lasse Kärkkäinen! Fixes PR7413.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106320 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMerge the "regparm" attribute from a previous declaration of a
Douglas Gregor [Fri, 18 Jun 2010 21:30:25 +0000 (21:30 +0000)]
Merge the "regparm" attribute from a previous declaration of a
function to redeclarations of that function. Fixes PR7025.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106317 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoJohn called for a less surprising cast
Gabor Greif [Fri, 18 Jun 2010 10:11:35 +0000 (10:11 +0000)]
John called for a less surprising cast

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106277 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMangle tag types (unions, structs, classes, enums) in the Microsoft C++ Mangler.
Charles Davis [Fri, 18 Jun 2010 07:51:00 +0000 (07:51 +0000)]
Mangle tag types (unions, structs, classes, enums) in the Microsoft C++ Mangler.

Also, test that static members with default visibility in a struct have the
right mangling.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106276 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoPrintf format strings: Added some more tests and fixed some minor bugs.
Tom Care [Fri, 18 Jun 2010 03:02:16 +0000 (03:02 +0000)]
Printf format strings: Added some more tests and fixed some minor bugs.
- Precision toStrings shouldn't print a dot when they have no value.
- Length of char length modifier is now returned correctly.
- Added several fixit tests.

Note: fixit tests are currently broken due to a bug in HighlightRange. Marking as XFAIL for now.

M    test/Sema/format-strings-fixit.c
M    include/clang/Analysis/Analyses/PrintfFormatString.h
M    lib/Analysis/PrintfFormatString.cpp

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106275 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd null stream check for more APIs.
Zhongxing Xu [Fri, 18 Jun 2010 02:47:46 +0000 (02:47 +0000)]
Add null stream check for more APIs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106274 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRewrite comment to make my intentions slightly more clear.
Sean Hunt [Fri, 18 Jun 2010 02:14:45 +0000 (02:14 +0000)]
Rewrite comment to make my intentions slightly more clear.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106272 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoChange two static variables into instance variables of ASTContext. This allows us...
Ted Kremenek [Fri, 18 Jun 2010 00:31:04 +0000 (00:31 +0000)]
Change two static variables into instance variables of ASTContext.  This allows us to have multiple copies
of ASTContext at the same time.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106258 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoGiven Decl::isUsed() a flag indicating when to consider the "used"
Douglas Gregor [Thu, 17 Jun 2010 23:14:26 +0000 (23:14 +0000)]
Given Decl::isUsed() a flag indicating when to consider the "used"
attribute as part of the calculation. Sema::MarkDeclReferenced(), and
a few other places, want only to consider the "used" bit to determine,
e.g, whether to perform template instantiation. Fixes a linkage issue
with Boost.Serialization.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106252 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoobjective-C++ IRGen: property reference as an
Fariborz Jahanian [Thu, 17 Jun 2010 23:00:29 +0000 (23:00 +0000)]
objective-C++ IRGen: property reference as an
lvalue when performing a derived-to-base conversion.
Fixes radar 7501812. Added an executable test to
llvm-test suite.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106247 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoBug 7394 - Fixed toString representation of Precisions in format strings.
Tom Care [Thu, 17 Jun 2010 22:55:40 +0000 (22:55 +0000)]
Bug 7394 - Fixed toString representation of Precisions in format strings.

M    include/clang/Analysis/Analyses/PrintfFormatString.h
M    lib/Analysis/PrintfFormatString.cpp

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106245 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoDo not treat @selector as lvalue (unlike g++).
Fariborz Jahanian [Thu, 17 Jun 2010 21:45:48 +0000 (21:45 +0000)]
Do not treat @selector as lvalue (unlike g++).
Patch by Nico Weber (pr7390).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106242 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoImproves RecursiveASTVisitor:
Zhanyong Wan [Thu, 17 Jun 2010 20:56:31 +0000 (20:56 +0000)]
Improves RecursiveASTVisitor:

* refactors code in DEF_TRAVERSE_DECL() into
  TraverseDeclContextHelper() to reduce code bloat and facilitate
  reuse.
* makes the order of traversing a FunctionDecl (including its
  subclasses)'s children more natural: before the function parameters
  are visited after the function body; now they are visited after the
  function type and before the function body.
* fixes a double count for function return type and arguments.

Reviewed by chandlerc and csilvers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106236 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoObjective-c++ IRGen. Support for @selector expression as
Fariborz Jahanian [Thu, 17 Jun 2010 19:56:20 +0000 (19:56 +0000)]
Objective-c++ IRGen. Support for @selector expression as
an lvalue. Fixes PR7390.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106235 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoBug 7377: Fixed several bad printf format string bugs.
Tom Care [Thu, 17 Jun 2010 19:00:27 +0000 (19:00 +0000)]
Bug 7377: Fixed several bad printf format string bugs.
- Added warning for undefined behavior when using field specifier
- Added warning for undefined behavior when using length modifier
- Fixed warnings for invalid flags
- Added warning for ignored flags
- Added fixits for the above warnings
- Fixed accuracy of detecting several undefined behavior conditions
- Receive normal warnings in addition to security warnings when using %n
- Fix bug where '+' flag would remain on unsigned conversion suggestions

Summary of changes:
- Added expanded tests
- Added/expanded warnings
- Added position info to OptionalAmounts for fixits
- Extracted optional flags to a wrapper class with position info for fixits
- Added several methods to validate a FormatSpecifier by component, each checking for undefined behavior
- Fixed conversion specifier checking to conform to C99 standard
- Added hooks to detect the invalid states in CheckPrintfHandler::HandleFormatSpecifier

Note: warnings involving the ' ' (space) flag are temporarily disabled until whitespace highlighting no longer triggers assertions. I will make a post about this on cfe-dev shortly.

M    test/Sema/format-strings.c
M    include/clang/Basic/DiagnosticSemaKinds.td
M    include/clang/Analysis/Analyses/PrintfFormatString.h
M    lib/Analysis/PrintfFormatString.cpp
M    lib/Sema/SemaChecking.cpp

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106233 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoWhen pushing a copy of the TypeLoc information for a dependent
Douglas Gregor [Thu, 17 Jun 2010 16:03:49 +0000 (16:03 +0000)]
When pushing a copy of the TypeLoc information for a dependent
template specialization type, copy the location information but use
the new type. Fixes PR7385.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106224 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoUse UnaryOperator as the representation of dependent expressions when
Douglas Gregor [Thu, 17 Jun 2010 15:46:20 +0000 (15:46 +0000)]
Use UnaryOperator as the representation of dependent expressions when
no overloaded operators were found in scope, mirroring what we already
do for BinaryOperator.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106222 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoUpdate CMake build system for ARM NEON generation.
Douglas Gregor [Thu, 17 Jun 2010 15:17:41 +0000 (15:17 +0000)]
Update CMake build system for ARM NEON generation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106220 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoSome fixes to type-visiting -- a few places where the type-name was
Craig Silverstein [Thu, 17 Jun 2010 13:40:37 +0000 (13:40 +0000)]
Some fixes to type-visiting -- a few places where the type-name was
explicitly typed in the source, but we weren't recursing on it.  One
is new <type>, the other is <type>() (eg int()).

I also fixed the initializer parsing to parse on the syntactic
initializer list, not the semantic.  Usually they'll be identical, so
this won't affect much in practice, but keeps the AST as a syntax-tree
visitor.

Reviewed by chandlerc.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106218 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix typo (test commit)
Peter Collingbourne [Thu, 17 Jun 2010 12:39:05 +0000 (12:39 +0000)]
Fix typo (test commit)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106217 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agofix some more gcc3.4 constness warnings
Gabor Greif [Thu, 17 Jun 2010 11:29:31 +0000 (11:29 +0000)]
fix some more gcc3.4 constness warnings

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106216 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agouse typedef to make hack more transparent and also appease gcc3.4 constness warning
Gabor Greif [Thu, 17 Jun 2010 10:59:08 +0000 (10:59 +0000)]
use typedef to make hack more transparent and also appease gcc3.4 constness warning

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106215 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMake sure the caching mechanism in Parser::ParseLexedMethodDefs is robust against...
Argyrios Kyrtzidis [Thu, 17 Jun 2010 10:52:22 +0000 (10:52 +0000)]
Make sure the caching mechanism in Parser::ParseLexedMethodDefs is robust against the parser reading too few tokens.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106214 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMake sure parens/braces/brackets are correctly balanced.
Argyrios Kyrtzidis [Thu, 17 Jun 2010 10:52:18 +0000 (10:52 +0000)]
Make sure parens/braces/brackets are correctly balanced.

In a line like:

(;

the semicolon leaves Parser:ParenCount unbalanced (it's 1 even though we stopped looking for a right paren).
This may affect later parsing and result in bad recovery for parsing errors.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106213 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoDon't ast-print the builtin __[u]int128_t.
Argyrios Kyrtzidis [Thu, 17 Jun 2010 10:52:11 +0000 (10:52 +0000)]
Don't ast-print the builtin __[u]int128_t.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106212 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMangle operator names in the Microsoft C++ Mangler.
Charles Davis [Thu, 17 Jun 2010 06:47:31 +0000 (06:47 +0000)]
Mangle operator names in the Microsoft C++ Mangler.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106211 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoTweak stack address checker to report multiple cases where globals may reference...
Ted Kremenek [Thu, 17 Jun 2010 04:21:37 +0000 (04:21 +0000)]
Tweak stack address checker to report multiple cases where globals may reference stack memory.
Also refactor the diagnostics so that we print out the kind of stack memory returned.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106210 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoInclude the bug description in the report hash so that we can emit multiple bugs...
Ted Kremenek [Thu, 17 Jun 2010 04:21:27 +0000 (04:21 +0000)]
Include the bug description in the report hash so that we can emit multiple bugs of the same
type at the same location.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106209 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoGenerate arm_neon.inc in include/clang/Basic, which provides:
Nate Begeman [Thu, 17 Jun 2010 04:17:01 +0000 (04:17 +0000)]
Generate arm_neon.inc in include/clang/Basic, which provides:
1. builtins definitions for BuiltinsARM.def
2. intrinsic validation code for SemaChecking

Unsure as to whether this is the best way to handle the make dependencies or not.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106208 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRemove last of the bool shifts for MS VC++, patch by dimitry andric
Nate Begeman [Thu, 17 Jun 2010 02:26:59 +0000 (02:26 +0000)]
Remove last of the bool shifts for MS VC++, patch by dimitry andric

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106206 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoComment Attr.td so people have a better understanding of what goes on.
Sean Hunt [Thu, 17 Jun 2010 01:51:32 +0000 (01:51 +0000)]
Comment Attr.td so people have a better understanding of what goes on.

Also removed the unused Aliases member.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106202 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix format string checking of '%c' by treating it as an integer conversion. Fixes...
Ted Kremenek [Thu, 17 Jun 2010 01:12:20 +0000 (01:12 +0000)]
Fix format string checking of '%c' by treating it as an integer conversion.  Fixes PR 7391.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106196 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoPer conversation with Doug, remove two assertions in ParseLexedMethodDefs() that
Ted Kremenek [Thu, 17 Jun 2010 00:59:17 +0000 (00:59 +0000)]
Per conversation with Doug, remove two assertions in ParseLexedMethodDefs() that
didn't indicate violated invariants but that we weren't recovering well.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106195 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix yet another CMake typo. I'm not quite sure how this succeeded locally now.
Sean Hunt [Thu, 17 Jun 2010 00:51:27 +0000 (00:51 +0000)]
Fix yet another CMake typo. I'm not quite sure how this succeeded locally now.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106193 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix a typo in the previous commit I thought I'd fixed, but apparently didn't.
Sean Hunt [Thu, 17 Jun 2010 00:42:32 +0000 (00:42 +0000)]
Fix a typo in the previous commit I thought I'd fixed, but apparently didn't.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106189 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoUpdate CMake build for new attribute changes.
Sean Hunt [Thu, 17 Jun 2010 00:37:02 +0000 (00:37 +0000)]
Update CMake build for new attribute changes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106188 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRework StackAddrLeakChecker to find stores of stack memory addresses to global variables
Ted Kremenek [Thu, 17 Jun 2010 00:24:44 +0000 (00:24 +0000)]
Rework StackAddrLeakChecker to find stores of stack memory addresses to global variables
by inspecting the Store bindings instead of iterating over all the global variables
in a translation unit.  By looking at the store directly, we avoid cases where we cannot
directly load from the global variable, such as an array (which can result in an assertion failure)
and it also catches cases where we store stack addresses to non-scalar globals.
Also, but not iterating over all the globals in the translation unit, we maintain cache
locality, and the complexity of the checker becomes restricted to the complexity of the
analyzed function, and doesn't scale with the size of the translation unit.

This fixes PR 7383.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106184 91177308-0d34-0410-b5e6-96231b3b80d8