Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(514)

Unified Diff: lib/Analysis/NaCl/PNaClABIVerifyFunctions.cpp

Issue 1151093004: Changes from 3.7 merge to files not in upstream (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-llvm.git@master
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: lib/Analysis/NaCl/PNaClABIVerifyFunctions.cpp
diff --git a/lib/Analysis/NaCl/PNaClABIVerifyFunctions.cpp b/lib/Analysis/NaCl/PNaClABIVerifyFunctions.cpp
index cd4d87e0703dc4cde28875af6926c02d33133303..dc11f496fe4addb5cc299920ed3651308ef2ac7a 100644
--- a/lib/Analysis/NaCl/PNaClABIVerifyFunctions.cpp
+++ b/lib/Analysis/NaCl/PNaClABIVerifyFunctions.cpp
@@ -16,6 +16,7 @@
#include "llvm/ADT/Twine.h"
#include "llvm/Analysis/NaCl.h"
#include "llvm/Analysis/NaCl/PNaClABITypeChecker.h"
+#include "llvm/Analysis/NaCl/PNaClAllowedIntrinsics.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/IntrinsicInst.h"
@@ -438,13 +439,18 @@ const char *PNaClABIVerifyFunctions::checkInstruction(const DataLayout *DL,
// metadata arguments, so handle them specially.
// TODO(kschimpf) How can we lift this to pnacl-bcdis.
if (const IntrinsicInst *Call = dyn_cast<IntrinsicInst>(Inst)) {
+ if (PNaClAllowedIntrinsics::isAllowedDebugInfoIntrinsic(
+ Call->getIntrinsicID())) {
+ // If debug metadata is allowed, always allow calling debug intrinsics
+ // and assume they are correct.
+ return nullptr;
+ }
for (unsigned ArgNum = 0, E = Call->getNumArgOperands();
ArgNum < E; ++ArgNum) {
const Value *Arg = Call->getArgOperand(ArgNum);
if (!(isValidScalarOperand(Arg) ||
isValidVectorOperand(Arg) ||
- isNormalizedPtr(Arg) ||
- isa<MDNode>(Arg)))
+ isNormalizedPtr(Arg)))
return "bad intrinsic operand";
}
@@ -561,7 +567,7 @@ const char *PNaClABIVerifyFunctions::checkInstruction(const DataLayout *DL,
}
bool PNaClABIVerifyFunctions::runOnFunction(Function &F) {
- const DataLayout *DL = &getAnalysis<DataLayoutPass>().getDataLayout();
+ const DataLayout *DL = &F.getParent()->getDataLayout();
SmallVector<StringRef, 8> MDNames;
F.getContext().getMDKindNames(MDNames);

Powered by Google App Engine
This is Rietveld 408576698