]> granicus.if.org Git - clang/log
clang
11 years agoSwitch to APFloat constructor taking fltSemantics.
Tim Northover [Tue, 22 Jan 2013 09:46:51 +0000 (09:46 +0000)]
Switch to APFloat constructor taking fltSemantics.

This change also makes the serialisation store the required semantics,
fixing an issue where PPC128 was always assumed when re-reading a
128-bit value.

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

11 years ago[ASan] Fixed darwin-sanitizer-ld.c to match the flags after the switch to the dynamic...
Alexander Potapenko [Tue, 22 Jan 2013 09:27:00 +0000 (09:27 +0000)]
[ASan] Fixed darwin-sanitizer-ld.c to match the flags after the switch to the dynamic runtime.

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

11 years ago[ASan] Link with the dynamic runtime on OS X
Alexander Potapenko [Tue, 22 Jan 2013 09:16:03 +0000 (09:16 +0000)]
[ASan] Link with the dynamic runtime on OS X
This patch changes the behavior of the -fsanitize=address flag, making it use the dynamic runtime library (libclang_rt.asan_osx_dynamic.dylib) instead of the static one. It also drops the CoreFoundation dependency, since the dynamic runtime doesn't need it.

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

11 years agolibclang: Update comment about USEDLIBS in c-*-test/Makefile.
NAKAMURA Takumi [Tue, 22 Jan 2013 04:11:33 +0000 (04:11 +0000)]
libclang: Update comment about USEDLIBS in c-*-test/Makefile.

"Note that 'USEDLIBS' must include all of the core clang libraries when -static is given to linker on cygming."

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

11 years agoUse the correct field to copy/dispose a __block variable.
John McCall [Tue, 22 Jan 2013 03:56:22 +0000 (03:56 +0000)]
Use the correct field to copy/dispose a __block variable.

We were previously hard-coding a particular field index.  This was
fine before (because we were obviously guaranteed the presence
of a copy/dispose member) except for (1) alignment padding and
(2) future extensions adding extra members to the header, such
as the extended-layout pointer.

Note that we only introduce the extended-layout pointer in the
presence of structs.  (We also seem to be introducing it even
in the presence of an all-non-object layout, but that's a
different potential issue.)

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

11 years agoclang/test/Index/comment-to-html-xml-conversion.cpp: Mark this as XFAIL:valgrind...
NAKAMURA Takumi [Tue, 22 Jan 2013 03:49:16 +0000 (03:49 +0000)]
clang/test/Index/comment-to-html-xml-conversion.cpp: Mark this as XFAIL:valgrind, for now. Working in progress.

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

11 years agoclang/test: [CMake] check-clang doesn't require llvm-dis any more.
NAKAMURA Takumi [Tue, 22 Jan 2013 01:52:04 +0000 (01:52 +0000)]
clang/test: [CMake] check-clang doesn't require llvm-dis any more.

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

11 years agoclang/test/CodeGen: Nuke llvm's opt and llvm-dis, and FileCheck-ize two tests. -O1...
NAKAMURA Takumi [Tue, 22 Jan 2013 01:51:59 +0000 (01:51 +0000)]
clang/test/CodeGen: Nuke llvm's opt and llvm-dis, and FileCheck-ize two tests. -O1 is sufficient here.

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

11 years agoclang/test/CodeGen/2006-01-13-StackSave.c: Nuke llvm's opt and llvm-dis, and FileChec...
NAKAMURA Takumi [Tue, 22 Jan 2013 01:51:54 +0000 (01:51 +0000)]
clang/test/CodeGen/2006-01-13-StackSave.c: Nuke llvm's opt and llvm-dis, and FileCheck-ize.

@llvm.stacksave is emitted regardless of "opt -std-compile-opts". We have optimizers' tests in llvm/test/Transforms.

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

11 years agoclang/test/CodeGen/blocks-seq.c: FileCheck-ize.
NAKAMURA Takumi [Tue, 22 Jan 2013 01:51:48 +0000 (01:51 +0000)]
clang/test/CodeGen/blocks-seq.c: FileCheck-ize.

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

11 years agoRemove "incorrect" aligning of trailing comments.
Daniel Jasper [Mon, 21 Jan 2013 22:49:20 +0000 (22:49 +0000)]
Remove "incorrect" aligning of trailing comments.

We used to align trailing comments belong to different things.
Before:
void f() { // some function..
}
int a;     // some variable..

After:
void f() { // some function..
}
int a; // some variable..

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

11 years agoHave AttributeSet::getRetAttributes() return an AttributeSet instead of Attribute.
Bill Wendling [Mon, 21 Jan 2013 22:45:00 +0000 (22:45 +0000)]
Have AttributeSet::getRetAttributes() return an AttributeSet instead of Attribute.

This further restricts the use of the Attribute class to the Attribute family of
classes.

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

11 years agoobjectiveC: don't warn when in -Wselector mode and
Fariborz Jahanian [Mon, 21 Jan 2013 22:32:29 +0000 (22:32 +0000)]
objectiveC: don't warn when in -Wselector mode and
an unimplemented selector is consumed by
"respondsToSelector:". // rdar://12938616

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

11 years agoMake AttributeSet::getFnAttributes() return an AttributeSet instead of an Attribute.
Bill Wendling [Mon, 21 Jan 2013 21:57:40 +0000 (21:57 +0000)]
Make AttributeSet::getFnAttributes() return an AttributeSet instead of an Attribute.

This is more code to isolate the use of the Attribute class to that of just
holding one attribute instead of a collection of attributes.

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

11 years agoGive ModuleFiles an index, so that we can use indexed vectors rather
Douglas Gregor [Mon, 21 Jan 2013 20:07:12 +0000 (20:07 +0000)]
Give ModuleFiles an index, so that we can use indexed vectors rather
than DenseMaps and SmallPtrSets for module-visitation data. ~2.6%
speedup for modules.

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

11 years agoEliminate Sema::CompareProperties(), which was walking over a pile of
Douglas Gregor [Mon, 21 Jan 2013 19:42:21 +0000 (19:42 +0000)]
Eliminate Sema::CompareProperties(), which was walking over a pile of
lexical declarations looking for properties when we could more
efficiently check for property mismatches at property declaration
time. Good for ~1% of -fsyntax-only time when most of the properties
we're checking against come from an AST file.

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

11 years agoFormatter: Set MatchingParen for [], to match <>, (), {}. No functionality change.
Nico Weber [Mon, 21 Jan 2013 19:35:06 +0000 (19:35 +0000)]
Formatter: Set MatchingParen for [], to match <>, (), {}. No functionality change.

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

11 years agoFormatter: Rename LSquare to Left to make parseSquare() more consistent with the...
Nico Weber [Mon, 21 Jan 2013 19:29:31 +0000 (19:29 +0000)]
Formatter: Rename LSquare to Left to make parseSquare() more consistent with the other paren parsing methods.

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

11 years agoFixes various problems around enum parsing.
Manuel Klimek [Mon, 21 Jan 2013 19:17:52 +0000 (19:17 +0000)]
Fixes various problems around enum parsing.

Very similar to what we do for record definitions:
- tighten down what is an enum definition, so that we don't mistake a
  function for an enum
- allow common idioms around declarations (we'll want to handle that
  more centrally in the future)

We now correctly format:
enum X f() {
  a();
  return 42;
}

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

11 years agoEliminate the oddly-named Sema::ComparePropertiesInBaseAndSuper, which
Douglas Gregor [Mon, 21 Jan 2013 19:05:22 +0000 (19:05 +0000)]
Eliminate the oddly-named Sema::ComparePropertiesInBaseAndSuper, which
did a redundant traversal of the lexical declarations in the
superclass. Instead, when we declare a new property, look into the
superclass to see whether we're redeclaring the property. Goot for 1%
of -fsyntax-only time on Cocoa.h and a little less than 3% on my
modules test case.

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

11 years ago[ASTUnit] Unlike LoadFromCommandLine, LoadFromCompilerInvocation causes a crash if...
Argyrios Kyrtzidis [Mon, 21 Jan 2013 18:45:42 +0000 (18:45 +0000)]
[ASTUnit] Unlike LoadFromCommandLine, LoadFromCompilerInvocation causes a crash if Precompilepreamble
is set to true because there is no FileManager at that point.

Patch by Hurcan Solter!

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

11 years ago[analyzer] Fix test for r173067.
Jordan Rose [Mon, 21 Jan 2013 18:41:05 +0000 (18:41 +0000)]
[analyzer] Fix test for r173067.

Note to self: don't remove comments /after/ updating the line-sensitive
part of a test.

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

11 years agoReplace some unnecessary O(N^2) lookups for properties with
Douglas Gregor [Mon, 21 Jan 2013 18:35:55 +0000 (18:35 +0000)]
Replace some unnecessary O(N^2) lookups for properties with
DeclContext lookups. The performance win is negligible in my tests,
but it's the Right Thing To Do (TM).

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

11 years ago[analyzer] Show notes inside implicit calls at the last explicit call site.
Jordan Rose [Mon, 21 Jan 2013 18:28:30 +0000 (18:28 +0000)]
[analyzer] Show notes inside implicit calls at the last explicit call site.

Before:
  struct Wrapper { <-- 2. Calling default constructor for 'NonTrivial'.
    NonTrivial m;
  };

  Wrapper w; <-- 1. Calling implicit default constructor for 'Wrapper'.

After:
  struct Wrapper {
    NonTrivial m;
  };

  Wrapper w; <-- 1. Calling implicit default constructor for 'Wrapper'.
             ^-- 2. Calling default constructor for 'NonTrivial'.

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

11 years agoReadSourceManagerBlock is skipping over records that can contain Blobs. Not passing
Chris Lattner [Mon, 21 Jan 2013 18:28:26 +0000 (18:28 +0000)]
ReadSourceManagerBlock is skipping over records that can contain Blobs.  Not passing
in a StringRef to bind to them forces them to be unpacked into the Record as individual
bytes.  This is wasteful, but not likely to be measurable in this instance.

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

11 years agoRevert r173056; it breaks one of the CodeGen-with-PCH tests.
Douglas Gregor [Mon, 21 Jan 2013 16:52:34 +0000 (16:52 +0000)]
Revert r173056; it breaks one of the CodeGen-with-PCH tests.

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

11 years agoWhen loading an identifier from an AST file solely for the purpose of
Douglas Gregor [Mon, 21 Jan 2013 16:47:11 +0000 (16:47 +0000)]
When loading an identifier from an AST file solely for the purpose of
forming the identifier, e.g., as part of a selector or a declaration
name, don't actually deserialize any information about the
identifier. Instead, simply mark it "out-of-date" and we'll load the
the information on demand. 2% speedup on the modules testcase I'm
looking at; should also help PCH.

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

11 years agoFixes formatting of empty blocks.
Manuel Klimek [Mon, 21 Jan 2013 16:42:44 +0000 (16:42 +0000)]
Fixes formatting of empty blocks.

We now only put empty blocks into a single line, if all of:
- all tokens of the structural element fit into a single line
- we're not in a control flow statement

Note that we usually don't put record definitions into a single line, as
there's usually at least one more token (the semicolon) after the
closing brace. This doesn't hold when we are in a context where there is
no semicolon, like "enum E {}".

There were some missing tests around joining lines around the corner
cases of the allowed number of columns, so this patch adds some.

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

11 years agoWhen deserializing a declaration, don't look for redeclarations if its
Douglas Gregor [Mon, 21 Jan 2013 16:16:40 +0000 (16:16 +0000)]
When deserializing a declaration, don't look for redeclarations if its
kind indicates that it can never be redeclared. Good for a 1% speedup,
and redeclaration searching drops off the profile.

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

11 years agoIntroduce a fast path for the ASTReader's name lookup within a
Douglas Gregor [Mon, 21 Jan 2013 15:25:38 +0000 (15:25 +0000)]
Introduce a fast path for the ASTReader's name lookup within a
DeclContext. When the DeclContext is of a kind that can only be
defined once and never updated, we limit the search to the module file
that conatins the lookup table. Provides a 15% speedup in one
modules-heavy source file.

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

11 years agoFix parsing of templated declarations.
Daniel Jasper [Mon, 21 Jan 2013 14:39:22 +0000 (14:39 +0000)]
Fix parsing of templated declarations.

Before: template <template <typename T>, typename P > class X;
After:  template <template <typename T>, typename P> class X;

More importantly, the token annotations for the second ">" are now computed
correctly.

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

11 years agoFixes indent in linkage specification blocks.
Manuel Klimek [Mon, 21 Jan 2013 14:32:05 +0000 (14:32 +0000)]
Fixes indent in linkage specification blocks.

We now indent:
extern "C" {
int a;
}

without additional indent inside the extern "C" block.

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

11 years agoFix bug discovered by valgrind.
Daniel Jasper [Mon, 21 Jan 2013 14:18:28 +0000 (14:18 +0000)]
Fix bug discovered by valgrind.

When trying to merge lines, we should not touch lines that are invalid,
as we don't know how long they might be.

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

11 years agoAdd regression test.
Manuel Klimek [Mon, 21 Jan 2013 14:16:56 +0000 (14:16 +0000)]
Add regression test.

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

11 years agoAST/VTableBuilder.h: Suppress a warning. [-Wunused-private-field]
NAKAMURA Takumi [Mon, 21 Jan 2013 14:15:24 +0000 (14:15 +0000)]
AST/VTableBuilder.h: Suppress a warning. [-Wunused-private-field]

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

11 years agoFixes detection of class template specializations.
Manuel Klimek [Mon, 21 Jan 2013 13:58:54 +0000 (13:58 +0000)]
Fixes detection of class template specializations.

Now correctly formats:
template <> class A<int> {} a;

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

11 years agoFirst step towards vftable generation with -cxx-abi microsoft PR13231
Timur Iskhodzhanov [Mon, 21 Jan 2013 13:02:41 +0000 (13:02 +0000)]
First step towards vftable generation with -cxx-abi microsoft PR13231

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

11 years agoAdd a fixit for _Noreturn main,
Dmitri Gribenko [Mon, 21 Jan 2013 11:25:03 +0000 (11:25 +0000)]
Add a fixit for _Noreturn main,
add tests for fixits removing static and inline from main

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

11 years agoCGDebugInfo.cpp: Fix a warning. [-Wunused-variable]
NAKAMURA Takumi [Mon, 21 Jan 2013 10:51:28 +0000 (10:51 +0000)]
CGDebugInfo.cpp: Fix a warning. [-Wunused-variable]

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

11 years agoAllow for nested name specifiers in record declarations.
Manuel Klimek [Mon, 21 Jan 2013 10:17:14 +0000 (10:17 +0000)]
Allow for nested name specifiers in record declarations.

Now correctly formats:
class A::B {} n;

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

11 years agoFix parsing of return statements.
Manuel Klimek [Mon, 21 Jan 2013 10:07:49 +0000 (10:07 +0000)]
Fix parsing of return statements.

Previously, we would not detect brace initializer lists in return
statements, thus:
 return (a)(b) { 1, 2, 3 };
would put the semicolon onto the next line.

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

11 years agoPort r172856: 'Include ubsan runtime even when building a shared library. We don...
Alexey Samsonov [Mon, 21 Jan 2013 08:45:02 +0000 (08:45 +0000)]
Port r172856: 'Include ubsan runtime even when building a shared library. We don't require executable to be linked with UBSan.' to Mac

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

11 years agoPR14472: Preserve qualifiers while unwrapping types for debug info
David Blaikie [Mon, 21 Jan 2013 04:37:12 +0000 (04:37 +0000)]
PR14472: Preserve qualifiers while unwrapping types for debug info

Looks like r161368 fixed this for one case but not all. This change generalizes
the solution over all the unwrapping cases. Now that preserving the qualifiers
is done independent of the particular type being unwrapped I won't bother
adding test cases for each one but at least demonstrate that this change was
necessary & sufficient to fix the bug.

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

11 years agoPrune unused diagnostics.
Benjamin Kramer [Sun, 20 Jan 2013 19:29:01 +0000 (19:29 +0000)]
Prune unused diagnostics.

Courtesy of utils/find-unused-diagnostics.sh.

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

11 years agoclang/utils/valgrind/x86_64-pc-linux-gnu_gcc-4.3.3.supp: Add /usr/bin/cmp.
NAKAMURA Takumi [Sun, 20 Jan 2013 15:30:41 +0000 (15:30 +0000)]
clang/utils/valgrind/x86_64-pc-linux-gnu_gcc-4.3.3.supp: Add /usr/bin/cmp.

FIXME: It could be removed if;

  - check-all included llvm/valgrind/supp, too.
  - clang-vg didn't use "check-all".

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

11 years agoAdd bitreader to LINK_COMPONENTS in users of libclang, c-arcmt-test and c-index-test.
NAKAMURA Takumi [Sun, 20 Jan 2013 14:53:49 +0000 (14:53 +0000)]
Add bitreader to LINK_COMPONENTS in users of libclang, c-arcmt-test and c-index-test.

They don't link cygclang.dll, but libclang.a on cygwin.

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

11 years agoAdd top-level Clang flag -f(no-)sanitize-address-zero-base-shadow that makes AddressS...
Alexey Samsonov [Sun, 20 Jan 2013 13:12:12 +0000 (13:12 +0000)]
Add top-level Clang flag -f(no-)sanitize-address-zero-base-shadow that makes AddressSanitizer use bottom of the address space for the shadow memory. On Linux it can be used with -fPIE/-pie to improve performance.

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

11 years agoImplement OpenCL event_t as Clang builtin type, including event_t related OpenCL...
Guy Benyei [Sun, 20 Jan 2013 12:31:11 +0000 (12:31 +0000)]
Implement OpenCL event_t as Clang builtin type, including event_t related OpenCL restrictions (OpenCL 1.2 spec 6.9)

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

11 years agoupdate to use the new BitcodeCursor readRecord that takes a StringRef blob parameter,
Chris Lattner [Sun, 20 Jan 2013 02:38:54 +0000 (02:38 +0000)]
update to use the new BitcodeCursor readRecord that takes a StringRef blob parameter,
and adopt "advance" in more places.

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

11 years agoNuke SetUpBuildDumpLog.
Sean Silva [Sun, 20 Jan 2013 01:58:28 +0000 (01:58 +0000)]
Nuke SetUpBuildDumpLog.

Also, it was the only reason that `argc` and `argv` were being passed
into createDiagnostics, so remove those parameters and clean up callers.

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

11 years agoFix what appears to be a copy-paste error.
Sean Silva [Sun, 20 Jan 2013 01:58:26 +0000 (01:58 +0000)]
Fix what appears to be a copy-paste error.

This looks like it was copied from SetUpBuildDumpLog, which dumps to the
file `DiagOpts->DumpBuildInformation`. There is another member
`DiagOpts->DiagnosticLogFile` which appears to be unused. The fact that
this feature doesn't even print to the output file specified on the
command line makes me think that it should be ripped out.

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

11 years agoThe last of PR14471: Debug info support for inline in-class initializer for float...
David Blaikie [Sun, 20 Jan 2013 01:19:17 +0000 (01:19 +0000)]
The last of PR14471: Debug info support for inline in-class initializer for float static members

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

11 years agoFixed trailing whitespace.
Michael Gottesman [Sun, 20 Jan 2013 01:04:14 +0000 (01:04 +0000)]
Fixed trailing whitespace.

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

11 years agoadd back a #include needed on some builders.
Chris Lattner [Sun, 20 Jan 2013 00:57:52 +0000 (00:57 +0000)]
add back a #include needed on some builders.

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

11 years agofinish converting the normal cases in ASTReader to use the new BitstreamCursor APIs.
Chris Lattner [Sun, 20 Jan 2013 00:56:42 +0000 (00:56 +0000)]
finish converting the normal cases in ASTReader to use the new BitstreamCursor APIs.

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

11 years ago[cindex.py]: Use spaces instead of tabs
Tobias Grosser [Sun, 20 Jan 2013 00:42:16 +0000 (00:42 +0000)]
[cindex.py]: Use spaces instead of tabs

The tabs slipped in accidentally.

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

11 years agoconvert some more stuff over to use new cursor APIs.
Chris Lattner [Sun, 20 Jan 2013 00:00:22 +0000 (00:00 +0000)]
convert some more stuff over to use new cursor APIs.

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

11 years agoActually update the test, fixup for r172923
Dmitri Gribenko [Sat, 19 Jan 2013 22:11:28 +0000 (22:11 +0000)]
Actually update the test, fixup for r172923

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

11 years agoUse llvm::hexDigitValue in comment lexer
Dmitri Gribenko [Sat, 19 Jan 2013 22:06:05 +0000 (22:06 +0000)]
Use llvm::hexDigitValue in comment lexer

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

11 years agoComment parsing: add more tests for html character references
Dmitri Gribenko [Sat, 19 Jan 2013 22:04:44 +0000 (22:04 +0000)]
Comment parsing: add more tests for html character references

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

11 years agoswitch a bunch of ASTReader to use the new BitstreamCursor::advance* methods,
Chris Lattner [Sat, 19 Jan 2013 21:39:22 +0000 (21:39 +0000)]
switch a bunch of ASTReader to use the new BitstreamCursor::advance* methods,
which hide a bunch of private details of the cursor from clients and simplify
their code.  More to come.

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

11 years agorandom tidying
Chris Lattner [Sat, 19 Jan 2013 21:35:35 +0000 (21:35 +0000)]
random tidying

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

11 years ago[analyzer] Don't show "Entered 'foo'" if 'foo' is implicit.
Jordan Rose [Sat, 19 Jan 2013 19:52:57 +0000 (19:52 +0000)]
[analyzer] Don't show "Entered 'foo'" if 'foo' is implicit.

Before:
  Calling implicit default constructor for 'Foo'  (where Foo is constructed)
  Entered call from 'test'  (at "=default" or 'Foo' declaration)
  Calling default constructor for 'Bar'  (at "=default" or 'Foo' declaration)

After:
  Calling implicit default constructor for 'Foo'  (where Foo is constructed)
  Calling default constructor for 'Bar'  (at "=default" or 'Foo' declaration)

This only affects the plist diagnostics; this note is never shown in the
other diagnostics.

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

11 years agoEmit the function type of member function pointer types the same as member functions.
David Blaikie [Sat, 19 Jan 2013 19:20:56 +0000 (19:20 +0000)]
Emit the function type of member function pointer types the same as member functions.

Adding the pseudo first parameter to a member function pointer's function type
and mark it as artificial.

Combined with a fix to GDB ( http://sourceware.org/bugzilla/show_bug.cgi?id=14998 )
this fixes gdb.cp/member-ptr.exp with Clang.

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

11 years agolibclangSerialization also depends on the bitreader.
Benjamin Kramer [Sat, 19 Jan 2013 19:10:12 +0000 (19:10 +0000)]
libclangSerialization also depends on the bitreader.

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

11 years agoupdate header comment.
Chris Lattner [Sat, 19 Jan 2013 18:47:35 +0000 (18:47 +0000)]
update header comment.

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

11 years agofix the unit tests too.
Chris Lattner [Sat, 19 Jan 2013 18:30:39 +0000 (18:30 +0000)]
fix the unit tests too.

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

11 years agothese now depend on the bitcode reader too.
Chris Lattner [Sat, 19 Jan 2013 18:28:24 +0000 (18:28 +0000)]
these now depend on the bitcode reader too.

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

11 years agothis depends on the bitcode reader, since it is using it.
Chris Lattner [Sat, 19 Jan 2013 18:24:13 +0000 (18:24 +0000)]
this depends on the bitcode reader, since it is using it.

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

11 years ago[cindex.py] Add cache for CompletionChunk spellings
Tobias Grosser [Sat, 19 Jan 2013 11:03:44 +0000 (11:03 +0000)]
[cindex.py] Add cache for CompletionChunk spellings

Most of the CompletionChunks represent braces, colons or other one
character spellings. There is no need to call libclang, to figure out
how to write a colon. Instead we use an internal cache to retrieve the
correct spelling. As function calls from python are very expensive and
this is a performance critical part of auto completion this patch makes
formatting of auto completion results a lot faster.

Formatting time changes from 0.57 to 0.45 seconds

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

11 years ago[cindex.py] Replace CachedProperty with our own implementation
Tobias Grosser [Sat, 19 Jan 2013 11:03:42 +0000 (11:03 +0000)]
[cindex.py] Replace CachedProperty with our own implementation

This is a very performance critical point for auto completion. The manual
implementation gives a large speedup. As it does not complicate the code a lot,
I figured it is worth the change. If anybody understands why the CachedProperty
is here so much slower, I am very interested in working on an improvement of
CachedProperty.

Formatting time changes from 0.72 to 0.57 seconds.

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

11 years ago[cindex.py]: Speed up lookup of the completion kind
Tobias Grosser [Sat, 19 Jan 2013 11:03:40 +0000 (11:03 +0000)]
[cindex.py]: Speed up lookup of the completion kind

We can directly the number of the kind instead of going through the
completionChunkKindMap.

Formatting time changes from 0.84 to 0.72 seconds.

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

11 years agoRe-sort all the headers. Lots of regressions have crept in here.
Chandler Carruth [Sat, 19 Jan 2013 08:09:44 +0000 (08:09 +0000)]
Re-sort all the headers. Lots of regressions have crept in here.
Manually fix the order of UnwrappedLineParser.cpp as that one didn't
have its associated header as the first header.

This also uncovered a subtle inclusion order dependency as CLog.h didn't
include LLVM.h to pick up using declarations it relied upon.

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

11 years agoMove an input header file under an Inputs directory to be consistent
Chandler Carruth [Sat, 19 Jan 2013 06:31:24 +0000 (06:31 +0000)]
Move an input header file under an Inputs directory to be consistent
with other auxilliary test inputs and simplify the identification of
inputs to tests.

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

11 years agoReapply r172878 with test case.
Ted Kremenek [Sat, 19 Jan 2013 04:33:14 +0000 (04:33 +0000)]
Reapply r172878 with test case.

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

11 years agoFix five more cases of tokens which can legally follow a type specifier.
Richard Smith [Sat, 19 Jan 2013 03:48:05 +0000 (03:48 +0000)]
Fix five more cases of tokens which can legally follow a type specifier.

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

11 years ago[PCH/Modules] Revert r172843, it caused a module to fail building.
Argyrios Kyrtzidis [Sat, 19 Jan 2013 03:14:56 +0000 (03:14 +0000)]
[PCH/Modules] Revert r172843, it caused a module to fail building.

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

11 years ago[analyzer] Suppress warnings coming out of macros defined in sys/queue.h
Anna Zaks [Sat, 19 Jan 2013 02:18:15 +0000 (02:18 +0000)]
[analyzer] Suppress warnings coming out of macros defined in sys/queue.h

Suppress the warning by just not emitting the report. The sink node
would get generated, which is fine since we did reach a bad state.

Motivation

Due to the way code is structured in some of these macros, we do not
reason correctly about it and report false positives. Specifically, the
following loop reports a use-after-free. Because of the way the code is
structured inside of the macro, the analyzer assumes that the list can
have cycles, so you end up with use-after-free in the loop, that is
safely deleting elements of the list. (The user does not have a way to
teach the analyzer about shape of data structures.)

SLIST_FOREACH_SAFE(item, &ctx->example_list, example_le, tmpitem) {
if (item->index == 3) { // if you remove each time, no complaints
assert((&ctx->example_list)->slh_first == item);
SLIST_REMOVE(&ctx->example_list, item, example_s, example_le);
free(item);
}
}

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

11 years agoWhitespace.
NAKAMURA Takumi [Sat, 19 Jan 2013 01:54:35 +0000 (01:54 +0000)]
Whitespace.

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

11 years agoRevert r172878, "Reword warning about using a *static* variable within its own initia...
NAKAMURA Takumi [Sat, 19 Jan 2013 01:47:46 +0000 (01:47 +0000)]
Revert r172878, "Reword warning about using a *static* variable within its own initialization."

It broke, at least, linux, msvc and mingw bots.

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

11 years agoReword warning about using a *static* variable within its own initialization.
Ted Kremenek [Sat, 19 Jan 2013 00:49:00 +0000 (00:49 +0000)]
Reword warning about using a *static* variable within its own initialization.

The warning is still under -Wuninitialized (although technically this
is defined behavior), but under a subgroup -Wstatic-self-init.

This addresses PR 10265.

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

11 years ago-Wuninitialized: warn about uninitialized values resulting from ?: that evaluate...
Ted Kremenek [Sat, 19 Jan 2013 00:25:06 +0000 (00:25 +0000)]
-Wuninitialized: warn about uninitialized values resulting from ?: that evaluate to lvalues (in C++).

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

11 years agoRemove windows line endings.
David Blaikie [Fri, 18 Jan 2013 23:03:15 +0000 (23:03 +0000)]
Remove windows line endings.

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

11 years agoRemove unused variable
Matt Beaumont-Gay [Fri, 18 Jan 2013 22:34:17 +0000 (22:34 +0000)]
Remove unused variable

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

11 years agoAdopt llvm::hexDigitValue.
Jordan Rose [Fri, 18 Jan 2013 22:33:58 +0000 (22:33 +0000)]
Adopt llvm::hexDigitValue.

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

11 years agoFix mismatched #endif.
Jordan Rose [Fri, 18 Jan 2013 22:33:54 +0000 (22:33 +0000)]
Fix mismatched #endif.

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

11 years agoOnce we've collected the template arguments for a
Douglas Gregor [Fri, 18 Jan 2013 22:27:09 +0000 (22:27 +0000)]
Once we've collected the template arguments for a
partially-substituted parameter pack in a template, forget about the
partially-substituted parameter pack: it is now completed. Fixes
<rdar://problem/12176336>.

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

11 years agoThread-safety analysis: ignore edges from throw expressions in CFG.
DeLesley Hutchins [Fri, 18 Jan 2013 22:15:45 +0000 (22:15 +0000)]
Thread-safety analysis: ignore edges from throw expressions in CFG.

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

11 years agoInclude ubsan runtime even when building a shared library. We don't require the execu...
Richard Smith [Fri, 18 Jan 2013 22:09:26 +0000 (22:09 +0000)]
Include ubsan runtime even when building a shared library. We don't require the executable to be linked with UBSan.

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

11 years ago[mips] Enable inlining of atomic ops on mips32 and mips64.
Akira Hatanaka [Fri, 18 Jan 2013 21:58:11 +0000 (21:58 +0000)]
[mips] Enable inlining of atomic ops on mips32 and mips64.

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

11 years agoUse the AttributeSet query method instead of the Attribute method.
Bill Wendling [Fri, 18 Jan 2013 21:26:07 +0000 (21:26 +0000)]
Use the AttributeSet query method instead of the Attribute method.

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

11 years ago[PCH/Modules] Re-apply r172620 and r172629, now with 100% less infinite loops!
Argyrios Kyrtzidis [Fri, 18 Jan 2013 20:59:01 +0000 (20:59 +0000)]
[PCH/Modules] Re-apply r172620 and r172629, now with 100% less infinite loops!

Makes sure that a deserialized macro is only added to the preprocessor macro definitions only once.
Unfortunately I couldn't get a reduced test case.

rdar://13016031

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

11 years agoFix parsing of class specifiers before '\n' 'operator'.
Nico Weber [Fri, 18 Jan 2013 18:41:42 +0000 (18:41 +0000)]
Fix parsing of class specifiers before '\n' 'operator'.

r159549 / r159164 regressed clang to reject

  struct s {};
  struct s
  operator++(struct s a)
  { return a; }

This fixes the regression. Richard, pleas check if this looks right.

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

11 years ago[analyzer] Special path notes for C++ special member functions.
Jordan Rose [Fri, 18 Jan 2013 18:27:21 +0000 (18:27 +0000)]
[analyzer] Special path notes for C++ special member functions.

Examples:
  Calling implicit default constructor for Foo
  Calling defaulted move constructor for Foo
  Calling copy constructor for Foo
  Calling implicit destructor for Foo
  Calling defaulted move assignment operator for Foo
  Calling copy assignment operator for Foo

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

11 years ago[analyzer] Do a better job describing C++ member functions in the call stack.
Jordan Rose [Fri, 18 Jan 2013 18:27:14 +0000 (18:27 +0000)]
[analyzer] Do a better job describing C++ member functions in the call stack.

Examples:
  Calling constructor for 'Foo'
  Entered call from 'Foo::create'

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

11 years agoFix comment.
Manuel Klimek [Fri, 18 Jan 2013 18:24:28 +0000 (18:24 +0000)]
Fix comment.

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

11 years agoFixes issues around pulling in the next line in simple if statements.
Manuel Klimek [Fri, 18 Jan 2013 14:46:43 +0000 (14:46 +0000)]
Fixes issues around pulling in the next line in simple if statements.

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

11 years agoclang/test/CodeGen: Suppress a couple of tests on win32. It seems -fsanitize-blacklis...
NAKAMURA Takumi [Fri, 18 Jan 2013 14:11:04 +0000 (14:11 +0000)]
clang/test/CodeGen: Suppress a couple of tests on win32. It seems -fsanitize-blacklist doesn't accept DOSish pathnames.

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

11 years agoFixes problems with line merging in the face of preprocessor directives.
Manuel Klimek [Fri, 18 Jan 2013 14:04:34 +0000 (14:04 +0000)]
Fixes problems with line merging in the face of preprocessor directives.

This patch prepares being able to test for and fix more problems (see
FIXME in the test for example).

Previously we would output unwrapped lines for preprocessor directives
at the point where we also parsed the hash token. Since often
projections only terminate (and thus output their own unwrapped line)
after peeking at the next token, this would lead to the formatter seeing
the preprocessor directives out-of-order (slightly earlier). To be able
to correctly identify lines to merge, the formatter needs a well-defined
order of unwrapped lines, which this patch introduces.

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

11 years agoclang-check: Introduce llvm::sys::PrintStackTraceOnErrorSignal()
NAKAMURA Takumi [Fri, 18 Jan 2013 13:46:48 +0000 (13:46 +0000)]
clang-check: Introduce llvm::sys::PrintStackTraceOnErrorSignal()

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