From f85d98285e8eb6bcf42c2821e3b03abfc22ffac9 Mon Sep 17 00:00:00 2001 From: Chandler Carruth Date: Thu, 26 Mar 2015 08:32:49 +0000 Subject: [Modules] Make "#pragma weak" undeclared identifiers be tracked deterministically. This fixes a latent issue where even Clang's Sema (and diagnostics) were non-deterministic in the face of this pragma. The fix is super simple -- just use a MapVector so we track the order in which these are parsed (or imported). Especially considering how rare they are, this seems like the perfect tradeoff. I've also simplified the client code with judicious use of auto and range based for loops. I've added some pretty hilarious code to my stress test which now survives the binary diff without issue. llvm-svn: 233261 --- clang/include/clang/Sema/Sema.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'clang/include') diff --git a/clang/include/clang/Sema/Sema.h b/clang/include/clang/Sema/Sema.h index 9e07ad533f1..dde928ff914 100644 --- a/clang/include/clang/Sema/Sema.h +++ b/clang/include/clang/Sema/Sema.h @@ -592,7 +592,7 @@ public: /// WeakUndeclaredIdentifiers - Identifiers contained in /// \#pragma weak before declared. rare. may alias another /// identifier, declared or undeclared - llvm::DenseMap WeakUndeclaredIdentifiers; + llvm::MapVector WeakUndeclaredIdentifiers; /// ExtnameUndeclaredIdentifiers - Identifiers contained in /// \#pragma redefine_extname before declared. Used in Solaris system headers -- cgit v1.2.3