]> granicus.if.org Git - clang/log
clang
12 years agoOnly do typo correction for implicit function decls when
Hans Wennborg [Thu, 8 Dec 2011 15:56:07 +0000 (15:56 +0000)]
Only do typo correction for implicit function decls when
they are treated as errors.

Doing typo correction when these are just warnings slows down the
compilation of source which deliberately uses implicit function
declarations.

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

12 years agoFix: allow @protocol forward declarations inside @implementation-s.
Erik Verbruggen [Thu, 8 Dec 2011 09:58:43 +0000 (09:58 +0000)]
Fix: allow @protocol forward declarations inside @implementation-s.

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

12 years agoUnbreak MSVC build.
Francois Pichet [Thu, 8 Dec 2011 09:32:22 +0000 (09:32 +0000)]
Unbreak MSVC build.

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

12 years agoRemove unused parameter from the LateParsedTemplatedFunction constructor.
Francois Pichet [Thu, 8 Dec 2011 09:11:52 +0000 (09:11 +0000)]
Remove unused parameter from the LateParsedTemplatedFunction constructor.

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

12 years agoAdd an experimental MallocSizeofChecker, which reports inconsistencies
Peter Collingbourne [Thu, 8 Dec 2011 08:31:14 +0000 (08:31 +0000)]
Add an experimental MallocSizeofChecker, which reports inconsistencies
between the casted type of the return value of a malloc/calloc/realloc
call and the operand of any sizeof expressions contained within
its argument(s).

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

12 years agoAllow clang to find gcc libs on suse ppc64
Hal Finkel [Thu, 8 Dec 2011 05:50:03 +0000 (05:50 +0000)]
Allow clang to find gcc libs on suse ppc64

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

12 years agoAdd a minimal unwind.h that knows how to forward to the system one in systems
Rafael Espindola [Thu, 8 Dec 2011 05:01:39 +0000 (05:01 +0000)]
Add a minimal unwind.h that knows how to forward to the system one in systems
that have it in /usr/include (only OS X Lion so far).

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

12 years agoUse the real end of the decltype expression.
David Blaikie [Thu, 8 Dec 2011 04:53:15 +0000 (04:53 +0000)]
Use the real end of the decltype expression.

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

12 years ago[libclang] When doing clang_findReferencesInFile, make sure we don't crash
Argyrios Kyrtzidis [Thu, 8 Dec 2011 01:56:07 +0000 (01:56 +0000)]
[libclang] When doing clang_findReferencesInFile, make sure we don't crash
if we come up against a null Decl.

No test case unfortunately. rdar://10457799.

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

12 years agoMinor cleanup. Avoid redundant getTriple() calls.
Bob Wilson [Thu, 8 Dec 2011 01:10:19 +0000 (01:10 +0000)]
Minor cleanup.  Avoid redundant getTriple() calls.

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

12 years ago[libclang] Remove IndexingContext's getScopedContext(), it's not useful
Argyrios Kyrtzidis [Thu, 8 Dec 2011 00:54:07 +0000 (00:54 +0000)]
[libclang] Remove IndexingContext's getScopedContext(), it's not useful
now that client containers can be set via function calls.

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

12 years agoDriver/Linux: Fix the ASAN library path to match current compiler-rt
Daniel Dunbar [Wed, 7 Dec 2011 23:22:17 +0000 (23:22 +0000)]
Driver/Linux: Fix the ASAN library path to match current compiler-rt
integration.

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

12 years agoDriver: Add a --rtlib={compiler-rt,libgcc} argument which I plan to use to allow
Daniel Dunbar [Wed, 7 Dec 2011 23:03:15 +0000 (23:03 +0000)]
Driver: Add a --rtlib={compiler-rt,libgcc} argument which I plan to use to allow
dual support for compiler-rt on Linux, during bringup.

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

12 years agoImplement inference for the "Private" submodule corresponding to
Douglas Gregor [Wed, 7 Dec 2011 22:05:21 +0000 (22:05 +0000)]
Implement inference for the "Private" submodule corresponding to
private headers in a framework.

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

12 years agoMake sure we pick up module_private.map when loading a module.map file.
Douglas Gregor [Wed, 7 Dec 2011 21:25:07 +0000 (21:25 +0000)]
Make sure we pick up module_private.map when loading a module.map file.

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

12 years ago[libclang] Indexing API: provide both the semantic and the lexical container.
Argyrios Kyrtzidis [Wed, 7 Dec 2011 20:44:19 +0000 (20:44 +0000)]
[libclang] Indexing API: provide both the semantic and the lexical container.

They are generally the same except in C++ cases like out-of-line member functions.

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

12 years ago[libclang] Fix indexing of C++ bases in a C++ class.
Argyrios Kyrtzidis [Wed, 7 Dec 2011 20:44:15 +0000 (20:44 +0000)]
[libclang] Fix indexing of C++ bases in a C++ class.

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

12 years ago[libclang] Introduce CXIdxEntityLanguage that indicates the language
Argyrios Kyrtzidis [Wed, 7 Dec 2011 20:44:12 +0000 (20:44 +0000)]
[libclang] Introduce CXIdxEntityLanguage that indicates the language
of an indexed entity.

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

12 years ago[analyzer] Cleanup: use the variable.
Anna Zaks [Wed, 7 Dec 2011 19:56:13 +0000 (19:56 +0000)]
[analyzer] Cleanup: use the variable.

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

12 years agoruntime/Linux: Include the profile and ASAN libs on x86.
Daniel Dunbar [Wed, 7 Dec 2011 19:35:10 +0000 (19:35 +0000)]
runtime/Linux: Include the profile and ASAN libs on x86.

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

12 years ago[analyzer] More www; document ProgramState->dump().
Anna Zaks [Wed, 7 Dec 2011 19:04:27 +0000 (19:04 +0000)]
[analyzer] More www; document ProgramState->dump().

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

12 years ago[analyzer] Update the checker writer manual with explanation of SVals
Anna Zaks [Wed, 7 Dec 2011 19:04:24 +0000 (19:04 +0000)]
[analyzer] Update the checker writer manual with explanation of SVals
and the link to checker callback documentation.

SVal, SymExpr, MemRegion description is a slightly edited version of
Ted's reply to a question on cfe-dev list.

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

12 years agoRemove unused-but-set variable.
Benjamin Kramer [Wed, 7 Dec 2011 12:50:05 +0000 (12:50 +0000)]
Remove unused-but-set variable.

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

12 years agoMake printf warnings refer to intmax_t et al. by name
Hans Wennborg [Wed, 7 Dec 2011 10:33:11 +0000 (10:33 +0000)]
Make printf warnings refer to intmax_t et al. by name
in addition to underlying type.

For example, the warning for printf("%zu", 42.0);
changes from "conversion specifies type 'unsigned long'" to "conversion
specifies type 'size_t' (aka 'unsigned long')"

(This is a second attempt after r145697, which got reverted.)

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

12 years agoMake changes to SDiagsWriter to make it work in combination with the ARC migrator:
Argyrios Kyrtzidis [Wed, 7 Dec 2011 05:52:12 +0000 (05:52 +0000)]
Make changes to SDiagsWriter to make it work in combination with the ARC migrator:

-Allow it to be used with multiple BeginSourceFile/EndSourceFile calls; for this introduce
 a "finish" callback method in the DiagnosticConsumer. SDiagsWriter finishes up the serialization
 file inside this method.
-Make it independent of any particular DiagnosticsEngine; make it use the SourceManager of the
 Diagnostic object.
-Ignore null source ranges.

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

12 years ago[libclang] Index C++ namespaces.
Argyrios Kyrtzidis [Wed, 7 Dec 2011 05:52:06 +0000 (05:52 +0000)]
[libclang] Index C++ namespaces.

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

12 years agoFix multilib library paths on ppc64 Linux. Patch by Michael Kostylev. PR11472.
Eli Friedman [Wed, 7 Dec 2011 04:00:53 +0000 (04:00 +0000)]
Fix multilib library paths on ppc64 Linux.  Patch by Michael Kostylev.  PR11472.

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

12 years agowww: Update getting started to encourage people to check out compielr-rt.
Daniel Dunbar [Wed, 7 Dec 2011 03:04:42 +0000 (03:04 +0000)]
www: Update getting started to encourage people to check out compielr-rt.

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

12 years agoInitialize these values, fixing the build in cases where stack realignment
Nick Lewycky [Wed, 7 Dec 2011 02:33:23 +0000 (02:33 +0000)]
Initialize these values, fixing the build in cases where stack realignment
actually occurs.

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

12 years agoImplement basic support for private headers in frameworks. In essence,
Douglas Gregor [Wed, 7 Dec 2011 02:23:45 +0000 (02:23 +0000)]
Implement basic support for private headers in frameworks. In essence,
when we load a module map (module.map) from a directory, also load a
private module map (module_private.map) for that directory, if
present. That private module map can inject a new submodule that
captures private headers.

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

12 years agoTweak serialized diagnostics to support errors with no categories. Fixes <rdar:...
Ted Kremenek [Wed, 7 Dec 2011 02:08:00 +0000 (02:08 +0000)]
Tweak serialized diagnostics to support errors with no categories.  Fixes <rdar://problem/10538300>.

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

12 years agoMake sure we correctly zero-initialize unions containing a pointer to data member...
Eli Friedman [Wed, 7 Dec 2011 01:30:11 +0000 (01:30 +0000)]
Make sure we correctly zero-initialize unions containing a pointer to data member as the first field.  PR11487.

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

12 years ago[analyzer] Propagate taint through MemRegions.
Anna Zaks [Wed, 7 Dec 2011 01:09:52 +0000 (01:09 +0000)]
[analyzer] Propagate taint through MemRegions.
SVal can be not only a symbol, but a MemRegion. Add support for such
cases.

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

12 years agoIf we can't write the temporary module map file when compiling a
Douglas Gregor [Wed, 7 Dec 2011 00:54:14 +0000 (00:54 +0000)]
If we can't write the temporary module map file when compiling a
module, at least have the decency to complain about it.

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

12 years agoWhen folding the size of a global scope VLA to a constant, require the array
Richard Smith [Wed, 7 Dec 2011 00:43:50 +0000 (00:43 +0000)]
When folding the size of a global scope VLA to a constant, require the array
bound to not have side effects(!). Add constant-folding support for expressions
of void type, to ensure that we can still fold ((void)0, 1) as an array bound.

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

12 years agoobjc: issue deprecated/unavailable diagnostic when
Fariborz Jahanian [Wed, 7 Dec 2011 00:30:00 +0000 (00:30 +0000)]
objc: issue deprecated/unavailable diagnostic when
methods with these attributes are sent to receivers
of 'id' type too. // rdar://10459930

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

12 years agoDeadStoresChecker: when whitelisting dead initializations with constants, look
Richard Smith [Tue, 6 Dec 2011 23:25:15 +0000 (23:25 +0000)]
DeadStoresChecker: when whitelisting dead initializations with constants, look
for a foldable constant rather than an IR-level constant. This is still far too
liberal, but is a step in the right direction.

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

12 years ago[analyzer] Add comments related to symbol_iterator
Anna Zaks [Tue, 6 Dec 2011 23:12:38 +0000 (23:12 +0000)]
[analyzer] Add comments related to symbol_iterator

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

12 years ago[analyzer] Refactor: Move symbol_iterator from SVal to SymExpr, use it
Anna Zaks [Tue, 6 Dec 2011 23:12:33 +0000 (23:12 +0000)]
[analyzer] Refactor: Move symbol_iterator from SVal to SymExpr, use it
for finding dependent symbols for taint.

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

12 years ago[analyzer] Propagate taint through NonLoc to NonLoc casts.
Anna Zaks [Tue, 6 Dec 2011 23:12:27 +0000 (23:12 +0000)]
[analyzer] Propagate taint through NonLoc to NonLoc casts.

 - Created a new SymExpr type - SymbolCast.
 - SymbolCast is created when we don't know how to simplify a NonLoc to
NonLoc casts.
 - A bit of code refactoring: introduced dispatchCast to have better
code reuse, remove a goto.
 - Updated the test case to showcase the new taint flow.

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

12 years ago[analyzer] Remove an unnecessary check.
Anna Zaks [Tue, 6 Dec 2011 23:12:17 +0000 (23:12 +0000)]
[analyzer] Remove an unnecessary check.

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

12 years agoAdd a FIXME to provide a sensible error message here
Douglas Gregor [Tue, 6 Dec 2011 23:04:08 +0000 (23:04 +0000)]
Add a FIXME to provide a sensible error message here

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

12 years agoMove vector bitcast handling in constant expressions from the expression
Richard Smith [Tue, 6 Dec 2011 22:44:34 +0000 (22:44 +0000)]
Move vector bitcast handling in constant expressions from the expression
evaluator into constant initializer handling / IRGen. The practical consequence
of this is that the bitcast now lives in the constant's definition, rather than
in its uses.

The code in the constant expression evaluator was producing vectors of the wrong
type and size (and possibly of the wrong value for a big-endian int-to-vector
bitcast). We were getting away with this only because we don't yet support
constant-folding of any expressions which inspect vector values.

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

12 years agoUse absolute paths for temporary module map files
Douglas Gregor [Tue, 6 Dec 2011 22:05:29 +0000 (22:05 +0000)]
Use absolute paths for temporary module map files

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

12 years ago[libclang] API enhancements by Joe Groff!
Argyrios Kyrtzidis [Tue, 6 Dec 2011 22:05:01 +0000 (22:05 +0000)]
[libclang] API enhancements by Joe Groff!

- Exposes a CXType_Vector type kind for vector types.
- Adds generalized versions of the clang_getArrayElementType and clang_getArraySize functions, named clang_getElementType and clang_getNumElements, which work on array, vector, or complex types.
- Adds additional functions for querying function types. clang_isFunctionTypeVariadic returns true if a function type is variadic. clang_getFunctionCallingConv returns an enumeration value indicating the calling convention of the function type. clang_getNumArgTypes returns the number of static argument types, and clang_getArgType gets the type of an argument.
- Adds a clang_getTypedefDeclUnderlyingType function to get the underlying type from a TypedefDecl cursor.
- Adds a clang_getEnumDeclIntegerType function to get the integer type from an EnumDecl cursor.
- Adds clang_getEnumConstantDeclValue and clang_getEnumConstantDeclUnsignedValue functions to get the value of an EnumConstantDecl as a signed or unsigned long long, respectively.
- Exposes a CXCursor_AsmLabelAttr cursor kind for __asm__("label") attributes.
- Alters clang_getCursorSpelling to return the label value for AsmLabelAttr-kind cursors.

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

12 years agoRename Objective-C-only tests to .m
Douglas Gregor [Tue, 6 Dec 2011 20:51:42 +0000 (20:51 +0000)]
Rename Objective-C-only tests to .m

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

12 years agoRemove misleading error message
Douglas Gregor [Tue, 6 Dec 2011 19:57:48 +0000 (19:57 +0000)]
Remove misleading error message

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

12 years agoWhen inferring a module map for a framework, infer subframework
Douglas Gregor [Tue, 6 Dec 2011 19:39:29 +0000 (19:39 +0000)]
When inferring a module map for a framework, infer subframework
modules for each of its subframeworks.

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

12 years agoRemove unused member to appease valgrind.
Benjamin Kramer [Tue, 6 Dec 2011 19:26:57 +0000 (19:26 +0000)]
Remove unused member to appease valgrind.

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

12 years ago[asan] Mac: do not link dynamic libs with the asan-rt, use -undefined dynamic_lookup...
Kostya Serebryany [Tue, 6 Dec 2011 19:18:44 +0000 (19:18 +0000)]
[asan] Mac: do not link dynamic libs with the asan-rt, use -undefined dynamic_lookup for dynamic libs. Style fixes. Patch by glider@google.com

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

12 years agoAllow inferred submodules for any (sub)module that has an umbrella header
Douglas Gregor [Tue, 6 Dec 2011 17:34:58 +0000 (17:34 +0000)]
Allow inferred submodules for any (sub)module that has an umbrella header

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

12 years agoWhen suggesting a module import for a #include or #import, suggest the
Douglas Gregor [Tue, 6 Dec 2011 17:31:28 +0000 (17:31 +0000)]
When suggesting a module import for a #include or #import, suggest the
most specific (sub)module based on the actual file we find, rather
than always importing the top-level module. This means
that #include'ing <Foo/Blah.h> should give us the submodule Foo.Blah.

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

12 years agoImplement modules support for subframeworks (aka embedded
Douglas Gregor [Tue, 6 Dec 2011 17:16:41 +0000 (17:16 +0000)]
Implement modules support for subframeworks (aka embedded
frameworks). A submodule can now be labeled as a "framework", and
header search will look into the appropriate Headers/PrivateHeaders
subdirectories for named headers.

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

12 years agoWhen building the main file to parse given a module map, don't skip
Douglas Gregor [Tue, 6 Dec 2011 17:15:11 +0000 (17:15 +0000)]
When building the main file to parse given a module map, don't skip
explicit submodules or umbrella headers from submodules. Instead,
build the entire module at once, and let the name-hiding mechanisms
hide the contents of explicit submodules at load time.

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

12 years agoHeaders: wmmintrin.h only needs xmmintrin.h.
Daniel Dunbar [Tue, 6 Dec 2011 16:17:54 +0000 (16:17 +0000)]
Headers: wmmintrin.h only needs xmmintrin.h.
 - Fixes <rdar://problem/10261246> clang -maes option is not sufficient to
   include <wmmintrin.h>

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

12 years agoMinor tweak to prepare for submodules with umbrella headers. No actual
Douglas Gregor [Tue, 6 Dec 2011 16:17:15 +0000 (16:17 +0000)]
Minor tweak to prepare for submodules with umbrella headers. No actual
functionality change yet.

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

12 years agoInstall cpuid.h when building with cmake too.
Rafael Espindola [Tue, 6 Dec 2011 15:46:47 +0000 (15:46 +0000)]
Install cpuid.h when building with cmake too.

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

12 years agoSuggest typo corrections for implicit function declarations.
Hans Wennborg [Tue, 6 Dec 2011 09:46:12 +0000 (09:46 +0000)]
Suggest typo corrections for implicit function declarations.

A mistyped function call becomes an inmplicit function declaration in C.
Suggest typo correction when one can be found.

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

12 years agoExtend warnings for missing '@end'.
Erik Verbruggen [Tue, 6 Dec 2011 09:25:23 +0000 (09:25 +0000)]
Extend warnings for missing '@end'.
Fixes PR2709.

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

12 years agoSwitch a cast to a dyn_cast and check the pointer before using. Fixes a crash
Richard Trieu [Tue, 6 Dec 2011 04:48:01 +0000 (04:48 +0000)]
Switch a cast to a dyn_cast and check the pointer before using.  Fixes a crash
in the following code:

void test4(bool (&x)(void)) {
  while (x);
}

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

12 years agoFix test for unrelated changes.
Nick Lewycky [Tue, 6 Dec 2011 03:46:28 +0000 (03:46 +0000)]
Fix test for unrelated changes.

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

12 years agoStack realignment is a tristate. Add -mno-stackrealign to turn off all stack
Nick Lewycky [Tue, 6 Dec 2011 03:33:03 +0000 (03:33 +0000)]
Stack realignment is a tristate. Add -mno-stackrealign to turn off all stack
realignment, even with locals with alignment exceeding the ABI guarantee.

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

12 years agoMinor comment update.
Eli Friedman [Tue, 6 Dec 2011 03:08:26 +0000 (03:08 +0000)]
Minor comment update.

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

12 years agoFix an extremely stupid bug causing terrible miscompilations
John McCall [Tue, 6 Dec 2011 02:56:18 +0000 (02:56 +0000)]
Fix an extremely stupid bug causing terrible miscompilations
of &= on pseudo-objects.

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

12 years agoImplement inferred submodules support, which (when requested)
Douglas Gregor [Tue, 6 Dec 2011 01:10:29 +0000 (01:10 +0000)]
Implement inferred submodules support, which (when requested)
implicitly generates submodules corresponding to the headers that fall
within a module.

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

12 years agoMake sure we perform lvalue-to-rvalue conversions for enum initializers. PR11484.
Eli Friedman [Tue, 6 Dec 2011 00:10:34 +0000 (00:10 +0000)]
Make sure we perform lvalue-to-rvalue conversions for enum initializers.  PR11484.

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

12 years agoobjc: put out more coherent warning when method definition
Fariborz Jahanian [Tue, 6 Dec 2011 00:02:41 +0000 (00:02 +0000)]
objc: put out more coherent warning when method definition
attributes don't match its declaration. // rdar://10529259.

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

12 years agoAdd -mstack-alignment=X and fix -mstackrealign handling now that the
Joerg Sonnenberger [Mon, 5 Dec 2011 23:05:23 +0000 (23:05 +0000)]
Add -mstack-alignment=X and fix -mstackrealign handling now that the
backend options are gone.

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

12 years agoMore refactoring of objc rewriter.
Fariborz Jahanian [Mon, 5 Dec 2011 22:59:54 +0000 (22:59 +0000)]
More refactoring of objc rewriter.

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

12 years agoParse inferred submodules in module maps, track their contents in
Douglas Gregor [Mon, 5 Dec 2011 22:27:44 +0000 (22:27 +0000)]
Parse inferred submodules in module maps, track their contents in
Module, and (de-)serialize this information. Semantics of inferred
submodules to follow.

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

12 years agoMake EmitAggregateCopy take an alignment argument. Make EmitFinalDestCopy pass in...
Eli Friedman [Mon, 5 Dec 2011 22:23:28 +0000 (22:23 +0000)]
Make EmitAggregateCopy take an alignment argument.  Make EmitFinalDestCopy pass in the correct alignment when known.

The test includes a FIXME for a related case involving calls; it's a bit more complicated to fix because the RValue class doesn't keep track of alignment.

<rdar://problem/10463337>

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

12 years ago[libclang] When indexing a field in a C++ class, return an entity
Argyrios Kyrtzidis [Mon, 5 Dec 2011 22:05:28 +0000 (22:05 +0000)]
[libclang] When indexing a field in a C++ class, return an entity
of kind CXIdxEntity_CXXInstanceVariable. rdar://10522503.

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

12 years ago[analyzer] Rely on LLVM Dominators in Clang dominator computation.
Anna Zaks [Mon, 5 Dec 2011 21:33:11 +0000 (21:33 +0000)]
[analyzer] Rely on LLVM Dominators in Clang dominator computation.

(Previously, Clang used it's implementation of dominators.)

The patch is contributed by Guoping Long!

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

12 years ago[analyzer] Mark ConstraintManager::canReasonAbout as protected.
Anna Zaks [Mon, 5 Dec 2011 21:33:06 +0000 (21:33 +0000)]
[analyzer] Mark ConstraintManager::canReasonAbout as protected.

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

12 years ago[analyzer] Simplify the condition.
Anna Zaks [Mon, 5 Dec 2011 21:33:01 +0000 (21:33 +0000)]
[analyzer] Simplify the condition.

This is a fixup for r145832.

The extra clauses do not matter after we remove the dependency on canReasonAbout(InitVal) in r145832.

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

12 years ago[analyzer] Simplify the expected-warning statement.
Anna Zaks [Mon, 5 Dec 2011 21:32:58 +0000 (21:32 +0000)]
[analyzer] Simplify the expected-warning statement.

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

12 years agoAdd a warning for implicit conversion from function literals (and static
Lang Hames [Mon, 5 Dec 2011 20:49:50 +0000 (20:49 +0000)]
Add a warning for implicit conversion from function literals (and static
methods) to bool. E.g.

void foo() {}
if (f) { ... // <- Warns here.
}

Only applies to non-weak functions, and does not apply if the function address
is taken explicitly with the addr-of operator.

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

12 years agoMake isWeakDecl available as a method on ValueDecl.
Lang Hames [Mon, 5 Dec 2011 20:16:26 +0000 (20:16 +0000)]
Make isWeakDecl available as a method on ValueDecl.

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

12 years agoMore objc rewriter refactoring.
Fariborz Jahanian [Mon, 5 Dec 2011 19:50:04 +0000 (19:50 +0000)]
More objc rewriter refactoring.

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

12 years ago[analyzer] Add a missing taint tester warning.
Anna Zaks [Mon, 5 Dec 2011 18:58:33 +0000 (18:58 +0000)]
[analyzer] Add a missing taint tester warning.

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

12 years ago[analyzer] Unify SymbolVal and SymExprVal under a single SymbolVal
Anna Zaks [Mon, 5 Dec 2011 18:58:30 +0000 (18:58 +0000)]
[analyzer] Unify SymbolVal and SymExprVal under a single SymbolVal
class.

We are going into the direction of handling SymbolData and other SymExpr
uniformly, so it makes less sense to keep two different SVal classes.
For example, the checkers would have to take an extra step to reason
about each type separately.

The classes have the same members, we were just using the SVal kind
field for easy differentiation in 3 switch statements. The switch
statements look more ugly now, but we can make the code more readable in
other ways, for example, moving some code into separate functions.

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

12 years ago[analyzer] Remove all uses of ConstraintManager::canResonAbout() from
Anna Zaks [Mon, 5 Dec 2011 18:58:25 +0000 (18:58 +0000)]
[analyzer] Remove all uses of ConstraintManager::canResonAbout() from
ExprEngine.

Teach SimpleConstraintManager::assumeSymRel() to propagate constraints
to symbolic expressions.

+ One extra warning (real bug) is now generated due to enhanced
assumeSymRel().

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

12 years ago[analyzer] First step toward removing
Anna Zaks [Mon, 5 Dec 2011 18:58:19 +0000 (18:58 +0000)]
[analyzer] First step toward removing
ConstraintManager::canReasonAbout() from the ExprEngine.

ExprEngine should not care if the constraint solver can reason about
something or not. The solver should be able to handle all the SymExprs.

To do this, the solver should be able to keep track of not only the
SymbolData but of all SymExprs. This is why we change SymbolRef to be an
alias of SymExpr*. When encountering an expression it cannot simplify,
the solver should just add the constraints to it.

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

12 years ago[analyzer] Minor improvements on RangeConstraint pretty-printing.
Anna Zaks [Mon, 5 Dec 2011 18:58:14 +0000 (18:58 +0000)]
[analyzer] Minor improvements on RangeConstraint pretty-printing.

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

12 years ago[analyzer] Change RetainCountChecker to use symbol dump method instead
Anna Zaks [Mon, 5 Dec 2011 18:58:11 +0000 (18:58 +0000)]
[analyzer] Change RetainCountChecker to use symbol dump method instead
of relying on SymbolID.

This way any expression can be printed (not only SymbolData).

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

12 years ago[analyzer] Add ability to do a simple ProgramState dump() without
Anna Zaks [Mon, 5 Dec 2011 18:58:08 +0000 (18:58 +0000)]
[analyzer] Add ability to do a simple ProgramState dump() without
requiring CFG.

Adding more ugly code; the evnvironment printing should be moved to
envirnment at some point.

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

12 years ago[analyzer] Add a debug checker to test for tainted data.
Anna Zaks [Mon, 5 Dec 2011 18:58:01 +0000 (18:58 +0000)]
[analyzer] Add a debug checker to test for tainted data.

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

12 years agoSome early refactoring of objective-c rewriter.
Fariborz Jahanian [Mon, 5 Dec 2011 18:43:13 +0000 (18:43 +0000)]
Some early refactoring of objective-c rewriter.

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

12 years ago[asan] don't require libstdc++ for asan on linux. Mac fix will go separately
Kostya Serebryany [Mon, 5 Dec 2011 18:32:37 +0000 (18:32 +0000)]
[asan] don't require libstdc++ for asan on linux. Mac fix will go separately

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

12 years agowe got badgered into supporting multi-alternative constraints.
Chris Lattner [Mon, 5 Dec 2011 18:29:03 +0000 (18:29 +0000)]
we got badgered into supporting multi-alternative constraints.

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

12 years agoInferred framework modules automatically export anything they import
Douglas Gregor [Mon, 5 Dec 2011 17:40:25 +0000 (17:40 +0000)]
Inferred framework modules automatically export anything they import
(i.e., 'export *'), to better match the semantics of headers.

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

12 years agoFix printing of wildcard exports.
Douglas Gregor [Mon, 5 Dec 2011 17:34:59 +0000 (17:34 +0000)]
Fix printing of wildcard exports.

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

12 years agoImplement support for wildcard exports in modules, allowing a module
Douglas Gregor [Mon, 5 Dec 2011 17:28:06 +0000 (17:28 +0000)]
Implement support for wildcard exports in modules, allowing a module
to re-export anything that it imports. This opt-in feature makes a
module behave more like a header, because it can be used to re-export
the transitive closure of a (sub)module's dependencies.

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

12 years agoActually add a useful bit to the comment pre-FIXME
Douglas Gregor [Mon, 5 Dec 2011 16:35:23 +0000 (16:35 +0000)]
Actually add a useful bit to the comment pre-FIXME

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

12 years agoWhen writing a module file, keep track of the set of (sub)modules that
Douglas Gregor [Mon, 5 Dec 2011 16:33:54 +0000 (16:33 +0000)]
When writing a module file, keep track of the set of (sub)modules that
it imports, establishing dependencies at the (sub)module
granularity. This is not a user-visible change (yet).

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

12 years agoinclude/clang*/Makefile: Tweak installation to work with CLANG_SRCDIR.
NAKAMURA Takumi [Mon, 5 Dec 2011 06:13:20 +0000 (06:13 +0000)]
include/clang*/Makefile: Tweak installation to work with CLANG_SRCDIR.

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

12 years agoSupport decltype in nested-name-specifiers.
David Blaikie [Sun, 4 Dec 2011 05:04:18 +0000 (05:04 +0000)]
Support decltype in nested-name-specifiers.

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

12 years agoMove block return type inference diagnostic to a common place where
Fariborz Jahanian [Sat, 3 Dec 2011 23:53:56 +0000 (23:53 +0000)]
Move block return type inference diagnostic to a common place where
Function or array lvalue conversions happens.

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

12 years agoFix mangling substitutions for address-space-qualified class
Douglas Gregor [Sat, 3 Dec 2011 18:24:43 +0000 (18:24 +0000)]
Fix mangling substitutions for address-space-qualified class
types. Patch from Dmitri Rubinstein!

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

12 years agoImplement support for the __is_final type trait, to determine whether
Douglas Gregor [Sat, 3 Dec 2011 18:14:24 +0000 (18:14 +0000)]
Implement support for the __is_final type trait, to determine whether
a class is marked 'final', from Alberto Ganesh Barbati! Fixes
PR11462.

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