]> granicus.if.org Git - clang/log
clang
11 years agoRemove stray semicolon
Douglas Gregor [Tue, 19 Mar 2013 00:41:04 +0000 (00:41 +0000)]
Remove stray semicolon

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

11 years agoMinor optimization to r177367 to treat a module with missing dependencies as out...
Douglas Gregor [Tue, 19 Mar 2013 00:38:50 +0000 (00:38 +0000)]
Minor optimization to r177367 to treat a module with missing dependencies as out-of-date rather than missing.

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

11 years agoFinish refactoring the tool selection logic.
Rafael Espindola [Tue, 19 Mar 2013 00:36:57 +0000 (00:36 +0000)]
Finish refactoring the tool selection logic.

The general pattern now is that Foobar::constructTool only creates tools
defined in the tools::foobar namespace and then delegates to the parent.

The remaining duplicated code is now in the tools themselves.

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

11 years ago<rdar://problem/13363214> Eliminate race condition between module rebuild and the...
Douglas Gregor [Tue, 19 Mar 2013 00:28:20 +0000 (00:28 +0000)]
<rdar://problem/13363214> Eliminate race condition between module rebuild and the global module index.

The global module index was querying the file manager for each of the
module files it knows about at load time, to prune out any out-of-date
information. The file manager would then cache the results of the
stat() falls used to find that module file.

Later, the same translation unit could end up trying to import one of the
module files that had previously been ignored by the module cache, but
after some other Clang instance rebuilt the module file to bring it
up-to-date. The stale stat() results in the file manager would
trigger a second rebuild of the already-up-to-date module, causing
failures down the line.

The global module index now lazily resolves its module file references
to actual AST reader module files only after the module file has been
loaded, eliminating the stat-caching race. Moreover, the AST reader
can communicate to its caller that a module file is missing (rather
than simply being out-of-date), allowing us to simplify the
module-loading logic and allowing the compiler to recover if a
dependent module file ends up getting deleted.

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

11 years agoPR15383: When -fsanitize=float-cast-overflow checks a float-to-int conversion,
Richard Smith [Tue, 19 Mar 2013 00:01:12 +0000 (00:01 +0000)]
PR15383: When -fsanitize=float-cast-overflow checks a float-to-int conversion,
it wasn't taking into account that the float should be truncated *before* the
range check happens. Thus (unsigned)-0.99 and (unsigned char)255.9 have defined
behavior and should not be trapped.

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

11 years agoCentralize the logic for using the integrated assembler.
Rafael Espindola [Mon, 18 Mar 2013 23:56:07 +0000 (23:56 +0000)]
Centralize the logic for using the integrated assembler.

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

11 years ago[libclang] Modify clang_getCursorType to be able to handle a function template decl.
Argyrios Kyrtzidis [Mon, 18 Mar 2013 23:54:50 +0000 (23:54 +0000)]
[libclang] Modify clang_getCursorType to be able to handle a function template decl.

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

11 years agodocumentation comment parsing. Added couple of
Fariborz Jahanian [Mon, 18 Mar 2013 23:45:52 +0000 (23:45 +0000)]
documentation comment parsing. Added couple of
top-level HeaderDoc tags @functiongroup and
@methodgroup to doc. tags recognized.
// rdar://12379114

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

11 years agoDiagnose uses of 'alignof' on functions in -pedantic mode.
Richard Smith [Mon, 18 Mar 2013 23:37:25 +0000 (23:37 +0000)]
Diagnose uses of 'alignof' on functions in -pedantic mode.

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

11 years ago[analyzer] Do part of the work to find shortest bug paths up front.
Jordan Rose [Mon, 18 Mar 2013 23:34:37 +0000 (23:34 +0000)]
[analyzer] Do part of the work to find shortest bug paths up front.

Splitting the graph trimming and the path-finding (r177216) already
recovered quite a bit of performance lost to increased suppression.
We can still do better by also performing the reverse BFS up front
(needed for shortest-path-finding) and only walking the shortest path
for each report. This does mean we have to walk back up the path and
invalidate all the BFS numbers if the report turns out to be invalid,
but it's probably still faster than redoing the full BFS every time.

More performance work for <rdar://problem/13433687>

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

11 years ago[analyzer] Replace uses of assume() with isNull() in BR visitors.
Jordan Rose [Mon, 18 Mar 2013 23:34:32 +0000 (23:34 +0000)]
[analyzer] Replace uses of assume() with isNull() in BR visitors.

Also, replace a std::string with a SmallString.

No functionality change.

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

11 years agoTest case for r177347.
Chad Rosier [Mon, 18 Mar 2013 23:32:33 +0000 (23:32 +0000)]
Test case for r177347.

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

11 years agoPR15539: Record "evaluating if/elif condition" flag in the right place
David Blaikie [Mon, 18 Mar 2013 23:22:28 +0000 (23:22 +0000)]
PR15539: Record "evaluating if/elif condition" flag in the right place

The previous implementation missed the case where the elif condition was
evaluated from the context of an #ifdef that was false causing PR15539.

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

11 years agoUpdate testcase for r177340.
Bill Wendling [Mon, 18 Mar 2013 23:11:54 +0000 (23:11 +0000)]
Update testcase for r177340.

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

11 years ago[frontend] Initialize the diagnostic client before loading an ast file.
Argyrios Kyrtzidis [Mon, 18 Mar 2013 22:55:24 +0000 (22:55 +0000)]
[frontend] Initialize the diagnostic client before loading an ast file.

Issue reported by Tom Honermann!
http://llvm.org/bugs/show_bug.cgi?id=15377

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

11 years agoAdd missing diagnostic for a nested-name-specifier on a free-standing type definition...
Richard Smith [Mon, 18 Mar 2013 22:52:47 +0000 (22:52 +0000)]
Add missing diagnostic for a nested-name-specifier on a free-standing type definition. Bump some related diagnostics from warning to extension in C++, since they're errors there. Add some missing checks for function specifiers on non-function declarations.

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

11 years ago[PCH] Fix assertion hit related to enum decls inside templated funtions.
Argyrios Kyrtzidis [Mon, 18 Mar 2013 22:23:49 +0000 (22:23 +0000)]
[PCH] Fix assertion hit related to enum decls inside templated funtions.

Report and suggested fix by Tom Honermann!
http://llvm.org/bugs/show_bug.cgi?id=13020

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

11 years agoThis code works around what appears to be a bug in another part of clang.
Reed Kotler [Mon, 18 Mar 2013 22:18:00 +0000 (22:18 +0000)]
This code works around what appears to be a bug in another part of clang.
I have filed http://llvm.org/bugs/show_bug.cgi?id=15538 against clang.
This code is safer anyway because "cast" assumes you really know that
it's okay to make the cast. In this case isa should not be false and
dyn_cast should not return null as far as I understand. But everything
else is valid so I did not want to revert my previous patch for attributes
mips16/nomips16 or use an llvm_unreachable here which would make a number
of our tests fail for mips.

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

11 years agoAdd a linebreak. Linebreaks are cool.
Richard Smith [Mon, 18 Mar 2013 21:57:52 +0000 (21:57 +0000)]
Add a linebreak. Linebreaks are cool.

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

11 years agoC++11 status: mark 'extended integral types' as N/A, since we don't support
Richard Smith [Mon, 18 Mar 2013 21:44:56 +0000 (21:44 +0000)]
C++11 status: mark 'extended integral types' as N/A, since we don't support
any, and add a note that we cannot treat __int128 as an extended integral type.

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

11 years agoBring inheriting constructor implementation up-to-date with current defect
Richard Smith [Mon, 18 Mar 2013 21:12:30 +0000 (21:12 +0000)]
Bring inheriting constructor implementation up-to-date with current defect
reports, and implement implicit definition of inheriting constructors.
Remaining missing features: inheriting constructor templates, implicit
exception specifications for inheriting constructors, inheriting constructors
from dependent bases.

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

11 years agoCentralize the recording of which tools have been constructed.
Rafael Espindola [Mon, 18 Mar 2013 20:48:54 +0000 (20:48 +0000)]
Centralize the recording of which tools have been constructed.

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

11 years ago[analyzer] Warn when a ‘nil’ object is added to NSArray or NSMutableArray.
Anna Zaks [Mon, 18 Mar 2013 20:46:56 +0000 (20:46 +0000)]
[analyzer] Warn when a ‘nil’ object is added to NSArray or NSMutableArray.

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

11 years agoObjective-C modern translator. Don't put line info
Fariborz Jahanian [Mon, 18 Mar 2013 19:41:18 +0000 (19:41 +0000)]
Objective-C modern translator. Don't put line info
into the pre-preprocessed file to be passed to
modern translator when compiling in no debug mode.
// rdar://13138170

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

11 years agoUse early returns when checking if we already constructed a tool and when
Rafael Espindola [Mon, 18 Mar 2013 18:50:01 +0000 (18:50 +0000)]
Use early returns when checking if we already constructed a tool and when
delegating to Generic_GCC::SelectTool (it already updates the tool map).

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

11 years agoRemove unused argument.
Rafael Espindola [Mon, 18 Mar 2013 18:19:46 +0000 (18:19 +0000)]
Remove unused argument.

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

11 years agoPass an ArgList to every toolchain constructor. Remove the useIntegratedAs
Rafael Espindola [Mon, 18 Mar 2013 18:10:27 +0000 (18:10 +0000)]
Pass an ArgList to every toolchain constructor. Remove the useIntegratedAs
argument.

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

11 years agoInline ShouldUseIntegratedAssembler and move the documentation to
Rafael Espindola [Mon, 18 Mar 2013 17:58:22 +0000 (17:58 +0000)]
Inline ShouldUseIntegratedAssembler and move the documentation to
useIntegratedAs.

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

11 years agoRefactor a bit of duplicated code to useIntegratedAs.
Rafael Espindola [Mon, 18 Mar 2013 17:52:57 +0000 (17:52 +0000)]
Refactor a bit of duplicated code to useIntegratedAs.

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

11 years agoRemove unused argument.
Rafael Espindola [Mon, 18 Mar 2013 17:25:58 +0000 (17:25 +0000)]
Remove unused argument.

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

11 years agoRemove unused argument.
Rafael Espindola [Mon, 18 Mar 2013 15:33:26 +0000 (15:33 +0000)]
Remove unused argument.

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

11 years agoFix clang-format segfault.
Daniel Jasper [Mon, 18 Mar 2013 12:50:26 +0000 (12:50 +0000)]
Fix clang-format segfault.

When annotating "lines" starting with ":", clang-format would segfault.
This could actually happen in valid code, e.g.
  #define A :

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

11 years agoObjCDictionaryElements are pod-like.
Benjamin Kramer [Mon, 18 Mar 2013 12:41:25 +0000 (12:41 +0000)]
ObjCDictionaryElements are pod-like.

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

11 years agoMake sure to use same EABI version for external assembler as for integrated as.
Anton Korobeynikov [Mon, 18 Mar 2013 07:59:20 +0000 (07:59 +0000)]
Make sure to use same EABI version for external assembler as for integrated as.
Patch by Andrew Turner!

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

11 years agoGeneralize a few debug info test cases
David Blaikie [Sun, 17 Mar 2013 20:29:22 +0000 (20:29 +0000)]
Generalize a few debug info test cases

Checking for the annotation comment rather than the metadata values makes these
tests resilient to a coming refactor that will pull these fields out into a
separate metadata node.

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

11 years agorevert r177211 due to its potential issues
Manman Ren [Sat, 16 Mar 2013 04:47:38 +0000 (04:47 +0000)]
revert r177211 due to its potential issues

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

11 years ago[analyzer] Model trivial copy/move assignment operators with a bind as well.
Jordan Rose [Sat, 16 Mar 2013 02:14:06 +0000 (02:14 +0000)]
[analyzer] Model trivial copy/move assignment operators with a bind as well.

r175234 allowed the analyzer to model trivial copy/move constructors as
an aggregate bind. This commit extends that to trivial assignment
operators as well. Like the last commit, one of the motivating factors here
is not warning when the right-hand object is partially-initialized, which
can have legitimate uses.

<rdar://problem/13405162>

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

11 years agoRemove -Wspellcheck and replace it with a diagnostic option.
Argyrios Kyrtzidis [Sat, 16 Mar 2013 01:40:35 +0000 (01:40 +0000)]
Remove -Wspellcheck and replace it with a diagnostic option.

Thanks to Richard S. for pointing out that the warning would show up
with -Weverything.

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

11 years ago[analyzer] Separate graph trimming from creating the single-path graph.
Jordan Rose [Sat, 16 Mar 2013 01:07:58 +0000 (01:07 +0000)]
[analyzer] Separate graph trimming from creating the single-path graph.

When we generate a path diagnostic for a bug report, we have to take the
full ExplodedGraph and limit it down to a single path. We do this in two
steps: "trimming", which limits the graph to all the paths that lead to
this particular bug, and "creating the report graph", which finds the
shortest path in the trimmed path to any error node.

With BugReporterVisitor false positive suppression, this becomes more
expensive: it's possible for some paths through the trimmed graph to be
invalid (i.e. likely false positives) but others to be valid. Therefore
we have to run the visitors over each path in the graph until we find one
that is valid, or until we've ruled them all out. This can become quite
expensive.

This commit separates out graph trimming from creating the report graph,
performing the first only once per bug equivalence class and the second
once per bug report. It also cleans up that portion of the code by
introducing some wrapper classes.

This seems to recover most of the performance regression described in my
last commit.

<rdar://problem/13433687>

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

11 years ago[analyzer] Eliminate InterExplodedGraphMap class and NodeBackMap typedef.
Jordan Rose [Sat, 16 Mar 2013 01:07:53 +0000 (01:07 +0000)]
[analyzer] Eliminate InterExplodedGraphMap class and NodeBackMap typedef.

...in favor of this typedef:

  typedef llvm::DenseMap<const ExplodedNode *, const ExplodedNode *>
          InterExplodedGraphMap;

Use this everywhere the previous class and typedef were used.

Took the opportunity to ArrayRef-ize ExplodedGraph::trim while I'm at it.

No functionality change.

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

11 years ago[analyzer] Don't repeat a bug equivalence class if every report is invalid.
Jordan Rose [Sat, 16 Mar 2013 01:07:47 +0000 (01:07 +0000)]
[analyzer] Don't repeat a bug equivalence class if every report is invalid.

I removed this check in the recursion->iteration commit, but forgot that
generatePathDiagnostic may be called multiple times if there are multiple
PathDiagnosticConsumers.

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

11 years agoExploit this-return of a callsite in a this-return function.
Manman Ren [Sat, 16 Mar 2013 00:11:09 +0000 (00:11 +0000)]
Exploit this-return of a callsite in a this-return function.

For constructors/desctructors that return 'this', if there exists a callsite
that returns 'this' and is immediately before the return instruction, make
sure we are using the return value from the callsite.

We don't need to keep 'this' alive through the callsite. It also enables
optimizations in the backend, such as tail call optimization.

rdar://12818789

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

11 years agoImprove template diffing handling of default integer values.
Richard Trieu [Fri, 15 Mar 2013 23:55:09 +0000 (23:55 +0000)]
Improve template diffing handling of default integer values.

When the template argument is both default and value dependent, the expression
retrieved for the default argument cannot be evaluated, thus never matching
any argument value.  To get the proper value, get the template argument
from the desugared template specialization.  Also, output the original
expression to provide more information about the argument mismatch.

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

11 years ago[analyzer] Address a TODO in the StreamChecker; otherwise the output is non-determini...
Anna Zaks [Fri, 15 Mar 2013 23:34:31 +0000 (23:34 +0000)]
[analyzer] Address a TODO in the StreamChecker; otherwise the output is non-deterministic.

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

11 years ago[analyzer] Use isLiveRegion to determine when SymbolRegionValue is dead.
Anna Zaks [Fri, 15 Mar 2013 23:34:29 +0000 (23:34 +0000)]
[analyzer] Use isLiveRegion to determine when SymbolRegionValue is dead.

Fixes a FIXME, improves dead symbol collection, suppresses a false positive,
which resulted from reusing the same symbol twice for simulation of 2 calls to the same function.

Fixing this lead to 2 possible false negatives in CString checker. Since the checker is still alpha and
the solution will not require revert of this commit, move the tests to a FIXME section.

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

11 years ago[analyzer] BugReporterVisitors: handle the case where a ternary operator is wrapped...
Anna Zaks [Fri, 15 Mar 2013 23:34:25 +0000 (23:34 +0000)]
[analyzer] BugReporterVisitors: handle the case where a ternary operator is wrapped in a cast.

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

11 years ago[analyzer] Address Jordan’s review of r177138 (a micro optimization)
Anna Zaks [Fri, 15 Mar 2013 23:34:22 +0000 (23:34 +0000)]
[analyzer] Address Jordan’s review of r177138 (a micro optimization)

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

11 years agoFix buffer underrun (invalid read) triggered during diagnostic rendering. The test...
Ted Kremenek [Fri, 15 Mar 2013 23:09:37 +0000 (23:09 +0000)]
Fix buffer underrun (invalid read) triggered during diagnostic rendering.  The test would overflow when computing '0 - 1'.

I don't have a good testcase for this that does not depend on system headers.
It did not trigger with preprocessed output, and I had trouble reducing the example.

Fixes <rdar://problem/13324594>.

Thanks to Michael Greiner for reporting this issue.

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

11 years ago[modules] Don't record the macros from the predefines buffer.
Argyrios Kyrtzidis [Fri, 15 Mar 2013 22:43:10 +0000 (22:43 +0000)]
[modules] Don't record the macros from the predefines buffer.

These will be available in the current translation unit anyway, for
modules they only waste space and deserialization time.

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

11 years ago<rdar://problem/13426257> Introduce SDKSettings.plist as an input file dependency...
Douglas Gregor [Fri, 15 Mar 2013 22:15:07 +0000 (22:15 +0000)]
<rdar://problem/13426257> Introduce SDKSettings.plist as an input file dependency for PCH/modules.

When we're building a precompiled header or module against an SDK on
Darwin, there will be a file SDKSettings.plist in the sysroot. Since
stat()'ing every system header on which a module or PCH file depends
is performance suicide, we instead stat() just SDKSettings.plist. This
hack works well on Darwin; it's unclear how we want to handle this on
other platforms. If there is a canonical file, we should use it; if
not, we either have to take the performance hit of stat()'ing system
headers repeatedly or roll the dice by not checking anything.

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

11 years agoSimplify print logic, per feedback from Jordan Rose.
Ted Kremenek [Fri, 15 Mar 2013 22:02:46 +0000 (22:02 +0000)]
Simplify print logic, per feedback from Jordan Rose.

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

11 years agoEnhance -Wtautological-constant-out-of-range-compare to include the name of the enum...
Ted Kremenek [Fri, 15 Mar 2013 21:50:10 +0000 (21:50 +0000)]
Enhance -Wtautological-constant-out-of-range-compare to include the name of the enum constant.

This is QoI.  Fixes <rdar://problem/13076064>.

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

11 years ago[analyzer] Make GRBugReporter::generatePathDiagnostic iterative, not recursive.
Jordan Rose [Fri, 15 Mar 2013 21:41:55 +0000 (21:41 +0000)]
[analyzer] Make GRBugReporter::generatePathDiagnostic iterative, not recursive.

The previous generatePathDiagnostic() was intended to be tail-recursive,
restarting and trying again if a report was marked invalid. However:
 (1) this leaked all the cloned visitors, which weren't being deleted, and
 (2) this wasn't actually tail-recursive because some local variables had
     non-trivial destructors.

This was causing us to overflow the stack on inputs with large numbers of
reports in the same equivalence class, such as sqlite3.c. Being iterative
at least prevents us from blowing out the stack, but doesn't solve the
performance issue: suppressing thousands (yes, thousands) of paths in the
same equivalence class is expensive. I'm looking into that now.

<rdar://problem/13423498>

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

11 years ago[analyzer] Collect stats on the max # of bug reports in an equivalence class.
Jordan Rose [Fri, 15 Mar 2013 21:41:53 +0000 (21:41 +0000)]
[analyzer] Collect stats on the max # of bug reports in an equivalence class.

We discovered that sqlite3.c currently has 2600 reports in a single
equivalence class; it would be good to know if this is a recent
development or what.

(For the curious, the different reports in an equivalence class represent
the same bug found along different paths. When we're suppressing false
positives, we need to go through /every/ path to make sure there isn't a
valid path to a bug. This is a flaw in our after-the-fact suppression,
made worse by the fact that that function isn't particularly optimized.)

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

11 years ago[analyzer] Include opcode in dumping a SymSymExpr.
Jordan Rose [Fri, 15 Mar 2013 21:41:50 +0000 (21:41 +0000)]
[analyzer] Include opcode in dumping a SymSymExpr.

For debugging use only; no functionality change.

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

11 years ago[analyzer] Look through ExprWhenCleanups when trying to track a NULL.
Jordan Rose [Fri, 15 Mar 2013 21:41:46 +0000 (21:41 +0000)]
[analyzer] Look through ExprWhenCleanups when trying to track a NULL.

Silences a few false positives in LLVM.

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

11 years agoAdd some assertions to appease the static analyzer.
Jordan Rose [Fri, 15 Mar 2013 21:41:35 +0000 (21:41 +0000)]
Add some assertions to appease the static analyzer.

No functionality change.

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

11 years agoRemove unnecessary default in covered switch over enum
David Blaikie [Fri, 15 Mar 2013 21:12:54 +0000 (21:12 +0000)]
Remove unnecessary default in covered switch over enum

This cleans up the Clang -Werror build that was broken by r177180.

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

11 years ago[AST] Add a fast path to ConstantArrayType::getNumAddressingBits().
Daniel Dunbar [Fri, 15 Mar 2013 20:55:27 +0000 (20:55 +0000)]
[AST] Add a fast path to ConstantArrayType::getNumAddressingBits().

 - This fast path is almost 100% effective on real code, and lets us avoid
   multiple allocations of 128-bit APSInt objects in the common case.

 - As with any overflow-check-skipping-code, I'd appreciate someone double
   checking my logic.

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

11 years agoc: perform integer overflow check on all binary
Fariborz Jahanian [Fri, 15 Mar 2013 20:47:07 +0000 (20:47 +0000)]
c: perform integer overflow check on all binary
operations. // rdar://13423975

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

11 years agoRefactor template diffing to store an enum that records which type of
Richard Trieu [Fri, 15 Mar 2013 20:35:18 +0000 (20:35 +0000)]
Refactor template diffing to store an enum that records which type of
difference is stored inside a DiffNode.  This should not change any
diagnostic messages.

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

11 years agoClangTool output cleanup
Edwin Vane [Fri, 15 Mar 2013 20:14:01 +0000 (20:14 +0000)]
ClangTool output cleanup

Information messages sent to stdout by ClangTool now only happen when the
-debug flag is set.

Error messages that used to go to stdout now go to stderr.

Author: Ariel J Bernal <ariel.j.bernal@intel.com>

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

11 years agoRevert "Remove a pointless assertion."
Bob Wilson [Fri, 15 Mar 2013 17:12:43 +0000 (17:12 +0000)]
Revert "Remove a pointless assertion."

This reverts commit r177158.

I'm blindly reverting this because it appears to be breaking numerous
buildbots.  I'll reapply if it doesn't turn out to be the culprit.

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

11 years agoForce column info only for direct inlined functions. This should strike
Adrian Prantl [Fri, 15 Mar 2013 17:09:05 +0000 (17:09 +0000)]
Force column info only for direct inlined functions. This should strike
the balance between expected behavior and compatibility with the gdb
testsuite.
(GDB gets confused if we break an expression into multiple debug
stmts so we enable this behavior only for inlined functions. For the
full experience people can still use -gcolumn-info.)

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

11 years agoc: Also chek for integer overflow for '%' operator.
Fariborz Jahanian [Fri, 15 Mar 2013 17:03:56 +0000 (17:03 +0000)]
c: Also chek for integer overflow for '%' operator.

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

11 years agoc: add the missing binary operatory when checking
Fariborz Jahanian [Fri, 15 Mar 2013 16:36:04 +0000 (16:36 +0000)]
c: add the missing binary operatory when checking
for integer overflow. // rdar://13423975

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

11 years agoTake in account the triplet 'powerpc-linux-gnuspe' for PowerPC SPE. Done for the...
Sylvestre Ledru [Fri, 15 Mar 2013 16:22:43 +0000 (16:22 +0000)]
Take in account the triplet 'powerpc-linux-gnuspe' for PowerPC SPE. Done for the port of Debian on this arch. More information on: http://wiki.debian.org/PowerPCSPEPort Patch by Roland Stigge

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

11 years agoRemove a pointless assertion.
Nico Weber [Fri, 15 Mar 2013 15:02:37 +0000 (15:02 +0000)]
Remove a pointless assertion.

FindNodeOrInsertPos() is called 10 lines earlier already, and the function
early-returns there if the result is != 0. InsertPos isn't recomputed after
that check, so this assert is always trivially true. (And it has nothing to
do with if T is canonical or not.)

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

11 years agoImprove formatting of chained calls.
Daniel Jasper [Fri, 15 Mar 2013 14:57:30 +0000 (14:57 +0000)]
Improve formatting of chained calls.

clang-format already prevented sequences like:
  ...
  SomeParameter).someFunction(
  ...

as those are quite confusing. This failed on:
  ...
  SomeParameter).someFunction(otherFunction(
  ...

Fixed in this patch.

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

11 years agoIndent all lines in a multi-line comment by the same amount.
Alexander Kornienko [Fri, 15 Mar 2013 13:42:02 +0000 (13:42 +0000)]
Indent all lines in a multi-line comment by the same amount.

Summary:
Do this to avoid spoling nicely formatted multi-line comments (e.g.
with code examples or similar stuff).

Reviewers: djasper

Reviewed By: djasper

CC: cfe-commits, klimek
Differential Revision: http://llvm-reviews.chandlerc.com/D544

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

11 years agoFixup for r176934. More careful setup of path to llvm-symbolizer
Alexey Samsonov [Fri, 15 Mar 2013 07:29:58 +0000 (07:29 +0000)]
Fixup for r176934. More careful setup of path to llvm-symbolizer

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

11 years ago[analyzer] Refactor checks in IDC visitor for consistency and speed
Anna Zaks [Fri, 15 Mar 2013 01:15:14 +0000 (01:15 +0000)]
[analyzer] Refactor checks in IDC visitor for consistency and speed

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

11 years ago[analyzer] Teach trackNullOrUndef to look through ternary operators
Anna Zaks [Fri, 15 Mar 2013 01:15:12 +0000 (01:15 +0000)]
[analyzer] Teach trackNullOrUndef to look through ternary operators

Allows the suppression visitors trigger more often.

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

11 years agoPR15290: 'this' is not permitted in the declaration of a friend function,
Richard Smith [Fri, 15 Mar 2013 00:41:52 +0000 (00:41 +0000)]
PR15290: 'this' is not permitted in the declaration of a friend function,
therefore references to members should not be transformed into implicit uses of
'this'. Patch by Ismail Pazarbasi!

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

11 years agoSilence anonymous type in anonymous union warnings.
Eric Christopher [Fri, 15 Mar 2013 00:32:52 +0000 (00:32 +0000)]
Silence anonymous type in anonymous union warnings.

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

11 years agoDiagnose about extern "C" functions returning c++ objects
Fariborz Jahanian [Thu, 14 Mar 2013 23:09:00 +0000 (23:09 +0000)]
Diagnose about extern "C" functions returning c++ objects
on first declaration only. // rdar://13364028

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

11 years agoDon't try to typo-correct 'super' in an objc method.
Argyrios Kyrtzidis [Thu, 14 Mar 2013 22:56:43 +0000 (22:56 +0000)]
Don't try to typo-correct 'super' in an objc method.

This created 2 issues:

1) Performance issue, since typo-correction with PCH/modules is rather expensive.
2) Correctness issue, since if it managed to "correct" 'super' then bogus compiler errors would
be emitted, like this:

3.m:8:3: error: unknown type name 'super'; did you mean 'super1'?
  super.x = 0;
  ^~~~~
  super1
t3.m:5:13: note: 'super1' declared here
typedef int super1;
            ^
t3.m:8:8: error: expected identifier or '('
  super.x = 0;
       ^

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

11 years agoAdd a testcase for r177118.
Adrian Prantl [Thu, 14 Mar 2013 22:49:05 +0000 (22:49 +0000)]
Add a testcase for r177118.

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

11 years ago[analyzer] Change the way in which IDC Visitor decides to kick in and make sure it...
Anna Zaks [Thu, 14 Mar 2013 22:31:56 +0000 (22:31 +0000)]
[analyzer] Change the way in which IDC Visitor decides to kick in and make sure it attaches in the given edge case

In the test case below, the value V is not constrained to 0 in ErrorNode but it is in node N.
So we used to fail to register the Suppression visitor.

We also need to change the way we determine that the Visitor should kick in because the node N belongs to
the ExplodedGraph and might not be on the BugReporter path that the visitor sees. Instead of trying to match the node,
turn on the visitor when we see the last node in which the symbol is ‘0’.

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

11 years agoAlways declare the .block_descriptor parameter, not just the local copy.
Adrian Prantl [Thu, 14 Mar 2013 21:52:59 +0000 (21:52 +0000)]
Always declare the .block_descriptor parameter, not just the local copy.
Un-breaks gdb's invoke-block behavior.

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

11 years ago[PR15513/<rdar://problem/13409707>] Template arguments in diagnostics aren't always...
Douglas Gregor [Thu, 14 Mar 2013 20:44:43 +0000 (20:44 +0000)]
[PR15513/<rdar://problem/13409707>] Template arguments in diagnostics aren't always known at compile time.

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

11 years agoAllocate stack storage for .block_descriptor and captured self at -O0.
Adrian Prantl [Thu, 14 Mar 2013 17:53:33 +0000 (17:53 +0000)]
Allocate stack storage for .block_descriptor and captured self at -O0.
This way the register allocator will not optimize away the debug info
for captured variables.

Fixes rdar://problem/12767564

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

11 years ago[analyzer] Fix scan-build's -stats mode.
Jordan Rose [Thu, 14 Mar 2013 17:18:30 +0000 (17:18 +0000)]
[analyzer] Fix scan-build's -stats mode.

We were failing to match the output line, which led to us collecting no
stats at all, which led to a divide-by-zero error.

Fixes PR15510.

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

11 years agoImplements memoization for ancestor matching.
Manuel Klimek [Thu, 14 Mar 2013 16:33:21 +0000 (16:33 +0000)]
Implements memoization for ancestor matching.

This yields a log(#ast_nodes) worst-case improvement with matchers like
stmt(unless(hasAncestor(...))).

Also made the order of visitation for ancestor matches BFS, as the most
common use cases (for example finding the closest enclosing function
definition) rely on that.

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

11 years agoMulti-line comment alignment
Alexander Kornienko [Thu, 14 Mar 2013 16:10:54 +0000 (16:10 +0000)]
Multi-line comment alignment

Summary:
Aligns continuation lines of multi-line comments to the base
indentation level +1:
class A {
  /*
   * test
   */
  void f() {}
};

The first revision is work in progress. The implementation is not yet complete.

Reviewers: djasper

Reviewed By: djasper

CC: cfe-commits, klimek
Differential Revision: http://llvm-reviews.chandlerc.com/D541

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

11 years agoSlightly improve formatting of longer pipe statements.
Daniel Jasper [Thu, 14 Mar 2013 14:00:17 +0000 (14:00 +0000)]
Slightly improve formatting of longer pipe statements.

The stronger binding of a string ending in :/= does not really make
sense if it is the only character.

Before:
llvm::outs() << aaaaaaaaaaaaaaaaaaaaaaaa
             << "=" << bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb;

After:
llvm::outs() << aaaaaaaaaaaaaaaaaaaaaaaa << "="
             << bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb;

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

11 years agoBasic support for formatting asm() statments.
Daniel Jasper [Thu, 14 Mar 2013 13:45:21 +0000 (13:45 +0000)]
Basic support for formatting asm() statments.

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

11 years agoDocumentation: improve formatting
Dmitri Gribenko [Thu, 14 Mar 2013 12:53:46 +0000 (12:53 +0000)]
Documentation: improve formatting

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

11 years ago[ASan] Update docs for -fsanitize=init-order option
Alexey Samsonov [Thu, 14 Mar 2013 12:26:21 +0000 (12:26 +0000)]
[ASan] Update docs for -fsanitize=init-order option

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

11 years ago[ASan] Make -fsanitize=address imply -fsanitize=init-order (if the latter is not...
Alexey Samsonov [Thu, 14 Mar 2013 12:13:27 +0000 (12:13 +0000)]
[ASan] Make -fsanitize=address imply -fsanitize=init-order (if the latter is not explicitly disabled).

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

11 years agoFix an unused variable warning from Clang by sinking a dyn_cast into an
Chandler Carruth [Thu, 14 Mar 2013 11:17:20 +0000 (11:17 +0000)]
Fix an unused variable warning from Clang by sinking a dyn_cast into an
isa and a cast inside the assert. The efficiency concern isn't really
important here. The code should likely be cleaned up a bit more,
especially getting a message into the assert.

Please review Rafael.

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

11 years agoFix dereference formatting in for-loops.
Daniel Jasper [Thu, 14 Mar 2013 10:50:25 +0000 (10:50 +0000)]
Fix dereference formatting in for-loops.

Before: for (char **a = b; * a; ++a) {}
After:  for (char **a = b; *a; ++a) {}

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

11 years agoAdd support for the 'endian' attribute for OpenCL.
Joey Gouly [Thu, 14 Mar 2013 09:54:43 +0000 (09:54 +0000)]
Add support for the 'endian' attribute for OpenCL.

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

11 years agoImprove formatting of trailing annotations.
Daniel Jasper [Thu, 14 Mar 2013 09:50:46 +0000 (09:50 +0000)]
Improve formatting of trailing annotations.

Before:
bool aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa __attribute__((
    unused));

After:
bool aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
    __attribute__((unused));

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

11 years agoUpdate GCOVProfiling pass creation for API change in r177002. No functionality change.
Nick Lewycky [Thu, 14 Mar 2013 05:14:01 +0000 (05:14 +0000)]
Update GCOVProfiling pass creation for API change in r177002. No functionality change.

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

11 years agoFlag that friend function definitions are "late parsed" so that
John McCall [Thu, 14 Mar 2013 05:13:41 +0000 (05:13 +0000)]
Flag that friend function definitions are "late parsed" so that
template instantiation will still consider them to be definitions
if we instantiate the containing class before we get around
to parsing the friend.

This seems like a legitimate use of "late template parsed" to me,
but I'd appreciate it if someone responsible for the MS feature
would look over this.

This file already appears to access AST nodes directly, which
is arguably not kosher in the parser, but the performance of this
path matters enough that perpetuating the sin is justifiable.
Probably we ought to reconsider this policy for very simple
manipulations like this.

The reason this entire thing is necessary is that
function template instantiation plays some very gross games
in order to not associate an instantiated function template
with the class it came from unless it's a definition, and
the reason *that's* necessary is that the AST currently
cannot represent the instantiation history of individual
function template declarations, but instead tracks it in
common for the entire function template.  That probably
prevents us from correctly reporting ill-formed calls to
ambiguously instantiated friend function templates.

rdar://12350696

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

11 years ago[modules] Don't write the UnusedFileScopedDecls vector to the module file.
Argyrios Kyrtzidis [Thu, 14 Mar 2013 04:45:00 +0000 (04:45 +0000)]
[modules] Don't write the UnusedFileScopedDecls vector to the module file.

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

11 years ago[modules] Check for delegating constructor cycles when building a module and don...
Argyrios Kyrtzidis [Thu, 14 Mar 2013 04:44:56 +0000 (04:44 +0000)]
[modules] Check for delegating constructor cycles when building a module and don't write them out to the module file.

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

11 years agoAvoid computing the linkage too early. Don't invalidate it.
Rafael Espindola [Thu, 14 Mar 2013 03:07:35 +0000 (03:07 +0000)]
Avoid computing the linkage too early. Don't invalidate it.

Before this patch we would compute the linkage lazily and cache it. When the
AST was modified in ways that could change the value, we would invalidate the
cache.

That was fairly brittle, since any code could ask for the a linkage before
the correct value was available.

We should change the API to one where the linkage is computed explicitly and
trying to get it when it is not available asserts.

This patch is a first step in that direction. We still compute the linkage
lazily, but instead of invalidating a cache, we assert that the AST
modifications didn't change the result.

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

11 years agoReally fix the MIPS test.
Bill Wendling [Wed, 13 Mar 2013 22:44:19 +0000 (22:44 +0000)]
Really fix the MIPS test.

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