]> granicus.if.org Git - clang/log
clang
11 years ago[libclang] Remove this test while I investigate why it is crashing on release+asserts.
Argyrios Kyrtzidis [Thu, 11 Oct 2012 19:21:21 +0000 (19:21 +0000)]
[libclang] Remove this test while I investigate why it is crashing on release+asserts.

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

11 years agoAdd null check for malformed code.
Ted Kremenek [Thu, 11 Oct 2012 19:06:43 +0000 (19:06 +0000)]
Add null check for malformed code.

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

11 years ago[libclang] Add tests for indexing modules and PCHs using modules.
Argyrios Kyrtzidis [Thu, 11 Oct 2012 19:00:44 +0000 (19:00 +0000)]
[libclang] Add tests for indexing modules and PCHs using modules.

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

11 years agoFix build failure from r165722
Derek Schuff [Thu, 11 Oct 2012 18:21:13 +0000 (18:21 +0000)]
Fix build failure from r165722

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

11 years agoIntroduce a simple "hint" scheme to eliminate the quadratic behavior
Douglas Gregor [Thu, 11 Oct 2012 17:41:54 +0000 (17:41 +0000)]
Introduce a simple "hint" scheme to eliminate the quadratic behavior
associated with deserializing macro history for an identifier.

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

11 years agoMake the deserialization of PendingMacroIDs deterministic.
Douglas Gregor [Thu, 11 Oct 2012 17:31:34 +0000 (17:31 +0000)]
Make the deserialization of PendingMacroIDs deterministic.

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

11 years agoAdd in the first iteration of support for llvm/clang/lldb to allow variable per addre...
Micah Villmow [Thu, 11 Oct 2012 17:21:41 +0000 (17:21 +0000)]
Add in the first iteration of support for llvm/clang/lldb to allow variable per address space pointer sizes to be optimized correctly.

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

11 years ago-Warc-repeated-use-of-weak: fix a use-of-uninitialized and add a test case.
Jordan Rose [Thu, 11 Oct 2012 17:02:00 +0000 (17:02 +0000)]
-Warc-repeated-use-of-weak: fix a use-of-uninitialized and add a test case.

Fix-up for r165718, should get the buildbots back online.

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

11 years agoProperly factor Native Client defines to support NaCl as an OS
Derek Schuff [Thu, 11 Oct 2012 16:55:58 +0000 (16:55 +0000)]
Properly factor Native Client defines to support NaCl as an OS
with x86/ARM architecture

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

11 years agoHandle gnu_inline in c++ in a gcc compatible way. Original patch by Tobias
Rafael Espindola [Thu, 11 Oct 2012 16:32:25 +0000 (16:32 +0000)]
Handle gnu_inline in c++ in a gcc compatible way. Original patch by Tobias
Grosser.

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

11 years ago-Warc-repeated-use-of-weak: Don't warn on a single read followed by writes.
Jordan Rose [Thu, 11 Oct 2012 16:10:19 +0000 (16:10 +0000)]
-Warc-repeated-use-of-weak: Don't warn on a single read followed by writes.

This is a "safe" pattern, or at least one that cannot be helped by using
a strong local variable. However, if the single read is within a loop,
it should /always/ be treated as potentially dangerous.

<rdar://problem/12437490>

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

11 years ago-Warc-repeated-use-of-weak: Check messages to property accessors as well.
Jordan Rose [Thu, 11 Oct 2012 16:06:21 +0000 (16:06 +0000)]
-Warc-repeated-use-of-weak: Check messages to property accessors as well.

Previously, [foo weakProp] was not being treated the same as foo.weakProp.
Now, for every explicit message send, we check if it's a property access,
and if so, if the property is weak. Then for every assignment of a
message, we have to do the same thing again.

This is a potentially expensive increase because determining whether a
method is a property accessor requires searching through the methods it
overrides. However, without it -Warc-repeated-use-of-weak will miss cases
from people who prefer not to use dot syntax. If this turns out to be
too expensive, we can try caching the result somewhere, or even lose
precision by not checking superclass methods. The warning is off-by-default,
though.

<rdar://problem/12407765>

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

11 years ago[libclang] Improve AST serialization done by ASTUnit::Save().
Argyrios Kyrtzidis [Thu, 11 Oct 2012 16:05:00 +0000 (16:05 +0000)]
[libclang] Improve AST serialization done by ASTUnit::Save().

The ASTUnit needs to initialize an ASTWriter at the beginning of
parsing to fully handle serialization of a translation unit that
imports modules. Do this by introducing an option to enable it, which
corresponds to CXTranslationUnit_ForSerialization on the C API side.

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

11 years agoObjCMethodDecl::findPropertyDecl: bail out early if not an instance method.
Jordan Rose [Thu, 11 Oct 2012 16:02:02 +0000 (16:02 +0000)]
ObjCMethodDecl::findPropertyDecl: bail out early if not an instance method.

Currently, Objective-C does not support class properties, even though it
allows calling class methods with dot syntax.

No intended functionality change; purely optimization.

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

11 years agoMake X86_64ABIInfo clean for ABIs with 32 bit pointers, such as X32
Derek Schuff [Thu, 11 Oct 2012 15:52:22 +0000 (15:52 +0000)]
Make X86_64ABIInfo clean for ABIs with 32 bit pointers, such as X32
and Native Client

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

11 years agoclang/test/CodeGenCXX/microsoft-uuidof.cpp: Fix for -Asserts.
NAKAMURA Takumi [Thu, 11 Oct 2012 11:20:31 +0000 (11:20 +0000)]
clang/test/CodeGenCXX/microsoft-uuidof.cpp: Fix for -Asserts.

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

11 years agoAdd codegen support for __uuidof().
Nico Weber [Thu, 11 Oct 2012 10:13:44 +0000 (10:13 +0000)]
Add codegen support for __uuidof().

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

11 years agoAdd prologue text for list of potential checkers.
Ted Kremenek [Thu, 11 Oct 2012 06:26:56 +0000 (06:26 +0000)]
Add prologue text for list of potential checkers.

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

11 years agoclang/lib/Headers/CMakeLists.txt: Add f16cintrin.h.
NAKAMURA Takumi [Thu, 11 Oct 2012 01:10:04 +0000 (01:10 +0000)]
clang/lib/Headers/CMakeLists.txt: Add f16cintrin.h.

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

11 years agoX86: add F16C support in Clang
Manman Ren [Thu, 11 Oct 2012 00:59:55 +0000 (00:59 +0000)]
X86: add F16C support in Clang

Support the following intrinsics:
  _mm_cvtph_ps, _mm256_cvtph_ps, _mm_cvtps_ph, _mm256_cvtps_ph

rdar://12407875

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

11 years agoRemove the ASTDeserializationListener's MacroVisible() callback, which
Douglas Gregor [Thu, 11 Oct 2012 00:51:27 +0000 (00:51 +0000)]
Remove the ASTDeserializationListener's MacroVisible() callback, which
is no longer necessary, as well as the little bit of infrastructure in
the AST writer that used it.

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

11 years agoRemove an unused bit from the serialized IdentifierInfo
Douglas Gregor [Thu, 11 Oct 2012 00:48:48 +0000 (00:48 +0000)]
Remove an unused bit from the serialized IdentifierInfo

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

11 years agoDeserialize macro history when we deserialize an identifier that has
Douglas Gregor [Thu, 11 Oct 2012 00:46:49 +0000 (00:46 +0000)]
Deserialize macro history when we deserialize an identifier that has
macro history.

When deserializing macro history, we arrange history such that the
macros that have definitions (that haven't been #undef'd) and are
visible come at the beginning of the list, which is what the
preprocessor and other clients of Preprocessor::getMacroInfo()
expect. If additional macro definitions become visible later, they'll
be moved toward the front of the list. Note that it's possible to have
ambiguities, but we don't diagnose them yet.

There is a partially-implemented design decision here that, if a
particular identifier has been defined or #undef'd within the
translation unit, that definition (or #undef) hides any macro
definitions that come from imported modules. There's still a little
work to do to ensure that the right #undef'ing happens.

Additionally, we'll need to scope the update records for #undefs, so
they only kick in when the submodule containing that update record
becomes visible.

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

11 years agoTeach set-xcode-analyzer that the new default value for ExecPath is CLANG_ANALYZER_EXEC.
Ted Kremenek [Thu, 11 Oct 2012 00:40:41 +0000 (00:40 +0000)]
Teach set-xcode-analyzer that the new default value for ExecPath is CLANG_ANALYZER_EXEC.

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

11 years agoMinor cleanup for r165678; no functional change.
Eli Friedman [Thu, 11 Oct 2012 00:34:15 +0000 (00:34 +0000)]
Minor cleanup for r165678; no functional change.

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

11 years agoMake sure we perform the variadic method check correctly for calls to a member operat...
Eli Friedman [Thu, 11 Oct 2012 00:30:58 +0000 (00:30 +0000)]
Make sure we perform the variadic method check correctly for calls to a member operator().  PR14057.

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

11 years agoReapply "[analyzer] Treat fields of unions as having symbolic offsets."
Jordan Rose [Wed, 10 Oct 2012 23:23:21 +0000 (23:23 +0000)]
Reapply "[analyzer] Treat fields of unions as having symbolic offsets."

This time, actually uncomment the code that's supposed to fix the problem.

This reverts r165671 / 8ceb837585ed973dc36fba8dfc57ef60fc8f2735.

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

11 years agoFix a crash-on-invalid when parsing a reference to an invalid auto declaration
David Blaikie [Wed, 10 Oct 2012 23:15:05 +0000 (23:15 +0000)]
Fix a crash-on-invalid when parsing a reference to an invalid auto declaration

  auto x((unknown));
  int& y = x;

would crash because we were not flagging 'x' as an invalid declaration here.

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

11 years agoobjective-C IRgen: When sending a method to 'super'
Fariborz Jahanian [Wed, 10 Oct 2012 23:11:18 +0000 (23:11 +0000)]
objective-C IRgen: When sending a method to 'super'
in a category class method, don't read 'isa' pointer. Instead,
save the desired OBJC_METACLASS_$_ClassName in
__DATA,__objc_superrefs and read that without reading any
isa pointers. // rdar://12459358

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

11 years agoTemporarily Revert "[analyzer] Treat fields of unions as having symbolic offsets."
Eric Christopher [Wed, 10 Oct 2012 22:49:05 +0000 (22:49 +0000)]
Temporarily Revert "[analyzer] Treat fields of unions as having symbolic offsets."

Author: Jordan Rose <jordan_rose@apple.com>
Date:   Wed Oct 10 21:31:21 2012 +0000

    [analyzer] Treat fields of unions as having symbolic offsets.

    This allows only one field to be active at a time in RegionStore.
    This isn't quite the correct behavior for unions, but it at least
    would handle the case of "value goes in, value comes out" from the
    same field.

    RegionStore currently has a number of places where any access to a union
    results in UnknownVal being returned. However, it is clearly missing
    some cases, or the original issue wouldn't have occurred. It is probably
    now safe to remove those changes, but that's a potentially destabilizing
    change that should wait for more thorough testing.

    Fixes PR14054.

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

This reverts commit cf9030e480f77ab349672f00ad302e216c26c92c.

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

11 years agoRevert "[Options] make Option a value type."
Eric Christopher [Wed, 10 Oct 2012 22:34:46 +0000 (22:34 +0000)]
Revert "[Options] make Option a value type."

Author: Michael J. Spencer <bigcheesegs@gmail.com>
Date:   Wed Oct 10 21:48:26 2012 +0000

    [Options] make Option a value type.

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

This reverts commit 0464fd5e4ce2193e786e5adcab6b828f9366dae3.

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

11 years ago[Options] make Option a value type.
Michael J. Spencer [Wed, 10 Oct 2012 21:48:26 +0000 (21:48 +0000)]
[Options] make Option a value type.

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

11 years ago[analyzer] Treat fields of unions as having symbolic offsets.
Jordan Rose [Wed, 10 Oct 2012 21:31:21 +0000 (21:31 +0000)]
[analyzer] Treat fields of unions as having symbolic offsets.

This allows only one field to be active at a time in RegionStore.
This isn't quite the correct behavior for unions, but it at least
would handle the case of "value goes in, value comes out" from the
same field.

RegionStore currently has a number of places where any access to a union
results in UnknownVal being returned. However, it is clearly missing
some cases, or the original issue wouldn't have occurred. It is probably
now safe to remove those changes, but that's a potentially destabilizing
change that should wait for more thorough testing.

Fixes PR14054.

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

11 years agoMake -Wshift-op-parentheses a subgroup of -Wparentheses
David Blaikie [Wed, 10 Oct 2012 20:30:36 +0000 (20:30 +0000)]
Make -Wshift-op-parentheses a subgroup of -Wparentheses

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

11 years agotblgen: Build clang-tblgen without RTTI.
Sean Silva [Wed, 10 Oct 2012 20:25:45 +0000 (20:25 +0000)]
tblgen: Build clang-tblgen without RTTI.

clang-tblgen no longer needs RTTI!

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

11 years agotblgen: Use LLVM-style RTTI in clang-tblgen
Sean Silva [Wed, 10 Oct 2012 20:25:43 +0000 (20:25 +0000)]
tblgen: Use LLVM-style RTTI in clang-tblgen

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

11 years ago[Doc parsing] This patch searches overridden objc/c++
Fariborz Jahanian [Wed, 10 Oct 2012 18:34:52 +0000 (18:34 +0000)]
[Doc parsing] This patch searches overridden objc/c++
methods looking for documentation on a particular base
class inherited by any method that overrides the base class.
In case of redeclaration, as when objc method is defined
in the implementation, it also looks up for documentation
in class/class extension being redeclared.

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

11 years ago[analyzer] Don't run non-path-sensitive checks on system headers...
Jordan Rose [Wed, 10 Oct 2012 17:55:40 +0000 (17:55 +0000)]
[analyzer] Don't run non-path-sensitive checks on system headers...

...but do run them on user headers.

Previously, we were inconsistent here: non-path-sensitive checks on code
/bodies/ were only run in the main source file, but checks on
/declarations/ were run in /all/ headers. Neither of those is the
behavior we want.

Thanks to Sujit for pointing this out!

<rdar://problem/12454226>

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

11 years ago[analyzer] Fix typo: s/HandleDeclsGallGraph/HandleDeclsCallGraph/g
Jordan Rose [Wed, 10 Oct 2012 17:55:37 +0000 (17:55 +0000)]
[analyzer] Fix typo: s/HandleDeclsGallGraph/HandleDeclsCallGraph/g

No functionality change.

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

11 years ago-Warc-repeated-use-of-weak: look through explicit casts on assigned values.
Jordan Rose [Wed, 10 Oct 2012 16:43:06 +0000 (16:43 +0000)]
-Warc-repeated-use-of-weak: look through explicit casts on assigned values.

Reading from a weak property, casting the result, and assigning to a
strong pointer should still be considered safe.

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

11 years agoMove Sema::PropertyIfSetterOrGetter to ObjCMethodDecl::findPropertyDecl.
Jordan Rose [Wed, 10 Oct 2012 16:42:54 +0000 (16:42 +0000)]
Move Sema::PropertyIfSetterOrGetter to ObjCMethodDecl::findPropertyDecl.

Then, switch users of PropertyIfSetterOrGetter and LookupPropertyDecl
(the latter by name) over to findPropertyDecl. This actually makes
-Wreceiver-is-weak a bit stronger than it was before.

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

11 years agoChange Sema::PropertyIfSetterOrGetter to make use of isPropertyAccessor.
Jordan Rose [Wed, 10 Oct 2012 16:42:38 +0000 (16:42 +0000)]
Change Sema::PropertyIfSetterOrGetter to make use of isPropertyAccessor.

Old algorithm:
1. See if the name looks like a getter or setter.
2. Use the name to look up a property in the current ObjCContainer
   and all its protocols.
3. If the current container is an interface, also look in all categories
   and superclasses (and superclass categories, and so on).

New algorithm:
1. See if the method is marked as a property accessor. If so, look through
   all properties in the current container and find one that has a matching
   selector.
2. Find all overrides of the method using ObjCMethodDecl's
   getOverriddenMethods. This collects methods in superclasses and protocols
   (as well as superclass categories, which isn't really necessary), and
   checks if THEY are accessors. This part is not done recursively, since
   getOverriddenMethods is already recursive.

This lets us handle getters and setters that do not match the property
names.

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

11 years agoRename ObjCMethodDecl::isSynthesized to isPropertyAccessor.
Jordan Rose [Wed, 10 Oct 2012 16:42:25 +0000 (16:42 +0000)]
Rename ObjCMethodDecl::isSynthesized to isPropertyAccessor.

This more accurately reflects its use: this flag is set when a method
matches the getter or setter name for a property in the same class,
and does not actually specify whether or not the definition of the method
will be synthesized (either implicitly or explicitly with @synthesize).

This renames the setter and backing field as well, and changes the
(soon-to-be-obsolete?) XML dump format to use 'property_accessor'
instead of 'synthesized'.

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

11 years agoFix stack overflow when trying to create an implicit moving
Argyrios Kyrtzidis [Wed, 10 Oct 2012 16:14:06 +0000 (16:14 +0000)]
Fix stack overflow when trying to create an implicit moving
constructor with invalid code.

rdar://12240916

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

11 years ago[CMake] clang/tools/extra may be included by LLVM_EXTERNAL_CLANG_TOOLS_EXTRA_SOURCE_DIR.
NAKAMURA Takumi [Wed, 10 Oct 2012 13:46:18 +0000 (13:46 +0000)]
[CMake] clang/tools/extra may be included by LLVM_EXTERNAL_CLANG_TOOLS_EXTRA_SOURCE_DIR.

LLVM_EXTERNAL_CLANG_TOOLS_EXTRA_SOURCE_DIR=/path/to/llvm-srcroot/tools/clang/tools/extra, by default.

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

11 years agoApply the same fundamental fix for PR14048 as was applied for PR11905.
Chandler Carruth [Wed, 10 Oct 2012 11:29:08 +0000 (11:29 +0000)]
Apply the same fundamental fix for PR14048 as was applied for PR11905.

The issue arises when coercing to/from types of different sizes. We need
to be certain that the allocation on either end has sufficient room for
the coerced type. When it doesn't, we need to make room, copy across,
and then proceed. PR11905 handled the case of storing function arguments
back into allocas in the function prolog, this patch handles the case of
setting up the function arguments in a call expression.

This is actually significantly simpler than the fix for PR11905. It ends
up being a trivial change to create a temporary alloca when the source
is too small and memcpy across. This should preserve the compile-time
fast-isel benefits of doing gep+load sequences and avoiding FCAs.

Reviewed by Benjamin and Evgeniy (who fixed PR11905).

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

11 years agoRemove the final bits of Attributes being declared in the Attribute
Bill Wendling [Wed, 10 Oct 2012 07:36:56 +0000 (07:36 +0000)]
Remove the final bits of Attributes being declared in the Attribute
namespace. Use the attribute's enum value instead. No functionality change
intended.

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

11 years agoFix PR 11709: Change the definition of va_list to meet AAPCS requirement
Logan Chien [Wed, 10 Oct 2012 06:56:20 +0000 (06:56 +0000)]
Fix PR 11709: Change the definition of va_list to meet AAPCS requirement

AAPCS ABI Section 7.1.4 [1] specifies that va_list
should be defined as struct __va_list { void *__ap;};
And in C++, it is defined in namespace std.

[1] http://infocenter.arm.com/help/topic
         /com.arm.doc.ihi0042d/IHI0042D_aapcs.pdf

Patch by Weiming Zhao.

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

11 years agoPlace temporary LTO files into their own subdirectory.
Bill Wendling [Wed, 10 Oct 2012 05:30:49 +0000 (05:30 +0000)]
Place temporary LTO files into their own subdirectory.

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

11 years agoHave 'addFnAttr' take the attribute enum value. Then have it build the attribute...
Bill Wendling [Wed, 10 Oct 2012 03:13:20 +0000 (03:13 +0000)]
Have 'addFnAttr' take the attribute enum value. Then have it build the attribute object and add it appropriately. No functionality change.

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

11 years agoDisable the preprocessing record when indexing a source file
Argyrios Kyrtzidis [Wed, 10 Oct 2012 02:12:50 +0000 (02:12 +0000)]
Disable the preprocessing record when indexing a source file
and modules are not enabled.

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

11 years agoWhen indexing a module file, for the ppIncludedFile callback give
Argyrios Kyrtzidis [Wed, 10 Oct 2012 02:12:47 +0000 (02:12 +0000)]
When indexing a module file, for the ppIncludedFile callback give
an invalid location if the location points to the synthetic buffer
for the module input.

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

11 years ago[modules] Consistently construct a buffer as input to build the module.
Argyrios Kyrtzidis [Wed, 10 Oct 2012 02:12:39 +0000 (02:12 +0000)]
[modules] Consistently construct a buffer as input to build the module.
This means the main file for modules will always be a virtual one.

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

11 years agoTidy up formatting.
Richard Smith [Wed, 10 Oct 2012 01:12:11 +0000 (01:12 +0000)]
Tidy up formatting.

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

11 years ago-fcatch-undefined-behavior: catch a VLA bound which evalutes to a non-positive value.
Richard Smith [Wed, 10 Oct 2012 01:11:12 +0000 (01:11 +0000)]
-fcatch-undefined-behavior: catch a VLA bound which evalutes to a non-positive value.

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

11 years agoFix test broken by r165572.
Richard Smith [Wed, 10 Oct 2012 01:02:07 +0000 (01:02 +0000)]
Fix test broken by r165572.

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

11 years agoRevert "Use a special path to place the .o files in."
Bob Wilson [Tue, 9 Oct 2012 23:57:08 +0000 (23:57 +0000)]
Revert "Use a special path to place the .o files in."

This reverts commit 165429 in an attempt to get our buildbots going.

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

11 years ago-fcatch-undefined-behavior: store the type name directly at the end of a type descrip...
Richard Smith [Tue, 9 Oct 2012 23:55:19 +0000 (23:55 +0000)]
-fcatch-undefined-behavior: store the type name directly at the end of a type descriptor. 5% binary size reduction due to fewer relocations.

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

11 years agoAdd extra vim swap file pattern
Michael Liao [Tue, 9 Oct 2012 23:48:58 +0000 (23:48 +0000)]
Add extra vim swap file pattern

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

11 years agoRework the (de-)serialization of macros, as stored in
Douglas Gregor [Tue, 9 Oct 2012 23:05:51 +0000 (23:05 +0000)]
Rework the (de-)serialization of macros, as stored in
MacroInfo*. Instead of simply dumping an offset into the current file,
give each macro definition a proper ID with all of the standard
modules-remapping facilities. Additionally, when a macro is modified
in a subsequent AST file (e.g., #undef'ing a macro loaded from another
module or from a precompiled header), provide a macro update record
rather than rewriting the entire macro definition. This gives us
greater consistency with the way we handle declarations, and ties
together macro definitions much more cleanly.

Note that we're still not actually deserializing macro history (we
never were), but it's far easy to do properly now.

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

11 years agoPeople put pragmas in crazy places; add more handling. PR14046.
Eli Friedman [Tue, 9 Oct 2012 22:46:54 +0000 (22:46 +0000)]
People put pragmas in crazy places; add more handling.  PR14046.

I think our general framework for parser pragmas needs a bit more work,
but I'm not planning on working on it at the moment.

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

11 years agoInitialize the end loc in ObjCInterfaceTypeLoc.
Benjamin Kramer [Tue, 9 Oct 2012 20:49:29 +0000 (20:49 +0000)]
Initialize the end loc in ObjCInterfaceTypeLoc.

Found by valgrind.

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

11 years agoThe clang driver has a fairly fancy support for executing gcc instead of
Rafael Espindola [Tue, 9 Oct 2012 20:46:28 +0000 (20:46 +0000)]
The clang driver has a fairly fancy support for executing gcc instead of
clang itself. This dates back to clang's early days and while it looks like
some of it is still used (for kext for example), other parts are probably dead.

Remove the -ccc-clang-archs option and associated code. I don't think there
is any remaining setup where clang doesn't support an architecture but it can
expect an working gcc cross compiler to be available.

A nice side effect is that tests no longer need to differentiate architectures
that are included in production builds of clang and those that are not.

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

11 years agoSimplify the code using SmallVector::append(), as suggested by Benjamin Kramer.
Argyrios Kyrtzidis [Tue, 9 Oct 2012 20:08:43 +0000 (20:08 +0000)]
Simplify the code using SmallVector::append(), as suggested by Benjamin Kramer.

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

11 years ago[driver] Remove redundant cases due to overlapping commits between Ted (r165531,...
Chad Rosier [Tue, 9 Oct 2012 20:01:58 +0000 (20:01 +0000)]
[driver] Remove redundant cases due to overlapping commits between Ted (r165531, 165532) and I
(r165534), but leave the test case in place.

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

11 years ago-fcatch-undefined-behavior: emit calls to the runtime library whenever one of the...
Richard Smith [Tue, 9 Oct 2012 19:52:38 +0000 (19:52 +0000)]
-fcatch-undefined-behavior: emit calls to the runtime library whenever one of the checks fails.

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

11 years ago[driver] Remove the -W[no-][int-conversion|constant-conversion|enum-conversion]
Chad Rosier [Tue, 9 Oct 2012 19:43:33 +0000 (19:43 +0000)]
[driver] Remove the -W[no-][int-conversion|constant-conversion|enum-conversion]
options when clang invokes cc1plus for i386 kexts.
rdar://12459188

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

11 years agoDon't forward -Wenum-conversion to cc1plus.
Ted Kremenek [Tue, 9 Oct 2012 19:29:48 +0000 (19:29 +0000)]
Don't forward -Wenum-conversion to cc1plus.

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

11 years agoDon't forward -Wint-conversion to cc1plus.
Ted Kremenek [Tue, 9 Oct 2012 19:29:46 +0000 (19:29 +0000)]
Don't forward -Wint-conversion to cc1plus.

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

11 years agoCreate variable for warning group -Wshorten-64-to-32.
Ted Kremenek [Tue, 9 Oct 2012 18:46:14 +0000 (18:46 +0000)]
Create variable for warning group -Wshorten-64-to-32.

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

11 years agoMove the functionality that looks for ObjC overridden methods from
Argyrios Kyrtzidis [Tue, 9 Oct 2012 18:19:01 +0000 (18:19 +0000)]
Move the functionality that looks for ObjC overridden methods from
ASTContext to the ObjCMethodDecl, and have the more generic
ASTContext::getOverriddenMethods() use the ObjCMethodDecl::getOverriddenMethods()
function.

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

11 years agoMake the order of visitation of the pending bodies in the AST reader
Douglas Gregor [Tue, 9 Oct 2012 17:50:23 +0000 (17:50 +0000)]
Make the order of visitation of the pending bodies in the AST reader
deterministic.

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

11 years agoWhen we load a function or method body from an AST file, we check
Douglas Gregor [Tue, 9 Oct 2012 17:21:28 +0000 (17:21 +0000)]
When we load a function or method body from an AST file, we check
whether that function/method already has a body (loaded from some
other AST file), as introduced in r165137. Delay this check until
after the redeclaration chains have been wired up.

While I'm here, make the loading of method bodies lazy.

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

11 years agoFixup for r165097: build 32-bit ASan compiler-rt library on 64-bit Linux only if...
Alexey Samsonov [Tue, 9 Oct 2012 16:03:52 +0000 (16:03 +0000)]
Fixup for r165097: build 32-bit ASan compiler-rt library on 64-bit Linux only if just-built clang can build simple 32-bit executables

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

11 years agoIf a macro has been #undef'd in a precompiled header, we still need to
Douglas Gregor [Tue, 9 Oct 2012 16:01:50 +0000 (16:01 +0000)]
If a macro has been #undef'd in a precompiled header, we still need to
write out the macro history for that macro. Similarly, we need to cope
with reading a macro definition that has been #undef'd.

Take advantage of this new ability so that global code-completion
results can refer to #undef'd macros, rather than losing them
entirely. For multiply defined/#undef'd macros, we will still get the
wrong result, but it's better than getting no result.

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

11 years agoClearing a SmallPtrSet is still expensive, split it out from OverloadCandidateSet...
Benjamin Kramer [Tue, 9 Oct 2012 15:52:25 +0000 (15:52 +0000)]
Clearing a SmallPtrSet is still expensive, split it out from OverloadCandidateSet::clear and don't do it on destruction.

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

11 years agoWe use the enums to query whether an Attributes object has that attribute. The
Bill Wendling [Tue, 9 Oct 2012 07:45:26 +0000 (07:45 +0000)]
We use the enums to query whether an Attributes object has that attribute. The
opaque layer is responsible for knowing where that specific attribute is stored.

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

11 years agoCXXMethodDecl::isConst() and CXXMethodDecl::isVolatile() can be const methods
Arnaud A. de Grandmaison [Tue, 9 Oct 2012 07:09:56 +0000 (07:09 +0000)]
CXXMethodDecl::isConst() and CXXMethodDecl::isVolatile() can be const methods

Patch by: Laszlo Nagy

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

11 years agoMove the logic that searches for overridden methods from libclang to
Argyrios Kyrtzidis [Tue, 9 Oct 2012 01:23:50 +0000 (01:23 +0000)]
Move the logic that searches for overridden methods from libclang to
ASTContext so that it can be widely available.

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

11 years agoWhen storing the C++ overridden methods, store them once for the
Argyrios Kyrtzidis [Tue, 9 Oct 2012 01:23:45 +0000 (01:23 +0000)]
When storing the C++ overridden methods, store them once for the
canonical method; avoid storing them again for an out-of-line definition.

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

11 years agoMake sure we allow "#pragma options align=mac68k" in function-local contexts. <rdar...
Eli Friedman [Mon, 8 Oct 2012 23:52:38 +0000 (23:52 +0000)]
Make sure we allow "#pragma options align=mac68k" in function-local contexts.  <rdar://problem/12453134>

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

11 years agoAdd regression test to check if -Wenum-conversion is a subgroup of -Wconversion.
Ted Kremenek [Mon, 8 Oct 2012 23:45:09 +0000 (23:45 +0000)]
Add regression test to check if -Wenum-conversion is a subgroup of -Wconversion.

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

11 years agoIn VarDecl::getSourceRange() make sure to check that the source location
Argyrios Kyrtzidis [Mon, 8 Oct 2012 23:08:41 +0000 (23:08 +0000)]
In VarDecl::getSourceRange() make sure to check that the source location
of the initializer is valid before using it.

Fixes rdar://12455002&12449015 where local variables of objc objects in ARC mode
were not annotated because of the ImplicitValueInitExpr initializer having invalid
source range, resulting in the SourceRange of the VarDecl having invalid end location.

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

11 years agoActually add the -Wenum-conversion group to -Wconversion as r165361
Chandler Carruth [Mon, 8 Oct 2012 22:45:55 +0000 (22:45 +0000)]
Actually add the -Wenum-conversion group to -Wconversion as r165361
seems to have intended.

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

11 years agoSort the subgroups of the diagnostic group for -Wconversion. No
Chandler Carruth [Mon, 8 Oct 2012 22:45:54 +0000 (22:45 +0000)]
Sort the subgroups of the diagnostic group for -Wconversion. No
functionality changed.

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

11 years agoMake Bitrig's clang understand -stdlib= correctly.
Chandler Carruth [Mon, 8 Oct 2012 21:31:38 +0000 (21:31 +0000)]
Make Bitrig's clang understand -stdlib= correctly.
With this patch Bitrig can use a different c++ library without pain and
within the normal commandline parameters.

Original patch by David Hill, with lots of fixes and cleanup by me.

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

11 years agoUse a special path to place the .o files in.
Bill Wendling [Mon, 8 Oct 2012 21:17:59 +0000 (21:17 +0000)]
Use a special path to place the .o files in.

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

11 years agoCompilationDatabaseTest: Fix another Windows path issue.
Daniel Jasper [Mon, 8 Oct 2012 20:32:51 +0000 (20:32 +0000)]
CompilationDatabaseTest: Fix another Windows path issue.

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

11 years agoCompilationDatabase: Use //net paths for tests, as they should be
Daniel Jasper [Mon, 8 Oct 2012 20:08:25 +0000 (20:08 +0000)]
CompilationDatabase: Use //net paths for tests, as they should be
considered absolute on all platforms.

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

11 years agoDon't emit double parentheses in __clang_version__.
Benjamin Kramer [Mon, 8 Oct 2012 18:49:39 +0000 (18:49 +0000)]
Don't emit double parentheses in __clang_version__.

PR14040.

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

11 years agoHopefully appease Windows buildbot with Japanese (?) error message.
Daniel Jasper [Mon, 8 Oct 2012 18:37:21 +0000 (18:37 +0000)]
Hopefully appease Windows buildbot with Japanese (?) error message.

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

11 years agoFileNameMatchTrie: Use StringRef instead of Twines where possible.
Daniel Jasper [Mon, 8 Oct 2012 18:31:54 +0000 (18:31 +0000)]
FileNameMatchTrie: Use StringRef instead of Twines where possible.

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

11 years agoMove TargetData to DataLayout.
Micah Villmow [Mon, 8 Oct 2012 16:25:52 +0000 (16:25 +0000)]
Move TargetData to DataLayout.

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

11 years agoSupport symlinks and relative paths in complilation databases.
Daniel Jasper [Mon, 8 Oct 2012 16:08:15 +0000 (16:08 +0000)]
Support symlinks and relative paths in complilation databases.

Review: http://llvm-reviews.chandlerc.com/D30

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

11 years agoUse a single note diagnostic for all the precedent/parentheses warnings.
David Blaikie [Mon, 8 Oct 2012 01:19:49 +0000 (01:19 +0000)]
Use a single note diagnostic for all the precedent/parentheses warnings.

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

11 years agoStringRef-ify Binary/UnaryOperator::getOpcodeStr
David Blaikie [Mon, 8 Oct 2012 01:11:04 +0000 (01:11 +0000)]
StringRef-ify Binary/UnaryOperator::getOpcodeStr

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

11 years agoPython bindings: fix typo.
Benjamin Kramer [Sun, 7 Oct 2012 11:51:45 +0000 (11:51 +0000)]
Python bindings: fix typo.

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

11 years agoPython bindings: Add missing availability kind.
Benjamin Kramer [Sun, 7 Oct 2012 11:46:37 +0000 (11:46 +0000)]
Python bindings: Add missing availability kind.

Patch by Leo Liu, test case by me.

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

11 years agoUse getArch instead of getArchName + string compare.
Rafael Espindola [Sun, 7 Oct 2012 04:44:33 +0000 (04:44 +0000)]
Use getArch instead of getArchName + string compare.

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

11 years agoUse getArch instead of getArchName.
Rafael Espindola [Sun, 7 Oct 2012 03:23:40 +0000 (03:23 +0000)]
Use getArch instead of getArchName.

The darwin change should be a nop since Triple::getArchTypeForDarwinArchName
doesn't know about amd64.

If things like amd64-mingw32 are to be rejected, we should print a error
earlier on instead of silently using the wrong abi.

Remove old comment that looks out of place, this is "in clang".

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