This is an archive of the discontinued LLVM Phabricator instance.

Move the calling of emitTargetMD() later.
ClosedPublic

Authored by robertlytton on Jun 17 2014, 5:11 AM.

Details

Summary

Because a global created by GetOrCreateLLVMGlobal() is not finalised until later viz:

extern char a[];
char f(){ return a[5];}
char a[10];

multiple & wrong Metadata was being outputted.

Change MangledDeclNames to use a MapVector rather than a DenseMap so that the Metadata
is output in order of original declaration. This is to improve human readability.

Diff Detail

Repository
rL LLVM

Event Timeline

robertlytton retitled this revision from to Move the calling of emitTargetMD() later..
robertlytton updated this object.
robertlytton added a reviewer: friedgold.
robertlytton added a subscriber: Unknown Object (MLST).

Use 'auto' in the for-loops

use 'auto' in for-loops

Alp Toker changed how we handled mangled names last, he is probably the correct person to review this.

lib/CodeGen/CodeGenModule.cpp
3250 ↗(On Diff #10533)

Can this use a range loop. If so, please commit that as a first independent improvement.

rnk added a subscriber: rnk.Jun 19 2014, 2:35 PM

I just want to point out that this is a correctness fix too: clang's output should be deterministic, including the order in which we output metadata, which affects -emit-llvm.

change to use range loops
(should I be using 'auto &I' or plain 'auto I'?)

robertlytton closed this revision.Jul 3 2014, 2:38 AM
robertlytton updated this revision to Diff 11048.

Closed by commit rL212262 (authored by rlytton).